Library OperatingSystem
Library RequestsLibrary
Library DateTime
-Variables ../../../variables/bgpuser/variables.py ${TOOLS_SYSTEM_IP} ${ODL_STREAM}
Resource ../../../variables/Variables.robot
Resource ../../../libraries/BGPcliKeywords.robot
Resource ../../../libraries/BgpOperations.robot
${BGP_PEER2_PREFIX_COUNT} ${PREFIX_COUNT}
${BGP_PEER1_LOG_FILE} bgp_peer1.log
${BGP_PEER2_LOG_FILE} bgp_peer2.log
-${BGP_PEER1_COMMAND} python play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
-${BGP_PEER2_COMMAND} python play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
+${BGP_PEER1_COMMAND} python3 play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
+${BGP_PEER2_COMMAND} python3 play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
${BGP_PEER1_OPTIONS} &>${BGP_PEER1_LOG_FILE}
${BGP_PEER2_OPTIONS} &>${BGP_PEER2_LOG_FILE}
${DEFAULT_LOG_CHECK_TIMEOUT} 20s
[Tags] critical
SSHLibrary.Switch Connection bgp_peer1_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC1_Connect_BGP_Peer2
[Documentation] Connect BGP peer
[Tags] critical
SSHLibrary.Switch Connection bgp_peer2_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC1_BGP_Peer1_Check_Log_For_Introduced_Prefixes
[Documentation] Check incomming updates for new routes
BGPCliKeywords.Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc1_${BGP_PEER2_LOG_FILE}
TC_1_Check_for_Empty_IPv4_Topology
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain prefix
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix
TC1_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
SSHLibrary.Switch Connection bgp_peer1_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC2_Connect_BGP_Peer2
[Documentation] Connect BGP peer
[Tags] critical
SSHLibrary.Switch Connection bgp_peer2_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC2_BGP_Peer1_Check_Log_For_Introduced_Prefixes
[Documentation] Check incomming updates for new routes
BGPCliKeywords.Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc2_${BGP_PEER2_LOG_FILE}
TC_2_Check_for_Empty_IPv4_Topology
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain prefix
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix
TC2_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
SSHLibrary.Switch Connection bgp_peer1_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER1_COMMAND} ${BGP_PEER1_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC3_Connect_BGP_Peer2
[Documentation] Connect BGP peer
[Tags] critical
SSHLibrary.Switch Connection bgp_peer2_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER2_COMMAND} ${BGP_PEER2_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
TC3_BGP_Peer1_Check_Log_For_No_Updates
[Documentation] Check for no updates received by iBGP peer No. 1
[Tags] critical
SSHLibrary.Switch Connection bgp_peer1_console
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} BGPCliKeywords.Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} total_received_update_message_counter: 0 2
+ Comment From neon onwards there is extra BGP End-Of-RIB message
+ ${update_messages} CompareStream.Set_Variable_If_At_Most_Fluorine 0 1
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_LOG_CHECK_TIMEOUT} ${DEFAULT_LOG_CHECK_PERIOD} BGPCliKeywords.Check_File_For_Word_Count ${BGP_PEER1_LOG_FILE} total_received_update_message_counter: ${update_messages} 2
TC3_Disconnect_BGP_Peer1
[Documentation] Stop BGP peer & store logs
[Tags] critical
SSHLibrary.Switch Connection bgp_peer2_console
${log_check_timeout}= DateTime.Convert_Time ${DEFAULT_LOG_CHECK_TIMEOUT} result_format=number
- BuiltIn.Wait_Until_Keyword_Succeeds ${log_check_timeout*2} ${DEFAULT_LOG_CHECK_PERIOD} BGPCliKeywords.Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} total_received_update_message_counter: 0 4
+ Comment From neon onwards there is extra BGP End-Of-RIB message
+ ${update_messages} CompareStream.Set_Variable_If_At_Most_Fluorine 0 1
+ BuiltIn.Wait_Until_Keyword_Succeeds ${log_check_timeout*2} ${DEFAULT_LOG_CHECK_PERIOD} BGPCliKeywords.Check_File_For_Word_Count ${BGP_PEER2_LOG_FILE} total_received_update_message_counter: ${update_messages} 4
TC3_Disconnect_BGP_Peer2
[Documentation] Stop BGP peer & store logs
BGPCliKeywords.Store_File_To_Workspace ${BGP_PEER2_LOG_FILE} tc3_${BGP_PEER2_LOG_FILE}
TC_3_Check_for_Empty_IPv4_Topology
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain prefix
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix
TC3_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
BuiltIn.Set_Suite_Variable ${peer1_cluster_id} 127.0.0.4
BuiltIn.Set_Suite_Variable ${default_cluster_id} 192.0.2.2
BGPCliKeywords.Start_Console_Tool ${BGP_PEER1_COMMAND} --cluster=${peer1_cluster_id} ${BGP_PEER1_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER1_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
SSHLibrary.Switch Connection bgp_peer2_console
BGPCliKeywords.Start_Console_Tool ${BGP_PEER2_COMMAND} --cluster=${BGP_PEER2_IP} ${BGP_PEER2_OPTIONS}
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Content ${CONFIG_SESSION} {"prefix":"${BGP_PEER2_FIRST_PREFIX_IP}/${PREFIX_LEN}"}
-TC4_BGP_Peer1_Check_Log_For_Introduced_Prefixes
+TC4_BGP_Peer1_Check_Rib_Out_For_Introduced_Prefixes
[Documentation] Check incomming updates for new routes and respective cluster-ids
... on first peer which should contain default-cluster id from global config reflected
... from the second peer equal to router-id.
[Tags] critical
CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary IP=${BGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} PEER_NUMBER=2 CLUSTER_ID=${BGP_PEER2_IP} DEFAULT_ID=${default_cluster_id}
- TemplatedRequests.Get_As_Json_Templated ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out mapping=${mapping} session=${CONFIG_SESSION} verify=True
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} TemplatedRequests.Get_As_Json_Templated ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out mapping=${mapping} session=${CONFIG_SESSION}
+ ... verify=True
-TC4_BGP_Peer2_Check_Log_For_Introduced_Prefixes
+TC4_BGP_Peer2_Check_Rib_Out_For_Introduced_Prefixes
[Documentation] Check incomming updates for new routes and respective cluster-ids
... in second peer which has local route-reflector-cluster-id
[Tags] critical
CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary IP=${BGP_PEER2_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} PEER_NUMBER=1 CLUSTER_ID=${BGP_PEER1_IP} DEFAULT_ID=${peer1_cluster_id}
- TemplatedRequests.Get_As_Json_Templated ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out mapping=${mapping} session=${CONFIG_SESSION} verify=True
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} TemplatedRequests.Get_As_Json_Templated ${BGP_VARIABLES_FOLDER}${/}cluster_id/peer_rib_out mapping=${mapping} session=${CONFIG_SESSION}
+ ... verify=True
TC4_Disconnect_BGP_Peers
[Documentation] Stop BGP peer & store logs
TC4_Check_for_Empty_IPv4_Topology
[Documentation] Checks for empty topology after
CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution Test case valid for version fluorine and above.
- BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain prefix
+ BuiltIn.Wait_Until_Keyword_Succeeds ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} ${DEFAULT_TOPOLOGY_CHECK_PERIOD} BgpOperations.Check_Example_IPv4_Topology_Does_Not_Contain ${CONFIG_SESSION} prefix
TC4_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
SSHKeywords.Require_Python
SSHKeywords.Assure_Library_Ipaddr target_dir=.
SSHLibrary.Put_File ${CURDIR}/../../../../tools/fastbgp/play.py
- RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_TOPO_API} auth=${AUTH}
RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${ODL_LOG_LEVEL}
KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.bgpcep