BGP RIB policies test
[integration/test.git] / csit / libraries / ExaBgpLib.robot
index 6173e89ae75d15a861933b87abc7f8dfffd55881..6b38c48622ee2efd6f63549aa15bb31fb369f9ab 100644 (file)
@@ -15,8 +15,10 @@ Documentation     Robot keyword library (Resource) for handling the ExaBgp tool.
 Library           SSHLibrary
 Resource          ${CURDIR}/SSHKeywords.robot
 Resource          ${CURDIR}/RemoteBash.robot
+Resource          ${CURDIR}/BGPcliKeywords.robot
 
 *** Variables ***
+${EXABGP_KILL_COMMAND}    ps axf | grep exabgp | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
 ${CMD}            env exabgp.tcp.port=1790 exabgp --debug
 ${PEER_CHECK_URL}    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
 
@@ -40,6 +42,13 @@ Stop_ExaBgp
     BuiltIn.Log    ${output}
     SSHKeywords.Virtual_Env_Deactivate_On_Current_Session    log_output=${True}
 
+Stop_All_ExaBgps
+    [Documentation]    Sends kill command to stop all exabgps running
+    ${output}    SSHLibrary.Read
+    BuiltIn.Log    ${output}
+    ${output}    SSHLibrary.Write    ${EXABGP_KILL_COMMAND}
+    BuiltIn.Log    ${output}
+
 Start_ExaBgp_And_Verify_Connected
     [Arguments]    ${cfg_file}    ${session}    ${exabgp_ip}    ${connection_retries}=${3}
     [Documentation]    Starts the ExaBgp and verifies its connection. The verification is done by checking the presence