Used BGPcliKeywords to remove some replication.
Fixed Variables.robot path Error.
Change-Id: Iab60063ef46192bb847d102d093105068bbcb7ae
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
Library RequestsLibrary
Variables ${CURDIR}/../variables/Variables.py
Resource ${CURDIR}/RemoteBash.robot
+Resource ${CURDIR}/NexusKeywords.robot
*** Keywords ***
Start_Console_Tool
[Arguments] ${command} ${tool_opt}
[Documentation] Start the tool ${command} ${tool_opt}
- BuiltIn.Log ${command}
- ${output}= SSHLibrary.Write ${command} ${tool_opt}
+ ${start_cmd} BuiltIn.Set_Variable ${command} ${tool_opt}
+ BuiltIn.Log ${start_cmd}
+ ${output}= SSHLibrary.Write ${start_cmd}
+ BuiltIn.Log ${output}
+
+Start_Java_Tool_And_Verify_Connection
+ [Arguments] ${command} ${until_phrase}
+ ${start_cmd} NexusKeywords.Compose_Full_Java_Command ${command}
+ BuiltIn.Log ${start_cmd}
+ SSHLibrary.Set_Client_Configuration timeout=30s
+ SSHLibrary.Write ${start_cmd}
+ ${output}= SSHLibrary.Read_Until ${until_phrase}
BuiltIn.Log ${output}
Wait_Until_Console_Tool_Finish
${output}= SSHLibrary.Read delay=1s
BuiltIn.Log ${output}
+Stop_Console_Tool_And_Wait_Until_Prompt
+ [Documentation] Stops the tool by sending ctrl+c
+ ${output}= SSHLibrary.Read
+ BuiltIn.Log ${output}
+ RemoteBash.Write_Bare_Ctrl_C
+ ${output}= SSHLibrary.Read_Until_Prompt
+ BuiltIn.Log ${output}
+
Read_And_Fail_If_Prompt_Is_Seen
[Documentation] Try to read SSH to see prompt, but expect to see no prompt within SSHLibrary's timeout.
${passed}= BuiltIn.Run_Keyword_And_Return_Status BuiltIn.Run_Keyword_And_Expect_Error No match found for '${ODL_SYSTEM_PROMPT}' in *. Read_Text_Before_Prompt
Library SSHLibrary
Resource Utils.robot
Resource ../variables/Variables.robot
+Resource TemplatedRequests.robot
*** Variables ***
${VAR_BASE_BGP} ${CURDIR}/../variables/bgpfunctional
+${BGP_BMP_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/filled_structure
+${BGP_BMP_FEAT_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/empty_structure
*** Keywords ***
Start Quagga Processes On ODL
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Not_Contain ${response.text} ${string_to_check}
+
+Bmp_Monitor_Precondition
+ [Arguments] ${session}
+ [Documentation] Verify example-bmp-monitor presence in bmp-monitors
+ &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP}
+ BuiltIn.Wait_Until_Keyword_Succeeds 6x 10s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_FEAT_DIR} mapping=${mapping} verify=True
+ ... session=${session}
+
+Bmp_Monitor_Postcondition
+ [Arguments] ${session}
+ [Documentation] Verifies if example-bmp-monitor data contains one peer.
+ &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP}
+ ${output} BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping}
+ ... session=${session} verify=True
+ BuiltIn.Log ${output}
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}
... This program and the accompanying materials are made available under the
... terms of the Eclipse Public License v1.0 which accompanies this distribution,
... and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+... TODO: Remove all old keywords, update pcepuser.robot accordingly
+... TODO: Add new KWs, update all pcep tests to use them.
Library RequestsLibrary
-Library ${CURDIR}/norm_json.py
-Variables ${CURDIR}/../variables/Variables.py
+Library norm_json.py
+Resource ../variables/Variables.robot
+Resource TemplatedRequests.robot
+
+*** Variables ***
+${PCEP_VAR_FOLDER} ${CURDIR}/../variables/tcpmd5user
*** Keywords ***
Setup_Pcep_Operations
${actual_normalized}= norm_json.normalize_json_text ${actual_raw}
BuiltIn.Should_Be_Equal ${actual_normalized} ${expected_normalized}
# TODO: Would the diff approach be more useful?
+
+Pcep_Topology_Precondition
+ [Arguments] ${session}
+ [Documentation] Compare current pcep-topology to empty one.
+ ... Timeout is long enough to see that pcep is ready.
+ BuiltIn.Wait_Until_Keyword_Succeeds 300s 1s TemplatedRequests.Get_As_Json_Templated ${PCEP_VAR_FOLDER}/default_off session=${session} verify=True
... logs will show that one peer will be connected and two will fail.
... After killing karaf which owned connection new owner should be elected and
... this new owner should accept incomming bgp connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
Library SSHLibrary timeout=10s
Library RequestsLibrary
-Variables ${CURDIR}/../../../variables/Variables.robot
-Resource ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource ../../../variables/Variables.robot
+Resource ../../../libraries/SetupUtils.robot
+Resource ../../../libraries/ClusterManagement.robot
+Resource ../../../libraries/SSHKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/ExaBgpLib.robot
*** Variables ***
${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpclustering
${BGP_PEER_FOLDER} ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAUTL_EXA_CFG} exa.cfg
+${DEFAULT_EXA_CFG} exa.cfg
${EXA_CMD} env exabgp.tcp.port=1790 exabgp
-${PEER_CHECK_URL} /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
${HOLDTIME} 180
${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
-Get Example Bgp Rib Owner
+Get_Example_Bgp_Rib_Owner
[Documentation] Find an odl node which is able to accept incomming connection. To this node netconf connector should be configured.
${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib
... org.opendaylight.mdsal.ServiceEntityType 1
Start_ExaBgp_Peer
[Documentation] Starts exabgp
- Start_Tool ${DEFAUTL_EXA_CFG}
+ SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
+ BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG}
Verify ExaBgp Connected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Kill_Current_Owner_Member
[Documentation] Killing karaf which is connected with exabgp.
Verify_ExaBgp_Reconnected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Start_Stopped_Member
[Documentation] Starting stopped node
[Documentation] Verifies started node become candidate for example-bgp-rib
BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s Verify_New_Rib_Candidate_Present ${old_rib_owner} ${living_node}
-Verify ExaBgp Still Connected
+Verify_ExaBgp_Still_Connected
[Documentation] Verifies exabgp's presence in operational ds
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Stop_ExaBgp_Peer
- [Documentation] Stops exabgp
- Stop_Tool
+ [Documentation] Stops exabgp tool by sending ctrl+c
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
+ SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers
SSHKeywords.Flexible_Mininet_Login ${TOOLS_SYSTEM_USER}
SSHKeywords.Virtual_Env_Create
SSHKeywords.Virtual_Env_Install_Package exabgp==3.4.16
- Upload_Config_Files
+ ExaBgpLib.Upload_ExaBgp_Cluster_Config_Files ${BGP_VAR_FOLDER} ${DEFAULT_EXA_CFG}
Teardown_Everything
[Documentation] Suite cleanup
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
-Start_Tool
- [Arguments] ${cfg_file} ${mapping}={}
- [Documentation] Starts the tool
- ${start_cmd} BuiltIn.Set_Variable ${EXA_CMD} ${cfg_file}
- BuiltIn.Log ${start_cmd}
- SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
- ${output}= SSHLibrary.Write ${start_cmd}
- BuiltIn.Log ${output}
-
-Stop_Tool
- [Documentation] Stops the tool by sending ctrl+c
- ${output}= SSHLibrary.Read
- BuiltIn.Log ${output}
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
- SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
-
-Upload_Config_Files
- [Documentation] Uploads exabgp config files.
- SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${DEFAUTL_EXA_CFG} .
- @{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}
-
Verify_New_Rib_Owner_Elected
[Arguments] ${old_owner} ${node_to_ask}
[Documentation] Verifies new owner was elected
[Documentation] Verifies candidate's presence.
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask}
BuiltIn.Should_Contain ${candidates} ${candidate}
-
-Verify_Tools_Connection
- [Arguments] ${session} ${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}${TOOLS_SYSTEM_IP}
- BuiltIn.Log ${rsp.content}
- BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
... logs will show that one peer will be connected and two will fail.
... After stopping karaf which owned connection new owner should be elected and
... this new owner should accept incomming bgp connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
Library SSHLibrary timeout=10s
Library RequestsLibrary
-Variables ${CURDIR}/../../../variables/Variables.robot
-Resource ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource ../../../variables/Variables.robot
+Resource ../../../libraries/SetupUtils.robot
+Resource ../../../libraries/ClusterManagement.robot
+Resource ../../../libraries/SSHKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/ExaBgpLib.robot
*** Variables ***
${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpclustering
${BGP_PEER_FOLDER} ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAUTL_EXA_CFG} exa.cfg
+${DEFAULT_EXA_CFG} exa.cfg
${EXA_CMD} env exabgp.tcp.port=1790 exabgp
-${PEER_CHECK_URL} /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
${HOLDTIME} 180
${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
-Get Example Bgp Rib Owner
+Get_Example_Bgp_Rib_Owner
[Documentation] Find an odl node which is able to accept incomming connection. To this node netconf connector should be configured.
${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib
... org.opendaylight.mdsal.ServiceEntityType 1
Start_ExaBgp_Peer
[Documentation] Starts exabgp
- Start_Tool ${DEFAUTL_EXA_CFG}
+ SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
+ BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG}
-Verify ExaBgp Connected
+Verify_ExaBgp_Connected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Stop_Current_Owner_Member
[Documentation] Stopping karaf which is connected with exabgp.
Verify_ExaBgp_Reconnected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Start_Stopped_Member
[Documentation] Starting stopped node
[Documentation] Verifies started node become candidate for example-bgp-rib
BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s Verify_New_Rib_Candidate_Present ${old_rib_owner} ${living_node}
-Verify ExaBgp Still Connected
+Verify_ExaBgp_Still_Connected
[Documentation] Verifies exabgp's presence in operational ds
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Stop_ExaBgp_Peer
- [Documentation] Stops exabgp
- Stop_Tool
+ [Documentation] Stops exabgp tool by sending ctrl+c
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
+ SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers
SSHKeywords.Flexible_Mininet_Login ${TOOLS_SYSTEM_USER}
SSHKeywords.Virtual_Env_Create
SSHKeywords.Virtual_Env_Install_Package exabgp==3.4.16
- Upload_Config_Files
+ ExaBgpLib.Upload_ExaBgp_Cluster_Config_Files ${BGP_VAR_FOLDER} ${DEFAULT_EXA_CFG}
Teardown_Everything
[Documentation] Suite cleanup
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
-Start_Tool
- [Arguments] ${cfg_file} ${mapping}={}
- [Documentation] Starts the tool
- ${start_cmd} BuiltIn.Set_Variable ${EXA_CMD} ${cfg_file}
- BuiltIn.Log ${start_cmd}
- SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
- ${output}= SSHLibrary.Write ${start_cmd}
- BuiltIn.Log ${output}
-
-Stop_Tool
- [Documentation] Stops the tool by sending ctrl+c
- ${output}= SSHLibrary.Read
- BuiltIn.Log ${output}
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
- SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
-
-Upload_Config_Files
- [Documentation] Uploads exabgp config files.
- SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${DEFAUTL_EXA_CFG} .
- @{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}
-
Verify_New_Rib_Owner_Elected
[Arguments] ${old_owner} ${node_to_ask}
[Documentation] Verifies new owner was elected
[Documentation] Verifies candidate's presence.
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask}
BuiltIn.Should_Contain ${candidates} ${candidate}
-
-Verify_Tools_Connection
- [Arguments] ${session} ${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}${TOOLS_SYSTEM_IP}
- BuiltIn.Log ${rsp.content}
- BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
... logs will show that one peer will be connected and two will fail.
... After killing karaf which owned connection new owner should be elected and
... this new owner should accept incomming BMP connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Resource ../../../variables/Variables.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/ClusterManagement.robot
-Resource ../../../libraries/RemoteBash.robot
-Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/NexusKeywords.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/BgpOperations.robot
*** Variables ***
-${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpclustering
${HOLDTIME} 180
-${BGP_BMP_DIR} ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/filled_structure
-${BGP_BMP_FEAT_DIR} ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/empty_structure
-${BMP_LOG_FILE} bmpmock.log
+${BMP_LOG_FILE} bmpmock.restart.log
+${CONFIG_SESSION} session
*** Test Cases ***
Get_Example_Bm_Owner
BuiltIn.Log ${living_session}
BuiltIn.Set_Suite_Variable ${living_node} ${bm_owner}
-Verify_Bmp_Feature
- [Documentation] Verify example-bmp-monitor presence in bmp-monitors
- &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP}
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_FEAT_DIR} mapping=${mapping} verify=True
- ... session=${living_session}
-
-Start_Bmp_Mock
- [Documentation] Starts bmp mock
- ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level TRACE 2>&1 | tee ${BMP_LOG_FILE}
- BuiltIn.Log ${command}
- SSHLibrary.Set_Client_Configuration timeout=30s
- SSHLibrary.Write ${command}
- ${output}= SSHLibrary.Read_Until successfully established.
- BuiltIn.Log ${output}
-
Verify_Data_Reported_1
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Kill_Current_Owner_Member
[Documentation] Killing cluster node which is connected with bmp mock.
Verify_Data_Reported_2
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Start_Old_Owner_Member
[Documentation] Start killed node
Verify_Data_Reported_3
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Stop_Bmp_Mock
[Documentation] Send ctrl+c to bmp-mock to stop it
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
*** Keywords ***
Setup_Everything
SetupUtils.Setup_Utils_For_Setup_And_Teardown
ClusterManagement.ClusterManagement_Setup
NexusKeywords.Initialize_Artifact_Deployment_And_Usage
- #ClusterManagement.Cluster_Setup_For_Artifact_Deployment_And_Usage
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep bgp-bmp-mock
BuiltIn.Set_Suite_Variable ${filename} ${name}
+ BgpOperations.Bmp_Monitor_Precondition ${CONFIG_SESSION}
+ Start_Bmp_Mock
Teardown_Everything
[Documentation] Suite cleanup
- SSHLibrary.Get_File ${BMP_LOG_FILE}
- ${cnt}= OperatingSystem.Get_File ${BMP_LOG_FILE}
- Log ${cnt}
+ BGPcliKeywords.Store_File_To_Workspace ${BMP_LOG_FILE} ${BMP_LOG_FILE}
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
-Verify_Data_Reported
- [Arguments] ${ip}=${TOOLS_SYSTEM_IP}
- [Documentation] Verifies if the tool reported expected data
- &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${ip}
- ${output}= Wait Until Keyword Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping}
- ... session=${living_session} verify=True
- Log ${output}
+Start_Bmp_Mock
+ [Documentation] Starts bmp mock
+ ${command}= BuiltIn.Set_Variable -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
+ BGPcliKeywords.Start_Java_Tool_And_Verify_Connection ${command} successfully established.
Verify_New_Bm_Owner_Elected
[Arguments] ${old_owner} ${node_to_ask}
[Documentation] Verifies new owner was elected
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device bmp-monitors Bgpcep ${node_to_ask}
+ BuiltIn.Log ${owner}
BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner}
Verify_New_Bm_Candidate_Present
[Arguments] ${candidate} ${node_to_ask}
[Documentation] Verifies candidate's presence.
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device bmp-monitors Bgpcep ${node_to_ask}
+ BuiltIn.Log ${owner}
BuiltIn.Should_Contain ${candidates} ${candidate}
... logs will show that one peer will be connected and two will fail.
... After stopping karaf which owned connection new owner should be elected and
... this new owner should accept incomming BMP connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Resource ../../../variables/Variables.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/ClusterManagement.robot
-Resource ../../../libraries/RemoteBash.robot
-Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/NexusKeywords.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/BgpOperations.robot
*** Variables ***
-${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpclustering
${HOLDTIME} 180
-${BGP_BMP_DIR} ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/filled_structure
-${BGP_BMP_FEAT_DIR} ${CURDIR}/../../../variables/bgpfunctional/bmp_basic/empty_structure
-${BMP_LOG_FILE} bmpmock.log
+${BMP_LOG_FILE} bmpmock.stop.log
+${CONFIG_SESSION} session
*** Test Cases ***
Get_Example_Bm_Owner
BuiltIn.Log ${living_session}
BuiltIn.Set_Suite_Variable ${living_node} ${bm_owner}
-Verify_Bmp_Feature
- [Documentation] Verify example-bmp-monitor presence in bmp-monitors
- &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${TOOLS_SYSTEM_IP}
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_FEAT_DIR} mapping=${mapping} verify=True
- ... session=${living_session}
-
-Start_Bmp_Mock
- [Documentation] Starts bmp mock
- ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level TRACE 2>&1 | tee ${BMP_LOG_FILE}
- BuiltIn.Log ${command}
- SSHLibrary.Set_Client_Configuration timeout=30s
- SSHLibrary.Write ${command}
- ${output}= SSHLibrary.Read_Until successfully established.
- BuiltIn.Log ${output}
-
Verify_Data_Reported_1
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Stop_Current_Owner_Member
[Documentation] Stop cluster node which is connected with bmp mock.
Verify_Data_Reported_2
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Start_Old_Owner_Member
[Documentation] Restart old owner node with bin/start
Verify_Data_Reported_3
[Documentation] Verifies if example-bmp-monitor reported expected data
- Verify_Data_Reported
+ BgpOperations.Bmp_Monitor_Postcondition ${living_session}
Stop_Bmp_Mock
[Documentation] Send ctrl+c to bmp-mock to stop it
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
*** Keywords ***
Setup_Everything
SetupUtils.Setup_Utils_For_Setup_And_Teardown
ClusterManagement.ClusterManagement_Setup
NexusKeywords.Initialize_Artifact_Deployment_And_Usage
- #ClusterManagement.Cluster_Setup_For_Artifact_Deployment_And_Usage
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep bgp-bmp-mock
BuiltIn.Set_Suite_Variable ${filename} ${name}
+ BgpOperations.Bmp_Monitor_Precondition ${CONFIG_SESSION}
+ Start_Bmp_Mock
Teardown_Everything
[Documentation] Suite cleanup
- SSHLibrary.Get_File ${BMP_LOG_FILE}
- ${cnt}= OperatingSystem.Get_File ${BMP_LOG_FILE}
- Log ${cnt}
+ BGPcliKeywords.Store_File_To_Workspace ${BMP_LOG_FILE} ${BMP_LOG_FILE}
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
-Verify_Data_Reported
- [Arguments] ${ip}=${TOOLS_SYSTEM_IP}
- [Documentation] Verifies if the tool reported expected data
- &{mapping} BuiltIn.Create_Dictionary TOOL_IP=${ip}
- ${output}= Wait Until Keyword Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated folder=${BGP_BMP_DIR} mapping=${mapping}
- ... session=${living_session} verify=True
- Log ${output}
+Start_Bmp_Mock
+ [Documentation] Starts bmp mock
+ ${command}= BuiltIn.Set_Variable -jar ${filename} --local_address ${TOOLS_SYSTEM_IP} --remote_address ${ODL_SYSTEM_1_IP}:12345,${ODL_SYSTEM_2_IP}:12345,${ODL_SYSTEM_3_IP}:12345 --routers_count 1 --peers_count 1 --log_level INFO 2>&1 | tee ${BMP_LOG_FILE}
+ BGPcliKeywords.Start_Java_Tool_And_Verify_Connection ${command} successfully established.
Verify_New_Bm_Owner_Elected
[Arguments] ${old_owner} ${node_to_ask}
[Documentation] Verifies new owner was elected
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device bmp-monitors Bgpcep ${node_to_ask}
+ BuiltIn.Log ${owner}
BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner}
Verify_New_Bm_Candidate_Present
[Arguments] ${candidate} ${node_to_ask}
[Documentation] Verifies candidate's presence.
${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device bmp-monitors Bgpcep ${node_to_ask}
+ BuiltIn.Log ${owner}
BuiltIn.Should_Contain ${candidates} ${candidate}
... logs will show that one peer will be connected and two will fail.
... After killing karaf which owned connection new owner should be elected and
... this new owner should accept incomming PCC connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Resource ../../../variables/Variables.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/ClusterManagement.robot
-Resource ../../../libraries/RemoteBash.robot
Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/NexusKeywords.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/PcepOperations.robot
*** Variables ***
${HOLDTIME} 180
${DIR_WITH_TEMPLATES} ${CURDIR}/../../../variables/bgpclustering/
+${PCC_LOG_FILE} pccmock.restart.log
+${CONFIG_SESSION} session
*** Test Cases ***
Get_Example_Pcep_Owner
Verify_Data_Reported_1
[Documentation] Verifies if pcep-topology reported expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Kill_Current_Owner_Member
[Documentation] Killing cluster node which is connected with pcc-mock.
Verify_Data_Reported_2
[Documentation] Verifies if pcep-topology reports expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Start_Stopped_Member
[Documentation] Starting stopped node
Verify_Data_Reported_3
[Documentation] Verifies if pcep-topology reported expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Stop_Pcc_Mock
[Documentation] Send ctrl+c to pcc-mock to stop it.
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
*** Keywords ***
Setup_Everything
SetupUtils.Setup_Utils_For_Setup_And_Teardown
ClusterManagement.ClusterManagement_Setup
NexusKeywords.Initialize_Artifact_Deployment_And_Usage
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep pcep-pcc-mock
BuiltIn.Set_Suite_Variable ${filename} ${name}
#Setting Pcc Name and its code for mapping for templates
+ #TODO: Move variable definitions into PcepOperations setup after its update
BuiltIn.Set_Suite_Variable ${pcc_name} pcc_${TOOLS_SYSTEM_IP}_tunnel_1
${code}= Evaluate binascii.b2a_base64('${pcc_name}')[:-1] modules=binascii
BuiltIn.Set_Suite_Variable ${pcc_name_code} ${code}
+ PcepOperations.Pcep_Topology_Precondition ${CONFIG_SESSION}
Start_Pcc_Mock
Teardown_Everything
[Documentation] Suite cleanup
- SSHLibrary.Get_File pccmock.log
- ${cnt}= OperatingSystem.Get_File pccmock.log
- Log ${cnt}
+ BGPcliKeywords.Store_File_To_Workspace ${PCC_LOG_FILE} ${PCC_LOG_FILE}
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
Start_Pcc_Mock
[Documentation] Starts pcc mock
- ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee pccmock.log
- BuiltIn.Log ${command}
- SSHLibrary.Set_Client_Configuration timeout=30s
- SSHLibrary.Write ${command}
- ${output}= SSHLibrary.Read_Until started
- BuiltIn.Log ${output}
-
-Verify_Data_Reported
+ ${command}= BuiltIn.Set_Variable -jar ${filename} --reconnect 1 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
+ BGPcliKeywords.Start_Java_Tool_And_Verify_Connection ${command} started
+
+Pcep_Topology_Postcondition
[Documentation] Verifies if the tool reported expected data
&{mapping} BuiltIn.Create_Dictionary IP=${TOOLS_SYSTEM_IP} CODE=${pcc_name_code} NAME=${pcc_name} IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}
BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated ${DIR_WITH_TEMPLATES}${/}pcep_on_state ${mapping} ${living_session}
... logs will show that one peer will be connected and two will fail.
... After stopping karaf which owned connection new owner should be elected and
... this new owner should accept incomming PCC connection.
+... TODO: Add similar keywords from all bgpclustering-ha tests into same libraries
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Resource ../../../variables/Variables.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/ClusterManagement.robot
-Resource ../../../libraries/RemoteBash.robot
Resource ../../../libraries/TemplatedRequests.robot
Resource ../../../libraries/NexusKeywords.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/PcepOperations.robot
*** Variables ***
${HOLDTIME} 180
${DIR_WITH_TEMPLATES} ${CURDIR}/../../../variables/bgpclustering/
+${PCC_LOG_FILE} pccmock.stop.log
+${CONFIG_SESSION} session
*** Test Cases ***
Get_Example_Pcep_Owner
Verify_Data_Reported_1
[Documentation] Verifies if pcep-topology reported expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Stop_Current_Owner_Member
[Documentation] Stopping cluster node which is connected with pcc-mock.
Verify_Data_Reported_2
[Documentation] Verifies if pcep-topology reports expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Start_Stopped_Member
[Documentation] Starting stopped node
Verify_Data_Reported_3
[Documentation] Verifies if pcep-topology reported expected data
... Expects pcep-topology not be empty/filled path-computation.
- Verify_Data_Reported
+ Pcep_Topology_Postcondition
Stop_Pcc_Mock
[Documentation] Send ctrl+c to pcc-mock to stop it.
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
*** Keywords ***
Setup_Everything
SetupUtils.Setup_Utils_For_Setup_And_Teardown
ClusterManagement.ClusterManagement_Setup
NexusKeywords.Initialize_Artifact_Deployment_And_Usage
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
${name}= NexusKeywords.Deploy_Test_Tool bgpcep pcep-pcc-mock
BuiltIn.Set_Suite_Variable ${filename} ${name}
#Setting Pcc Name and its code for mapping for templates
BuiltIn.Set_Suite_Variable ${pcc_name} pcc_${TOOLS_SYSTEM_IP}_tunnel_1
${code}= Evaluate binascii.b2a_base64('${pcc_name}')[:-1] modules=binascii
BuiltIn.Set_Suite_Variable ${pcc_name_code} ${code}
+ PcepOperations.Pcep_Topology_Precondition ${CONFIG_SESSION}
Start_Pcc_Mock
Teardown_Everything
[Documentation] Suite cleanup
- SSHLibrary.Get_File pccmock.log
- ${cnt}= OperatingSystem.Get_File pccmock.log
- Log ${cnt}
+ BGPcliKeywords.Store_File_To_Workspace ${PCC_LOG_FILE} ${PCC_LOG_FILE}
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
Start_Pcc_Mock
[Documentation] Starts pcc mock
- ${command}= NexusKeywords.Compose_Full_Java_Command -jar ${filename} --reconnect 5 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee pccmock.log
- BuiltIn.Log ${command}
- SSHLibrary.Set_Client_Configuration timeout=30s
- SSHLibrary.Write ${command}
- ${output}= SSHLibrary.Read_Until started
- BuiltIn.Log ${output}
-
-Verify_Data_Reported
+ ${command}= BuiltIn.Set_Variable -jar ${filename} --reconnect 5 --local-address ${TOOLS_SYSTEM_IP} --remote-address ${ODL_SYSTEM_1_IP}:4189,${ODL_SYSTEM_2_IP}:4189,${ODL_SYSTEM_3_IP}:4189 --log-level INFO 2>&1 | tee ${PCC_LOG_FILE}
+ BGPcliKeywords.Start_Java_Tool_And_Verify_Connection ${command} started
+
+Pcep_Topology_Postcondition
[Documentation] Verifies if the tool reported expected data
&{mapping} BuiltIn.Create_Dictionary IP=${TOOLS_SYSTEM_IP} CODE=${pcc_name_code} NAME=${pcc_name} IP_ODL=${ODL_SYSTEM_${pcep_owner}_IP}
BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s TemplatedRequests.Get_As_Json_Templated ${DIR_WITH_TEMPLATES}${/}pcep_on_state ${mapping} ${living_session}
Test Teardown SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
Library SSHLibrary timeout=10s
Library RequestsLibrary
-Variables ${CURDIR}/../../../variables/Variables.py
-Resource ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource ${CURDIR}/../../../libraries/ClusterManagement.robot
-Resource ${CURDIR}/../../../libraries/RemoteBash.robot
-Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
+Resource ../../../variables/Variables.robot
+Resource ../../../libraries/SetupUtils.robot
+Resource ../../../libraries/ClusterManagement.robot
+Resource ../../../libraries/SSHKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/ExaBgpLib.robot
*** Variables ***
${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpclustering
${BGP_PEER_FOLDER} ${CURDIR}/../../../variables/bgpclustering/bgp_peer_openconf
-${DEFAUTL_EXA_CFG} exa.cfg
+${DEFAULT_EXA_CFG} exa.cfg
${EXA_CMD} env exabgp.tcp.port=1790 exabgp
-${PEER_CHECK_URL} /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
${HOLDTIME} 180
${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
-Get Example Bgp Rib Owner
+Get_Example_Bgp_Rib_Owner
[Documentation] Find an odl node which is able to accept incomming connection. To this node netconf connector should be configured.
${rib_owner} ${rib_candidates}= BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ClusterManagement.Get_Owner_And_Successors_For_Device example-bgp-rib
- ... Bgpcep 1
+ ... org.opendaylight.mdsal.ServiceEntityType 1
BuiltIn.Set Suite variable ${rib_owner}
BuiltIn.Log ${ODL_SYSTEM_${rib_owner}_IP}
BuiltIn.Set Suite variable ${rib_candidates}
Start_ExaBgp_Peer
[Documentation] Starts exabgp
- Start_Tool ${DEFAUTL_EXA_CFG}
+ SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
+ BGPcliKeywords.Start_Console_Tool ${EXA_CMD} ${DEFAULT_EXA_CFG}
-Verify ExaBgp Connected
+Verify_ExaBgp_Connected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Isolate_Current_Owner_Member
[Documentation] Isolating cluster node which is connected with exabgp.
Verify_ExaBgp_Reconnected
[Documentation] Verifies exabgp's presence in operational ds.
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Rejoin_Isolated_Member
[Documentation] Rejoin isolated node
[Documentation] Verifies started node become candidate for example-bgp-rib
BuiltIn.Wait_Until_Keyword_Succeeds 10x 5s Verify_New_Rib_Candidate_Present ${old_rib_owner} ${living_node}
-Verify ExaBgp Still Connected
+Verify_ExaBgp_Still_Connected
[Documentation] Verifies exabgp's presence in operational ds
- BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s Verify_Tools_Connection ${living_session}
+ BuiltIn.Wait_Until_Keyword_Succeeds 5x 2s ExaBgpLib.Verify_ExaBgps_Connection ${living_session}
Stop_ExaBgp_Peer
[Documentation] Stops exabgp
- Stop_Tool
+ BGPcliKeywords.Stop_Console_Tool_And_Wait_Until_Prompt
+ SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers
SSHKeywords.Flexible_Mininet_Login ${TOOLS_SYSTEM_USER}
SSHKeywords.Virtual_Env_Create
SSHKeywords.Virtual_Env_Install_Package exabgp==3.4.16
- Upload_Config_Files
+ ExaBgpLib.Upload_ExaBgp_Cluster_Config_Files ${BGP_VAR_FOLDER} ${DEFAULT_EXA_CFG}
Teardown_Everything
[Documentation] Suite cleanup
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
-Start_Tool
- [Arguments] ${cfg_file} ${mapping}={}
- [Documentation] Starts the tool
- ${start_cmd} BuiltIn.Set_Variable ${EXA_CMD} ${cfg_file}
- BuiltIn.Log ${start_cmd}
- SSHKeywords.Virtual_Env_Activate_On_Current_Session log_output=${True}
- ${output}= SSHLibrary.Write ${start_cmd}
- BuiltIn.Log ${output}
-
-Stop_Tool
- [Documentation] Stops the tool by sending ctrl+c
- ${output}= SSHLibrary.Read
- BuiltIn.Log ${output}
- RemoteBash.Write_Bare_Ctrl_C
- ${output}= SSHLibrary.Read_Until_Prompt
- BuiltIn.Log ${output}
- SSHKeywords.Virtual_Env_Deactivate_On_Current_Session log_output=${True}
-
-Upload_Config_Files
- [Documentation] Uploads exabgp config files.
- SSHLibrary.Put_File ${BGP_VAR_FOLDER}/${DEFAUTL_EXA_CFG} .
- @{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}
-
Verify_New_Rib_Owner_Elected
[Arguments] ${old_owner} ${node_to_ask}
[Documentation] Verifies new owner was elected
- ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask}
+ ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask}
BuiltIn.Should_Not_Be_Equal ${old_owner} ${owner}
Verify_New_Rib_Candidate_Present
[Arguments] ${candidate} ${node_to_ask}
[Documentation] Verifies candidate's presence.
- ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib Bgpcep ${node_to_ask}
+ ${owner} ${candidates}= ClusterManagement.Get_Owner_And_Successors_For_device example-bgp-rib org.opendaylight.mdsal.ServiceEntityType ${node_to_ask}
BuiltIn.Should_Contain ${candidates} ${candidate}
-
-Verify_Tools_Connection
- [Arguments] ${session} ${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}${TOOLS_SYSTEM_IP} timeout=10
- BuiltIn.Log ${rsp.content}
- BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
BuiltIn.Set_Suite_Variable ${filename} ${name}
Tear_It_Down
- [Documentation] Download pccmock.log and Log its contents.
+ [Documentation] Download bmpmock.log and Log its contents.
... Compute and Log the diff between expected and actual normalized responses.
... Close both HTTP client session and SSH connection to Mininet.
SSHLibrary.Get_File ${BMP_LOG_FILE}