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/TemplatedRequests.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
Resource ${CURDIR}/../../../libraries/Utils.robot
Resource ${CURDIR}/../../../libraries/WaitForFailure.robot
+Resource ${CURDIR}/../../../libraries/CompareStream.robot
*** Variables ***
${ACTUAL_RESPONSES_FOLDER} ${TEMPDIR}/actual
${CONTROLLER_BGP_LOG_LEVEL} DEFAULT
${BGP_PEER_COMMAND} python play.py --amount 0 --myip=${TOOLS_SYSTEM_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL}
${BGP_PEER_OPTIONS} ${EMPTY}
-${BGP_APP_PEER_ID} 10.0.0.10
+${BGP_APP_PEER_ID} ${ODL_SYSTEM_IP}
${BGP_APP_PEER_POST_COMMAND} python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command post --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
${BGP_APP_PEER_PUT_COMMAND} python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command put --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
${BGP_APP_PEER_DELETE_COMMAND} python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command delete --count 3 --prefix 8.0.1.0 --prefixlen 28 --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
${BGP_APP_PEER_GET_COMMAND} python bgp_app_peer.py --host ${ODL_SYSTEM_IP} --port ${RESTCONFPORT} --command get --${BGP_APP_PEER_LOG_LEVEL} --stream=${ODL_STREAM}
${BGP_APP_PEER_OPTIONS} &>/dev/null
${BGP_APP_PEER_TIMEOUT} 30s
+${BGP_PEER_APP_NAME} example-bgp-peer-app
+${CONFIG_SESSION} session
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
+${BGP_PEER_NAME} example-bgp-peer
+${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
Reconfigure_ODL_To_Accept_BGP_Peer_Connection
[Documentation] Configure BGP peer module with initiate-connection set to false.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} 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}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
Reconfigure_ODL_To_Accept_BGP_Application_Peer
[Documentation] Configure BGP application peer module.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer-app', 'IP': '${BGP_APP_PEER_ID}'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${BGP_PEER_APP_NAME} RIB_INSTANCE_NAME=${RIB_INSTANCE} IP=${BGP_APP_PEER_ID} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer mapping=${mapping} session=${CONFIG_SESSION}
Check_For_Empty_Example-IPv4-Topology
[Documentation] Sanity check example-ipv4-topology is up but empty.
[Documentation] Start BGP application peer tool and give it ${BGP_APP_PEER_TIMEOUT}
[Tags] critical
Switch_To_BGP_Application_Peer_Console
- Start_Console_Tool ${BGP_APP_PEER_POST_COMMAND} ${BGP_APP_PEER_OPTIONS}
+ Start_Console_Tool ${BGP_APP_PEER_POST_COMMAND} ${scritp_uri_opt} ${BGP_APP_PEER_OPTIONS}
Wait_Until_Console_Tool_Finish ${BGP_APP_PEER_TIMEOUT}
Store_File_To_Workspace bgp_app_peer.log bgp_app_peer_initial_post_tc1.log
[Documentation] Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
[Tags] critical
Switch_To_BGP_Application_Peer_Console
- Start_Console_Tool ${BGP_APP_PEER_DELETE_COMMAND} ${BGP_APP_PEER_OPTIONS}
+ Start_Console_Tool ${BGP_APP_PEER_DELETE_COMMAND} ${scritp_uri_opt} ${BGP_APP_PEER_OPTIONS}
Wait_Until_Console_Tool_Finish ${BGP_APP_PEER_TIMEOUT}
Store_File_To_Workspace bgp_app_peer.log bgp_app_peer_delete_tc1.log
[Documentation] Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
[Tags] critical
Switch_To_BGP_Application_Peer_Console
- Start_Console_Tool ${BGP_APP_PEER_PUT_COMMAND} ${BGP_APP_PEER_OPTIONS}
+ Start_Console_Tool ${BGP_APP_PEER_PUT_COMMAND} ${scritp_uri_opt} ${BGP_APP_PEER_OPTIONS}
Wait_Until_Console_Tool_Finish ${BGP_APP_PEER_TIMEOUT}
Store_File_To_Workspace bgp_app_peer.log bgp_app_peer_put_tc2.log
[Documentation] Start BGP application peer tool and give him ${BGP_APP_PEER_TIMEOUT}
[Tags] critical
Switch_To_BGP_Application_Peer_Console
- Start_Console_Tool ${BGP_APP_PEER_DELETE_ALL_COMMAND} ${BGP_APP_PEER_OPTIONS}
+ Start_Console_Tool ${BGP_APP_PEER_DELETE_ALL_COMMAND} ${scritp_uri_opt} ${BGP_APP_PEER_OPTIONS}
Wait_Until_Console_Tool_Finish ${BGP_APP_PEER_TIMEOUT}
Store_File_To_Workspace bgp_app_peer.log bgp_app_peer_delete_all_tc2.log
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
Delete_Bgp_Application_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer-app'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${BGP_PEER_APP_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer mapping=${mapping} session=${CONFIG_SESSION}
*** Keywords ***
Setup_Everything
OperatingSystem.Create_Directory ${EXPECTED_RESPONSES_FOLDER}
OperatingSystem.Create_Directory ${ACTUAL_RESPONSES_FOLDER}
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_TOPO_API} auth=${AUTH}
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
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
+ ${scritp_uri_opt}= CompareStream.Set_Variable_If_At_Most_Boron ${Empty} --uri config/bgp-rib:application-rib/${TOOLS_SYSTEM_IP}/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/
+ BuiltIn.Set_Suite_Variable ${scritp_uri_opt}
Teardown_Everything
[Documentation] Create and Log the diff between expected and actual responses, make sure Python tool was killed.
BuiltIn.Log ${diff}
KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
KillPythonTool.Search_And_Kill_Remote_Python 'bgp_app_peer\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
BuiltIn.Log ${response.text}
${actual_normalized}= Normalize_And_Save_Expected_Json ${response.text} ${filename} ${ACTUAL_RESPONSES_FOLDER}
BuiltIn.Should_Be_Equal_As_Strings ${response.status_code} 200
- BuiltIn.Should_Be_Equal ${actual_normalized} ${expected_normalized}
+ BuiltIn.Should_Be_Equal ${expected_normalized} ${actual_normalized}
Normalize_And_Save_Expected_Json
[Arguments] ${json_text} ${filename} ${directory}
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/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_TOOL_LOG_LEVEL} info
${CONTROLLER_LOG_LEVEL} INFO
${CONTROLLER_BGP_LOG_LEVEL} DEFAULT
+${CONFIG_SESSION} session
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
+${BGP_PEER_NAME} example-bgp-peer
+${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
Check_For_Empty_Topology_Before_Talking
Reconfigure_ODL_To_Accept_Connection
[Documentation] Configure BGP peer module with initiate-connection set to false.
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} 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}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ [Teardown] SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
Start_Talking_BGP_speaker
[Documentation] Start Python speaker to connect to ODL, verify that the tool does not promptly exit.
Reconfigure_ODL_To_Initiate_Connection
[Documentation] Replace BGP peer config module, now with initiate-connection set to true.
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'true'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... INITIATE=true BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=false BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
Check_Listening_Connection_Is_Established
[Documentation] See TCP (BGP) connection in established state.
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
# TODO: Do we need to check something else?
*** Keywords ***
SSHKeywords.Require_Python
SSHKeywords.Assure_Library_Ipaddr target_dir=.
SSHLibrary.Put_File ${CURDIR}/../../../../tools/fastbgp/play.py
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
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
${diff}= OperatingSystem.Run diff -dur ${EXPECTED_RESPONSES_FOLDER} ${ACTUAL_RESPONSES_FOLDER}
BuiltIn.Log ${diff}
KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
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/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
${DEFAULT_LOG_CHECK_PERIOD} 1s
${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} 10s
${DEFAULT_TOPOLOGY_CHECK_PERIOD} 1s
+${CONFIG_SESSION} session
+${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} session=${CONFIG_SESSION}
+ &{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} session=${CONFIG_SESSION}
+ &{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} session=${CONFIG_SESSION}
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} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ebgp-peer1 IP=${eBGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-ebgp-peer2 IP=${eBGP_PEER2_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ebgp_peers mapping=${mapping} session=${CONFIG_SESSION}
*** Keywords ***
Setup_Everything
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
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
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
[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
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/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_PEER_NAME} example-bgp-peer
${DEVICE_NAME} controller-config
${CONFIG_SESSION} config-session
-${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpfunctional
${SKIP_PARAMS} --skipattr
${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
*** Test Cases ***
TC1_Configure_iBGP_Peer
[Documentation] Configure BGP peer module with initiate-connection set to false.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} 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}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
TC1_Check_Example_Bgp_Rib_Is_Empty
[Documentation] Check RIB for none linkstate-routes
TC1_Deconfigure_iBGP_Peer
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
- &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME}
- TemplatedRequests.Delete_Templated ${BGP_VAR_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
TC2_Configure_iBGP_Peer
[Documentation] Configures 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} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
- ... INITIATE=false RIB_INSTANCE_NAME=${RIB_INSTANCE}
- TemplatedRequests.Put_As_Xml_Templated ${BGP_VAR_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ ... INITIATE=false RIB_INSTANCE_NAME=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
TC2_Check_Example_Bgp_Rib_Is_Empty
[Documentation] Check RIB for none linkstate-routes
TC2_Deconfigure_iBGP_Peer
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
- &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME}
- TemplatedRequests.Delete_Templated ${BGP_VAR_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
*** Keywords ***
Setup_Everything
SSHLibrary.Put_File ${CURDIR}/../../../../tools/fastbgp/play.py
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} 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
[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
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_PEER_NAME} example-bgp-peer
${DEVICE_NAME} controller-config
${CONFIG_SESSION} config-session
-${BGP_VAR_FOLDER} ${CURDIR}/../../../variables/bgpfunctional
+${RIB_INSTANCE} example-bgp-rib
*** Test Cases ***
TC1_Configure_iBGP_Peer
[Documentation] Configure BGP peer module with initiate-connection set to false.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'INITIATE': 'false'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}bgp_peer ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... INITIATE=false RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
TC1_Check_Example_Bgp_Rib_Is_Empty
[Documentation] Check RIB for none linkstate-routes
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
KarafKeywords.Log_Testcase_Start_To_Controller_Karaf
&{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${BGP_PEER_NAME}
- TemplatedRequests.Delete_Templated ${BGP_VAR_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}/bgp_peer mapping=${mapping} session=${CONFIG_SESSION}
*** Keywords ***
Setup_Everything
SSHLibrary.Put_File ${CURDIR}/../../../../tools/fastbgp/play.py
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} 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
[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
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/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_PEER_LOG_LEVEL} debug
${CONTROLLER_LOG_LEVEL} INFO
${CONTROLLER_BGP_LOG_LEVEL} DEFAULT
+${DEVICE_NAME} controller-config
${BGP_PEER1_IP} 127.0.0.1
${BGP_PEER2_IP} 127.0.0.2
${BGP_PEER1_FIRST_PREFIX_IP} 8.1.0.0
${DEFAULT_LOG_CHECK_PERIOD} 1s
${DEFAULT_TOPOLOGY_CHECK_TIMEOUT} 10s
${DEFAULT_TOPOLOGY_CHECK_PERIOD} 1s
+${CONFIG_SESSION} session
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
*** Test Cases ***
TC1_Configure_Two_iBGP_Route_Reflector_Client_Peers
[Documentation] Configure two iBGP peers as routing reflector clients.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', '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-bgp-peer2', 'IP': '${BGP_PEER2_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', '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-bgp-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-bgp-peer2'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- BuiltIn.Log ${result}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_PEER1_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=rr-client INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=true
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=rr-client INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=true
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
TC1_Connect_BGP_Peer1
[Documentation] Connect BGP peer
TC1_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-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-bgp-peer2'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
TC2_Configure_One_iBGP_Route_Reflector_Client_And_One_iBGP_Non_Client
[Documentation] Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_PEER1_IP}', 'HOLDTIME': '${HOLDTIME}', 'PEER_PORT': '${BGP_TOOL_PORT}','PEER_ROLE': 'rr-client', '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-bgp-peer2', 'IP': '${BGP_PEER2_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-bgp-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-bgp-peer2'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- BuiltIn.Log ${result}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_PEER1_IP} HOLDTIME=${HOLDTIME} PEER_PORT=${BGP_TOOL_PORT}
+ ... PEER_ROLE=rr-client INITIATE=false BGP_RIB=${RIB_INSTANCE} PASSIVE_MODE=true BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG} RIB_INSTANCE_NAME=${RIB_INSTANCE}
+ ... RR_CLIENT=true
+ TemplatedRequests.Put_As_Xml_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_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} session=${CONFIG_SESSION}
TC2_Connect_BGP_Peer1
[Documentation] Connect BGP peer
TC2_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-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-bgp-peer2'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
TC3_Configure_Two_iBGP_Non_Client_Peers
[Documentation] Configure iBGP peers: 1st one as RR client, 2nd one as RR non-client.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer1', 'IP': '${BGP_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-bgp-peer2', 'IP': '${BGP_PEER2_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-bgp-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-bgp-peer2'}
- ${result}= ConfigViaRestconf.Get_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
- BuiltIn.Log ${result}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_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} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_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} session=${CONFIG_SESSION}
TC3_Connect_BGP_Peer1
[Documentation] Connect BGP peer
TC3_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
- ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-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-bgp-peer2'}
- ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer1 IP=${BGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
+ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=example-bgp-peer2 IP=${BGP_PEER2_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping} session=${CONFIG_SESSION}
*** Keywords ***
Setup_Everything
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
+ RequestsLibrary.Create_Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
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
[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
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
+ <name>example-bgp-peer-app</name>
+ <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</bgp-peer-id>
+ <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </target-rib>
+ <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
+ <name>pingpong-broker</name>
+ </data-broker>
+ </module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-application-peer/$NAME
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
+ <name>example-bgp-peer-app</name>
+ <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</bgp-peer-id>
+ <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </target-rib>
+ <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
+ <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
+ <name>pingpong-broker</name>
+ </data-broker>
+ </module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-application-peer/$NAME
+++ /dev/null
-config:modules/module/odl-bgp-rib-impl-cfg:bgp-application-peer/$NAME
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:bgp-application-peer</type>
- <name>example-bgp-peer-app</name>
- <bgp-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</bgp-peer-id>
- <target-rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">x:rib-instance</type>
- <name>example-bgp-rib</name>
- </target-rib>
- <application-rib-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">example-app-rib</application-rib-id>
- <data-broker xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:x="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">x:dom-async-data-broker</type>
- <name>pingpong-broker</name>
- </data-broker>
- </module>
+<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <neighbor-address>$IP</neighbor-address>
+ <config>
+ <peer-group>application-peers</peer-group>
+ </config>
+</neighbor>
--- /dev/null
+restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/$BGP_RIB_OPENCONFIG/bgp/neighbors/neighbor/$IP
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$BGP_NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>$RIB_INSTANCE_NAME</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$BGP_NAME
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$BGP_NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>$RIB_INSTANCE_NAME</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$BGP_NAME
+++ /dev/null
-config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
- <name>$NAME</name>
- <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
- <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
- <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
- <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
- <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
- <name>example-bgp-rib</name>
- </rib>
- <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
- <name>global-bgp-peer-registry</name>
- </peer-registry>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv4-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv6-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>linkstate</name>
- </advertized-table>
-</module>
+<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <neighbor-address>$IP</neighbor-address>
+ <route-reflector>
+ <config>
+ <route-reflector-client>false</route-reflector-client>
+ </config>
+ </route-reflector>
+ <timers>
+ <config>
+ <hold-time>$HOLDTIME</hold-time>
+ <connect-retry>5</connect-retry>
+ </config>
+ </timers>
+ <transport>
+ <config>
+ <remote-port>$PEER_PORT</remote-port>
+ <passive-mode>$PASSIVE_MODE</passive-mode>
+ </config>
+ </transport>
+ <config>
+ <peer-type>INTERNAL</peer-type>
+ </config>
+ <afi-safis>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name>LINKSTATE</afi-safi-name>
+ </afi-safi>
+ </afi-safis>
+</neighbor>
--- /dev/null
+restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/$BGP_RIB_OPENCONFIG/bgp/neighbors/neighbor/$IP
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
+ <remote-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$AS_NUMBER</remote-as>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
+
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
+ <remote-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$AS_NUMBER</remote-as>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
+
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
+++ /dev/null
-config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
- <name>$NAME</name>
- <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
- <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
- <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
- <remote-as xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$AS_NUMBER</remote-as>
- <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
- <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
- <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
- <name>example-bgp-rib</name>
- </rib>
- <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
- <name>global-bgp-peer-registry</name>
- </peer-registry>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv4-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv6-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>linkstate</name>
- </advertized-table>
-</module>
-
+<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <neighbor-address>$IP</neighbor-address>
+ <timers>
+ <config>
+ <hold-time>$HOLDTIME</hold-time>
+ <connect-retry>5</connect-retry>
+ </config>
+ </timers>
+ <transport>
+ <config>
+ <remote-port>$PEER_PORT</remote-port>
+ <passive-mode>$PASSIVE_MODE</passive-mode>
+ </config>
+ </transport>
+ <config>
+ <peer-type>EXTERNAL</peer-type>
+ <peer-as>$AS_NUMBER</peer-as>
+ </config>
+ <afi-safis>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name>LINKSTATE</afi-safi-name>
+ </afi-safi>
+ </afi-safis>
+</neighbor>
--- /dev/null
+restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/$BGP_RIB_OPENCONFIG/bgp/neighbors/neighbor/$IP
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
--- /dev/null
+<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
+ <name>$NAME</name>
+ <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
+ <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
+ <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
+ <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
+ <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
+ <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
+ <name>example-bgp-rib</name>
+ </rib>
+ <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
+ <name>global-bgp-peer-registry</name>
+ </peer-registry>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv4-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>ipv6-unicast</name>
+ </advertized-table>
+ <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
+ <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
+ <name>linkstate</name>
+ </advertized-table>
+</module>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
+++ /dev/null
-config:modules/module/odl-bgp-rib-impl-cfg:bgp-peer/$NAME
-<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer</type>
- <name>$NAME</name>
- <host xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$IP</host>
- <port xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_PORT</port>
- <peer-role xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$PEER_ROLE</peer-role>
- <holdtimer xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$HOLDTIME</holdtimer>
- <initiate-connection xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">$INITIATE</initiate-connection>
- <rib xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:rib-instance</type>
- <name>example-bgp-rib</name>
- </rib>
- <peer-registry xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-peer-registry</type>
- <name>global-bgp-peer-registry</name>
- </peer-registry>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv4-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>ipv6-unicast</name>
- </advertized-table>
- <advertized-table xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgp:rib:impl">prefix:bgp-table-type</type>
- <name>linkstate</name>
- </advertized-table>
-</module>
+<neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <neighbor-address>$IP</neighbor-address>
+ <route-reflector>
+ <config>
+ <route-reflector-client>$RR_CLIENT</route-reflector-client>
+ </config>
+ </route-reflector>
+ <timers>
+ <config>
+ <hold-time>$HOLDTIME</hold-time>
+ <connect-retry>5</connect-retry>
+ </config>
+ </timers>
+ <transport>
+ <config>
+ <remote-port>$PEER_PORT</remote-port>
+ <passive-mode>$PASSIVE_MODE</passive-mode>
+ </config>
+ </transport>
+ <config>
+ <peer-type>INTERNAL</peer-type>
+ </config>
+ <afi-safis>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name>LINKSTATE</afi-safi-name>
+ </afi-safi>
+ </afi-safis>
+</neighbor>
--- /dev/null
+restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/$BGP_RIB_OPENCONFIG/bgp/neighbors/neighbor/$IP