... and is available at http://www.eclipse.org/legal/epl-v10.html
...
...
-... This resource assumes that RequestsLibrary has open a connection named "operational"
-... which points to (an analogue of) http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/${OPERATIONAL_API}
+... This resource creates a "default" session using TemplatedRequests.Create_Default_Session
+... which points to (an analogue of) http://${ODL_SYSTEM_IP}:${RESTCONFPORT}
Library RequestsLibrary
-Resource ${CURDIR}/ConfigViaRestconf.robot
Resource ${CURDIR}/ScalarClosures.robot
+Resource ${CURDIR}/TemplatedRequests.robot
Resource ${CURDIR}/WaitUtils.robot
*** Variables ***
*** Keywords ***
CC_Setup
[Documentation] Initialize dependency libraries.
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
WaitUtils.WU_Setup # includes ScalarClosures.SC_Setup
${counter} = ScalarClosures.Closure_From_Keyword_And_Arguments Get_Change_Count
BuiltIn.Set_Suite_Variable ${ChangeCounter__getter} ${counter}
[Arguments] ${topology_name}=example-linkstate-topology
[Documentation] Configure data change counter to count transactions affecting
... ${topology_name} instead of previously configured topology name.
- ${template_as_string}= BuiltIn.Set_Variable {'TOPOLOGY_NAME': '${topology_name}'}
- ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${CHANGE_COUNTER_TEMPLATE_FOLDER}${/}change_counter ${template_as_string}
+ &{mapping} Create Dictionary DEVICE_NAME=${DEVICE_NAME} TOPOLOGY_NAME=${topology_name}
+ TemplatedRequests.Put_As_Xml_Templated ${CHANGE_COUNTER_TEMPLATE_FOLDER}${/}change_counter mapping=${mapping}
Wait_For_Change_Count_To_Become_Stable
[Arguments] ${timeout}=60s ${period}=1s ${repetitions}=4 ${count_to_overcome}=-1
... how to use restconf application peer interface:
... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Application_Peer
... https://wiki.opendaylight.org/view/BGP_LS_PCEP:Programmer_Guide#BGP
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#application-peer-configuration
+...
+... The bgp peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
...
... Reported bugs:
... Bug 4689 - Not a reasonable duration of 1M prefix introduction from BGP application peer via restconf
Variables ${CURDIR}/../../../variables/Variables.py
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/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_VARIABLES_FOLDER} ${CURDIR}/../../../variables/bgpuser/
${BGP_APP_PEER_OPTIONS} &>bgp_app_peer.log
${TEST_DURATION_MULTIPLIER} 30
${last_prefix_count} -1
+${DEVICE_NAME} controller-config
+${BGP_PEER_NAME} example-bgp-peer
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
*** Test Cases ***
Check_For_Empty_Ipv4_Topology_Before_Starting
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_APP_PEER_PREFIX_COUNT}', '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_APP_PEER_PREFIX_COUNT} 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}
Reconfigure_ODL_To_Accept_BGP_Application_Peer
[Documentation] Configure BGP application peer module.
- ${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=example-bgp-peer-app 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}
Connect_BGP_Peer
[Documentation] Start BGP peer tool
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} NAME=${BGP_PEER_NAME} IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping}
Delete_Bgp_Application_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-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=example-bgp-peer-app IP=${TOOLS_SYSTEM_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_application_peer mapping=${mapping}
Check_Bug_4791
[Documentation] Check controller's log for errors
[Documentation] Setup imported resources, SSH-login to tools system,
... create HTTP session, put Python tool to tools system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
PrefixCounting.PC_Setup
SSHLibrary.Set_Default_Configuration prompt=${TOOLS_SYSTEM_PROMPT}
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
SSHLibrary.Switch Connection bgp_peer_console
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
... TODO: Figure out how to make it configurable.
... As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
...
+... Brief description how to configure BGP peer can be found here:
+... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... The peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
+...
... TODO: Is there a need for version of this suite where ODL connects to pers?
... Note that configuring ODL is slow, which may affect measured performance singificantly.
... Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
Variables ${CURDIR}/../../../variables/Variables.py
Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
Resource ${CURDIR}/../../../libraries/ChangeCounter.robot
-Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_TOOL_LOG_LEVEL} info
${TEST_DURATION_MULTIPLIER} 1
${TEST_DURATION_MULTIPLIER_CHANGE_COUNT} ${TEST_DURATION_MULTIPLIER}
${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_MANY} ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
# TODO: Option names can be better.
${last_change_count_many} -1
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1
\ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
\ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
- \ ${template_as_string} = BuiltIn.Set_Variable {'NAME': '${peer_name}', 'IP': '${peer_ip}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'HOLDTIME': '${HOLDTIME_CHANGE_COUNT_MANY}', '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=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_CHANGE_COUNT_MANY}
+ \ ... 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}
# FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready.
Wait_For_Data_Change_Counter_Ready
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
# TODO: Is it useful to extract peer naming logic to separate Keyword?
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_CHANGE_COUNT_MANY}+1
- \ ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer-${index}'}
- \ ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLESFOLDER}${/}bgp_peer ${template_as_string}
+ \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
+ \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
+ \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ \ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping}
*** Keywords ***
Setup_Everything
[Documentation] Setup imported resources, SSH-login to ODL system,
... create HTTP session, put Python tool to ODL system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
ChangeCounter.CC_Setup
PrefixCounting.PC_Setup
KarafKeywords.Open Controller Karaf Console On Background
[Documentation] Make sure Python tool was killed and tear down imported Resources.
# Environment issue may have dropped the SSH connection, but we do not want Teardown to fail.
BuiltIn.Run_Keyword_And_Ignore_Error KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
... ODL distinguishes peers by their IP addresses.
... Currently, this suite requires python utils to be started on ODL System,
... to guarantee IP address block is available for them to bind to.
+...
+... Brief description how to configure BGP peer can be found here:
+... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... The peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
Suite Setup Setup_Everything
Suite Teardown Teardown_Everything
Test Setup SetupUtils.Setup_Test_With_Logging_And_Fast_Failing
Library SSHLibrary timeout=10s
Variables ${CURDIR}/../../../variables/Variables.py
Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_TOOL_LOG_LEVEL} info
${REPETITIONS_PREFIX_COUNT_MANY_RRC} 10
${TEST_DURATION_MULTIPLIER} 1
${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY_RRC} ${TEST_DURATION_MULTIPLIER}
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
*** Test Cases ***
Check_For_Empty_Ipv4_Topology_Before_Talking
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1
\ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
\ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
- \ ${template_as_string} = BuiltIn.Set_Variable {'NAME': '${peer_name}', 'IP': '${peer_ip}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'HOLDTIME': '${HOLDTIME_PREFIX_COUNT_MANY_RRC}', 'PEER_ROLE': 'rr-client', 'INITIATE': 'false'}
- \ ConfigViaRestconf.Put_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLES_FOLDER}${/}ibgp_peers ${template_as_string}
+ \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY_RRC}
+ \ ... 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}
Start_Talking_BGP_Manager
[Documentation] Start Python manager to connect speakers to ODL.
[Tags] critical
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY_RRC}+1
- \ ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer-${index}'}
- \ ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLESFOLDER}${/}ibgp_peers ${template_as_string}
+ \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
+ \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
+ \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ \ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}ibgp_peers mapping=${mapping}
*** Keywords ***
Setup_Everything
[Documentation] Setup imported resources, SSH-login to ODL system,
... create HTTP session, put Python tool to ODL system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
PrefixCounting.PC_Setup
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
# TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
[Documentation] Make sure Python tool was killed and tear down imported Resources.
# Environment issue may have dropped the SSH connection, but we do not want Teardown to fail.
BuiltIn.Run_Keyword_And_Ignore_Error KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
... TODO: Figure out how to make it configurable.
... As peer IP adresses are set incrementally, we need ipaddr to be used in Robot somehow.
...
+... Brief description how to configure BGP peer can be found here:
+... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... The peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
+...
... TODO: Is there a need for version of this suite where ODL connects to pers?
... Note that configuring ODL is slow, which may affect measured performance singificantly.
... Advanced TODO: Give manager ability to start pushing on trigger long after connections are established.
Library SSHLibrary timeout=10s
Variables ${CURDIR}/../../../variables/Variables.py
Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_TOOL_LOG_LEVEL} info
${TEST_DURATION_MULTIPLIER} 1
${TEST_DURATION_MULTIPLIER_PREFIX_COUNT} ${TEST_DURATION_MULTIPLIER}
${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_MANY} ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
# TODO: Option names can be better.
*** Test Cases ***
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1
\ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
\ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
- \ ${template_as_string} = BuiltIn.Set_Variable {'NAME': '${peer_name}', 'IP': '${peer_ip}', 'PEER_PORT': '${BGP_TOOL_PORT}', 'HOLDTIME': '${HOLDTIME_PREFIX_COUNT_MANY}', '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=${peer_name} IP=${peer_ip} HOLDTIME=${HOLDTIME_PREFIX_COUNT_MANY}
+ \ ... 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}
# FIXME: Add testcase to change bgpcep and protocol log levels, when a Keyword that does it without messing with current connection is ready.
Change_Karaf_Logging_Levels
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
# TODO: Is it useful to extract peer naming logic to separate Keyword?
: FOR ${index} IN RANGE 1 ${MULTIPLICITY_PREFIX_COUNT_MANY}+1
- \ ${template_as_string}= BuiltIn.Set_Variable {'NAME': 'example-bgp-peer-${index}'}
- \ ConfigViaRestconf.Delete_Xml_Template_Folder_Config_Via_Restconf ${BGP_VARIABLESFOLDER}${/}bgp_peer ${template_as_string}
+ \ ${peer_name} = BuiltIn.Set_Variable example-bgp-peer-${index}
+ \ ${peer_ip} = BuiltIn.Evaluate str(ipaddr.IPAddress('${FIRST_PEER_IP}') + ${index} - 1) modules=ipaddr
+ \ &{mapping} BuiltIn.Create_Dictionary DEVICE_NAME=${DEVICE_NAME} BGP_NAME=${peer_name} IP=${peer_ip} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
+ \ TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping}
*** Keywords ***
Setup_Everything
[Documentation] Setup imported resources, SSH-login to ODL system,
... create HTTP session, put Python tool to ODL system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
PrefixCounting.PC_Setup
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
# TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
[Documentation] Make sure Python tool was killed and tear down imported Resources.
# Environment issue may have dropped the SSH connection, but we do not want Teardown to fail.
BuiltIn.Run_Keyword_And_Ignore_Error KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
... The time for Wait_For_Stable_* cases to finish is the main performance metric.
... After waiting for stability is done, full check on number of prefixes present is performed.
...
+... Brief description how to configure BGP peer can be found here:
+... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... The peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
+...
... TODO: Currently, if a bug causes zero increase of data changes,
... affected test cases will wait for max time. Reconsider.
... If zero increase is allowed as stable, higher number of repetitions should be required.
Variables ${CURDIR}/../../../variables/Variables.py
Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
Resource ${CURDIR}/../../../libraries/ChangeCounter.robot
-Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_TOOL_LOG_LEVEL} info
${TEST_DURATION_MULTIPLIER_CHANGE_COUNT_SINGLE} ${TEST_DURATION_MULTIPLIER_CHANGE_COUNT}
${UPDATE} single
${WITHDRAW} 0
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
+${BGP_PEER_NAME} example-bgp-peer
# TODO: Option names can be better.
${last_change_count_single} -1
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_CHANGE_COUNT_SINGLE}', '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_CHANGE_COUNT_SINGLE} 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}
Wait_For_Data_Change_Counter_Ready
[Documentation] Data change counter might have been slower to start than ipv4 topology, wait for it.
Reconfigure_ODL_To_Initiate_Connection
[Documentation] Replace BGP peer config module, now with initiate-connection set to true.
Store_Change_Count
- ${template_as_string} = BuiltIn.Set_Variable {'NAME': 'example-bgp-peer', 'IP': '${TOOLS_SYSTEM_IP}', 'HOLDTIME': '${HOLDTIME_CHANGE_COUNT_SINGLE}', '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_CHANGE_COUNT_SINGLE} 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}
Wait_For_Stable_Listening_Ipv4_Topology
[Documentation] Wait until example-ipv4-topology becomes stable.
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- ${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}
*** Keywords ***
Setup_Everything
[Documentation] Setup imported resources, SSH-login to tools system,
... create HTTP session, put Python tool to tools system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
ChangeCounter.CC_Setup
PrefixCounting.PC_Setup
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
[Documentation] Make sure Python tool was killed and tear down imported Resources.
# Environment issue may have dropped the SSH connection, but we do not want Teardown to fail.
BuiltIn.Run_Keyword_And_Ignore_Error KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
... The time for Wait_For_Stable_* cases to finish is the main performance metric.
... After waiting for stability is done, full check on number of prefixes present is performed.
...
+... Brief description how to configure BGP peer can be found here:
+... https://wiki.opendaylight.org/view/BGP_LS_PCEP:User_Guide#BGP_Peer
+... http://docs.opendaylight.org/en/stable-boron/user-guide/bgp-user-guide.html#bgp-peering
+... The peer configuration depends on the ${ODL_STREAM}. For "boron" and older streams it uses netconf connector and
+... for carbon and further it configures peer via openconfig.
+...
... TODO: Currently, if a bug causes prefix count to remain at zero,
... affected test cases will wait for max time. Reconsider.
... If zero is allowed as stable, higher period or repetitions would be required.
Library RequestsLibrary
Variables ${CURDIR}/../../../variables/Variables.py
Resource ${CURDIR}/../../../libraries/BGPSpeaker.robot
-Resource ${CURDIR}/../../../libraries/ConfigViaRestconf.robot
Resource ${CURDIR}/../../../libraries/FailFast.robot
Resource ${CURDIR}/../../../libraries/KillPythonTool.robot
Resource ${CURDIR}/../../../libraries/PrefixCounting.robot
Resource ${CURDIR}/../../../libraries/SetupUtils.robot
Resource ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource ${CURDIR}/../../../libraries/TemplatedRequests.robot
*** Variables ***
${BGP_TOOL_LOG_LEVEL} info
${TEST_DURATION_MULTIPLIER_PREFIX_COUNT_SINGLE} ${TEST_DURATION_MULTIPLIER_PREFIX_COUNT}
${UPDATE} single
${WITHDRAW} 0
+${RIB_INSTANCE} example-bgp-rib
+${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
+${DEVICE_NAME} controller-config
+${BGP_PEER_NAME} example-bgp-peer
# TODO: Option names can be better.
*** Test Cases ***
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_PREFIX_COUNT_SINGLE}', '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_PREFIX_COUNT_SINGLE} 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}
Change_Karaf_Logging_Levels
[Documentation] We may want to set more verbose logging here after configuration is done.
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_PREFIX_COUNT_SINGLE}', '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_PREFIX_COUNT_SINGLE} 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}
Wait_For_Stable_Listening_Ipv4_Topology
[Documentation] Wait until example-ipv4-topology becomes stable.
Delete_Bgp_Peer_Configuration
[Documentation] Revert the BGP configuration to the original state: without any configured peers.
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- ${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}
*** Keywords ***
Setup_Everything
[Documentation] Setup imported resources, SSH-login to tools system,
... create HTTP session, put Python tool to tools system.
SetupUtils.Setup_Utils_For_Setup_And_Teardown
- ConfigViaRestconf.Setup_Config_Via_Restconf
+ TemplatedRequests.Create_Default_Session
PrefixCounting.PC_Setup
RequestsLibrary.Create_Session operational http://${ODL_SYSTEM_IP}:${RESTCONFPORT}${OPERATIONAL_API} auth=${AUTH}
# TODO: Do not include slash in ${OPERATIONAL_TOPO_API}, having it typed here is more readable.
[Documentation] Make sure Python tool was killed and tear down imported Resources.
# Environment issue may have dropped the SSH connection, but we do not want Teardown to fail.
BuiltIn.Run_Keyword_And_Ignore_Error KillPythonTool.Search_And_Kill_Remote_Python 'play\.py'
- ConfigViaRestconf.Teardown_Config_Via_Restconf
RequestsLibrary.Delete_All_Sessions
SSHLibrary.Close_All_Connections
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter-singleton
<module xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
<type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">prefix:data-change-counter-impl</type>
- <name>data-change-counter-singleton</name>
+ <name>data-change-counter</name>
+ <counter-id xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">data-change-counter</counter-id>
<data-provider xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgpcep:data:change:counter">
<type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
<name>pingpong-binding-data-broker</name>
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter
+++ /dev/null
-config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter-singleton
+++ /dev/null
-config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter
+++ /dev/null
-config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter-singleton
--- /dev/null
+restconf/config/network-topology:network-topology/topology/topology-netconf/node/$DEVICE_NAME/yang-ext:mount/config:modules/module/odl-data-change-counter-cfg:data-change-counter-impl/data-change-counter