Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
Test Teardown FailFast.Start_Failing_Fast_If_This_Failed
+Library Collections
Library OperatingSystem
Library RequestsLibrary
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/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
-Resource ${CURDIR}/../../../libraries/KarafKeywords.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
${BGP_VARIABLES_FOLDER} ${CURDIR}/../../../variables/bgpuser/
${HOLDTIME} 180
${BGP_PEER_LOG_LEVEL} debug
-${CONTROLLER_LOG_LEVEL} INFO
-${CONTROLLER_BGP_LOG_LEVEL} DEFAULT
+${ODL_LOG_LEVEL} INFO
+${ODL_BGP_LOG_LEVEL} DEFAULT
${iBGP_PEER1_IP} 127.0.0.1
${eBGP_PEER1_IP} 127.0.0.3
${eBGP_PEER2_IP} 127.0.0.4
${DEFAULT_LOG_CHECK_PERIOD} 1s
${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} 10s
${DEFAULT_TOPOLOGY_CHECK_PERIOD} 1s
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
*** Test Cases ***
Configure_BGP_Peers
[Documentation] Configure an iBGP and two eBGP peers
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ibgp-peer1', 'IP': '${iBGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'ibgp', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer1', 'IP': '${eBGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'PEER_ROLE': 'ebgp', 'AS_NUMBER': '${eBGP_PEER1_AS}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer2', 'IP': '${eBGP_PEER2_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'ebgp', 'AS_NUMBER': '${eBGP_PEER2_AS}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ibgp-peer1'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- BuiltIn.Log ${result}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer1'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
- BuiltIn.Log ${result}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer2'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
- BuiltIn.Log ${result}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ibgp-peer1 IP=${iBGP_PEER1_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=ibgp INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=false
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ebgp-peer1 IP=${eBGP_PEER1_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=ebgp INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=false AS_NUMBER=${eBGP_PEER1_AS}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ebgp-peer2 IP=${eBGP_PEER2_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=ebgp INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=false AS_NUMBER=${eBGP_PEER2_AS}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping}
Connect_iBGP_Peer1
[Documentation] Connect BGP peer
Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ibgp-peer1'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer1'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-ebgp-peer2'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ebgp_peers ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ibgp-peer1 IP=${iBGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping}
+ Collections.Set To Dictionary ${mapping} NAME=example-ebgp-peer1 IP=${eBGP_PEER1_IP}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping}
+ Collections.Set To Dictionary ${mapping} NAME=example-ebgp-peer2 IP=${eBGP_PEER2_IP}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping}
*** Keywords ***
Setup_Everything
- [Documentation] SSH-login to mininet machine, create HTTP session,
+ [Documentation] Initialize SetupUtils. SSH-login to mininet machine, create HTTP session,
... prepare directories for responses, put Python tool to mininet machine, setup imported resources.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
SSHLibrary.Set_Default_Configuration prompt=${ODL_SYSTEM_PROMPT}
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}
- ConfigViaRestconf.Setup_Config_Via_Restconf
- KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_LOG_LEVEL}
- KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_BGP_LOG_LEVEL} org.opendaylight.bgpcep
- KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${CONTROLLER_BGP_LOG_LEVEL} org.opendaylight.protocol
+ TemplatedRequests.Create_Default_Session
+ 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
+ KarafKeywords.Execute_Controller_Karaf_Command_On_Background log:set ${ODL_BGP_LOG_LEVEL} org.opendaylight.protocol
Teardown_Everything
[Documentation] Create and Log the diff between expected and actual responses, make sure Python tool was killed.
... Tear down imported Resources.
KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections