... and is available at http://www.eclipse.org/legal/epl-v10.html
...
... Test suite performs basic BGP functional test cases:
-... BGP peer initiated coonection
+... BGP peer initiated connection
... - introduce and check 3 prefixes in one update message
-... ODL controller initiated coonection:
+... ODL controller initiated connection:
... - introduce and check 3 prefixes in one update message
... - introduce 2 prefixes in first update message and then additional 2 prefixes
... in another update while the very first prefix is withdrawn
... - introduce 3 prefixes and try to withdraw the first one
... (to be ignored by controller) in a single update message
...
+... For versions Oxygen and further, there are TC_R (test case reset) which
+... test session-reset functionality.
+... Resets the session, and than verifies that example-ipv4-topology is empty again.
+...
+... For versions Fluorine and further, there are TC_PG (test case peer group) which
+... test configuration and reconfiguration of peer-groups and neighbors configured by them.
+... - configure peer-group, and assign neighbor to this peer-group
+... - check filled topology
+... - reconfigure peer-group without ipv4 unicast afi-safi
+... - check empty topology
+... - reconfigre neighbor without peer-group, delete peer-group
+...
... Brief description how to perform BGP functional test:
... https://wiki.opendaylight.org/view/BGP_LS_PCEP:Lithium_Feature_Tests#How_to_test_2
...
Library OperatingSystem
Library SSHLibrary timeout=10s
Library RequestsLibrary
-Library ${CURDIR}/../../../libraries/norm_json.py
-Variables ${CURDIR}/../../../variables/Variables.py
-Variables ${CURDIR}/../../../variables/bgpuser/variables.py ${TOOLS_SYSTEM_IP} ${ODL_STREAM}
-Resource ${CURDIR}/../../../libraries/BGPcliKeywords.robot
-Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource ${CURDIR}/../../../libraries/FailFast.robot
-Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
-Resource ${CURDIR}/../../../libraries/SetupUtils.robot
-Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
-Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
-Resource ${CURDIR}/../../../libraries/Utils.robot
-Resource ${CURDIR}/../../../libraries/WaitForFailure.robot
-Resource ${CURDIR}/../../../libraries/CompareStream.robot
+Library ../../../libraries/norm_json.py
+Variables ../../../variables/bgpuser/variables.py ${TOOLS_SYSTEM_IP} ${ODL_STREAM}
+Resource ../../../variables/Variables.robot
+Resource ../../../libraries/BGPcliKeywords.robot
+Resource ../../../libraries/BGPSpeaker.robot
+Resource ../../../libraries/FailFast.robot
+Resource ../../../libraries/KillPythonTool.robot
+Resource ../../../libraries/SetupUtils.robot
+Resource ../../../libraries/SSHKeywords.robot
+Resource ../../../libraries/TemplatedRequests.robot
+Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/WaitForFailure.robot
+Resource ../../../libraries/CompareStream.robot
*** Variables ***
${ACTUAL_RESPONSES_FOLDER} ${TEMPDIR}/actual
${ODL_LOG_LEVEL} INFO
${ODL_BGP_LOG_LEVEL} DEFAULT
${CONFIG_SESSION} session
+${PEER_GROUP} internal-neighbors
${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
${DEVICE_NAME} controller-config
${BGP_PEER_NAME} example-bgp-peer
[Tags] critical
Wait_For_Topology_To_Change_To ${filled_json} 020_Filled.json
-Reset_Bgp_Peer_Session
- [Documentation] Reset Peer Session (Oxygen only)
+TC_R_Reset_Bgp_Peer_Session
+ [Documentation] Reset Peer Session
[Tags] Critical
&{mapping} Create Dictionary IP=${TOOLS_SYSTEM_IP} RIB_INSTANCE_NAME=${RIB_INSTANCE}
CompareStream.Run_Keyword_If_At_Least_Oxygen TemplatedRequests.Post_As_Xml_Templated folder=${BGP_VARIABLES_FOLDER}${/}peer_session/restart mapping=${mapping} session=${CONFIG_SESSION}
-Check_For_Empty_Topology_After_Resetting
- [Documentation] See example-ipv4-topology empty after resetting session (Oxygen only)
+TC_R_Check_For_Empty_Topology_After_Resetting
+ [Documentation] See example-ipv4-topology empty after resetting session
[Tags] critical
CompareStream.Run_Keyword_If_At_Least_Oxygen Wait_For_Topology_To_Change_To ${empty_json} 030_Empty.json
+TC_PG_Reconfigure_ODL_With_Peer_Group_To_Accept_Connection
+ [Documentation] Configure BGP peer module with initiate-connection set to false.
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Configure_Peer_Group
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_GROUP_NAME=${PEER_GROUP} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} session=${CONFIG_SESSION}
+ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
+TC_PG_Restart_Talking_BGP_Speaker
+ [Documentation] Abort the Python speaker. Also, attempt to stop failing fast.
+ [Tags] critical
+ [Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Restart_Talking_BGP_Speaker
+ [Teardown] FailFast.Do_Not_Start_Failing_If_This_Failed
+
+TC_PG_Check_Talking_Topology_Is_Filled
+ [Documentation] See new routes in example-ipv4-topology as a proof that synchronization was correct.
+ [Tags] critical
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Wait_For_Topology_To_Change_To ${filled_json} 021_Filled.json
+
+TC_PG_Reconfigure_ODL_With_Peer_Group_Without_Ipv4_Unicast
+ [Documentation] Configure BGP peer module with initiate-connection set to false. (Fluorine only)
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Configure_Peer_Group peer_group_folder=peer_group_without_ipv4
+ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
+TC_PG_Check_For_Empty_Topology_After_Deconfiguration
+ [Documentation] See example-ipv4-topology empty after resetting session (Fluorine only)
+ [Tags] critical
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Wait_For_Topology_To_Change_To ${empty_json} 031_Empty.json
+
+TC_PG_Reconfigure_ODL_To_Accept_Connection
+ [Documentation] Configure BGP peer module with initiate-connection set to false. (Fluorine only)
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_GROUP_NAME=${PEER_GROUP} INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer_group mapping=${mapping} session=${CONFIG_SESSION}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ CompareStream.Run_Keyword_If_At_Least_Fluorine Deconfigure_Peer_Group
+ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
+
Kill_Talking_BGP_Speaker
[Documentation] Abort the Python speaker. Also, attempt to stop failing fast.
[Tags] critical
[Documentation] Run netstat in mininet machine and parse it for number of established connections. Check it is ${howmany}.
${output}= SSHKeywords.Count_Port_Occurences 17900 ESTABLISHED python
BuiltIn.Should_Be_Equal_As_Strings ${output} ${howmany}
+
+Configure_Peer_Group
+ [Arguments] ${peer_group_folder}=peer_group
+ [Documentation] Configures peer group which is template for all the neighbors which are going
+ ... to be configured. Also after PUT, this case verifies presence of peer group within
+ ... peer-groups. This case is specific to versions Fluorine and above.
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE}
+ ... PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE} PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}${peer_group_folder} mapping=${mapping} session=${CONFIG_SESSION}
+ TemplatedRequests.Get_As_Json_Templated ${BGP_VARIABLES_FOLDER}${/}verify_${peer_group_folder} mapping=${mapping} session=${CONFIG_SESSION} verify=True
+
+Deconfigure_Peer_Group
+ [Documentation] Deconfigures peer group which is template for all the neighbors
+ ... This test case is specific to versions Fluorine and above.
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT} INITIATE=false BGP_RIB=${RIB_INSTANCE}
+ ... PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE} PEER_GROUP_NAME=${PEER_GROUP} RR_CLIENT=false
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}peer_group mapping=${mapping} session=${CONFIG_SESSION}
+
+Restart_Talking_BGP_Speaker
+ [Documentation] Abort the Python speaker. Also, attempt to stop failing fast. And Start it again.
+ ... We have to restart it this way because we reset session before
+ BGPSpeaker.Kill_BGP_Speaker
+ FailFast.Do_Not_Fail_Fast_From_Now_On
+ BGPSpeaker.Start_BGP_Speaker --amount 3 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_TOOL_LOG_LEVEL}
+ Read_And_Fail_If_Prompt_Is_Seen