X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=csit%2Flibraries%2FExaBgpLib.robot;h=6b38c48622ee2efd6f63549aa15bb31fb369f9ab;hb=38c82b3551b9487be9f8d8ea73b91580a280df7f;hp=cee977a3136840c4085364d3cf86f89695d4845b;hpb=57ffdb8b0bb58c5392d0d7989a9d8e9bf794fdd9;p=integration%2Ftest.git diff --git a/csit/libraries/ExaBgpLib.robot b/csit/libraries/ExaBgpLib.robot index cee977a313..6b38c48622 100644 --- a/csit/libraries/ExaBgpLib.robot +++ b/csit/libraries/ExaBgpLib.robot @@ -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,8 +42,15 @@ 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}=${1} + [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 ... of the peer in the bgp rib. : FOR ${idx} IN RANGE ${connection_retries} @@ -53,9 +62,24 @@ Start_ExaBgp_And_Verify_Connected BuiltIn.Fail Unable to connect ExaBgp to ODL Verify_ExaBgps_Connection - [Arguments] ${session} ${exabgp_ip} ${connected}=${True} + [Arguments] ${session} ${exabgp_ip}=${TOOLS_SYSTEM_IP} ${connected}=${True} [Documentation] Checks peer presence in operational datastore ${exp_status_code}= BuiltIn.Set_Variable_If ${connected} ${200} ${404} ${rsp}= RequestsLibrary.Get Request ${session} ${PEER_CHECK_URL}${exabgp_ip} BuiltIn.Log ${rsp.content} BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code} + +Upload_ExaBgp_Cluster_Config_Files + [Arguments] ${bgp_var_folder} ${cfg_file} + [Documentation] Uploads exabgp config files. + SSHLibrary.Put_File ${bgp_var_folder}/${cfg_file} . + @{cfgfiles}= SSHLibrary.List_Files_In_Directory . *.cfg + : FOR ${cfgfile} IN @{cfgfiles} + \ SSHLibrary.Execute_Command sed -i -e 's/EXABGPIP/${TOOLS_SYSTEM_IP}/g' ${cfgfile} + \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP1/${ODL_SYSTEM_1_IP}/g' ${cfgfile} + \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP2/${ODL_SYSTEM_2_IP}/g' ${cfgfile} + \ SSHLibrary.Execute_Command sed -i -e 's/ODLIP3/${ODL_SYSTEM_3_IP}/g' ${cfgfile} + \ SSHLibrary.Execute_Command sed -i -e 's/ROUTEREFRESH/disable/g' ${cfgfile} + \ SSHLibrary.Execute_Command sed -i -e 's/ADDPATH/disable/g' ${cfgfile} + \ ${stdout}= SSHLibrary.Execute_Command cat ${cfgfile} + \ Log ${stdout}