*** Variables ***
&{Stream_dict}
-... oxygen=${8}
... fluorine=${9}
... neon=${10}
... sodium=${11}
... ${value_if_true}
... ${value_if_false}
-Set_Variable_If_At_Least_Fluorine
- [Documentation] Compare fluorine to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least fluorine,
- ... return ${value_if_false} otherwise.
- [Arguments] ${value_if_true} ${value_if_false}
- BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least fluorine ${value_if_true} ${value_if_false}
-
Set_Variable_If_At_Least_Neon
[Documentation] Compare neon to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at least neon,
... return ${value_if_false} otherwise.
[Arguments] ${value_if_true} ${value_if_false}
BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Least chlorine ${value_if_true} ${value_if_false}
-Set_Variable_If_At_Most_Oxygen
- [Documentation] Compare oxygen to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most oxygen,
- ... return ${value_if_false} otherwise.
- [Arguments] ${value_if_true} ${value_if_false}
- BuiltIn.Run_Keyword_And_Return Set_Variable_If_At_Most oxygen ${value_if_true} ${value_if_false}
-
Set_Variable_If_At_Most_Fluorine
[Documentation] Compare fluorine to ${ODL_STREAM} and return ${value_if_true} if ${ODL_STREAM} is at most fluorine,
... return ${value_if_false} otherwise.
... @{varargs}
... &{kwargs}
-Run_Keyword_If_At_Least_Fluorine
- [Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is at least fluorine,
- ... run ${kw_name} @{varargs} &{kwargs} and return its value.
- [Arguments] ${kw_name} @{varargs} &{kwargs}
- BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least fluorine ${kw_name} @{varargs} &{kwargs}
-
Run_Keyword_If_At_Least_Neon
[Documentation] Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is at least neon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
[Arguments] ${kw_name} @{varargs} &{kwargs}
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Least chlorine ${kw_name} @{varargs} &{kwargs}
-Run_Keyword_If_At_Most_Oxygen
- [Documentation] Compare oxygen to ${ODL_STREAM} and in case ${ODL_STREAM} is at most oxygen,
- ... run ${kw_name} @{varargs} &{kwargs} and return its value.
- [Arguments] ${kw_name} @{varargs} &{kwargs}
- BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most oxygen ${kw_name} @{varargs} &{kwargs}
-
Run_Keyword_If_At_Most_Fluorine
[Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is at most fluroine,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
[Arguments] ${kw_name} @{varargs} &{kwargs}
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_At_Most chlorine ${kw_name} @{varargs} &{kwargs}
-Run_Keyword_If_More_Than_Oxygen
- [Documentation] Compare oxygen to ${ODL_STREAM} and in case ${ODL_STREAM} is more than oxygen,
- ... run ${kw_name} @{varargs} &{kwargs} and return its value.
- [Arguments] ${kw_name} @{varargs} &{kwargs}
- BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than oxygen ${kw_name} @{varargs} &{kwargs}
-
Run_Keyword_If_More_Than_Fluorine
[Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is more than fluorine,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
[Arguments] ${kw_name} @{varargs} &{kwargs}
BuiltIn.Run_Keyword_And_Return Run_Keyword_If_More_Than chlorine ${kw_name} @{varargs} &{kwargs}
-Run_Keyword_If_Less_Than_Fluorine
- [Documentation] Compare fluorine to ${ODL_STREAM} and in case ${ODL_STREAM} is less than fluorine,
- ... run ${kw_name} @{varargs} &{kwargs} and return its value.
- [Arguments] ${kw_name} @{varargs} &{kwargs}
- BuiltIn.Run_Keyword_And_Return Run_Keyword_If_Less_Than fluorine ${kw_name} @{varargs} &{kwargs}
-
Run_Keyword_If_Less_Than_Neon
[Documentation] Compare neon to ${ODL_STREAM} and in case ${ODL_STREAM} is less than neon,
... run ${kw_name} @{varargs} &{kwargs} and return its value.
Check Classifier Flows
${flowList} = DockerSfc.Get Flows In Docker Containers
BuiltIn.log ${flowList}
- ${expected_nsh_pop} = Set_Variable_If_At_Most oxygen *actions=pop_nsh* *actions=decap(),decap(),*
- ${expected_nsh_push} = Set_Variable_If_At_Most oxygen *actions=push_nsh* *actions=encap(nsh*
+ ${expected_nsh_pop} = BuiltIn.Set_Variable *actions=decap(),decap(),*
+ ${expected_nsh_push} = BuiltIn.Set_Variable *actions=encap(nsh*
Collections.Should Contain Match ${flowList} ${expected_nsh_pop}
Collections.Should Contain Match ${flowList} ${expected_nsh_push}
return data
-def add_domain_xml_oxygen(node_id, name, sgt, prefixes):
- """Generate xml for Add Domain request (Oxygen version: bindings without origin)
-
- :param node_id: Id of node
- :type node_id: str
- :param name: Name of Domain
- :type name: str
- :param sgt: Security group
- :type sgt: int
- :param prefixes: List of ip-prefixes
- :type prefixes: str
- :returns: String containing xml data for request
-
- """
- master_database = ""
- if prefixes != "None":
- xml_prefixes = ""
- for prefix in prefixes.split(","):
- xml_prefixes += "\n" + "<ip-prefix>" + prefix + "</ip-prefix>"
- if xml_prefixes:
- master_database += """<master-database>
- <binding>
- <sgt>$sgt</sgt>
- $xml_prefixes
- </binding>
- </master-database>"""
- master_database = Template(master_database).substitute(
- ({"sgt": sgt, "xml_prefixes": xml_prefixes})
- )
-
- templ = Template(
- """<input xmlns="urn:opendaylight:sxp:controller">
- <node-id>$id</node-id>
- <domain-name>$name</domain-name>
- $master_database
-</input>"""
- )
-
- data = templ.substitute(
- {"name": name, "id": node_id, "master_database": master_database}
- )
- return data
-
-
def delete_domain_xml(node_id, name):
"""Generate xml for Remove Domain request
return data
-def add_bindings_xml_oxygen(node_id, domain, sgt, prefixes):
- """Generate xml for Add Bindings request (Oxygen version without origin type)
-
- :param node_id: Id of node
- :type node_id: str
- :param domain: Name of Domain
- :type domain: str
- :param sgt: Security group
- :type sgt: int
- :param prefixes: List of ip-prefixes
- :type prefixes: str
- :returns: String containing xml data for request
-
- """
- xml_prefixes = ""
- for prefix in prefixes.split(","):
- xml_prefixes += "\n" + "<ip-prefix>" + prefix + "</ip-prefix>"
- templ = Template(
- """<input xmlns="urn:opendaylight:sxp:controller">
- <node-id>$id</node-id>
- <domain-name>$name</domain-name>
- <binding>
- <sgt>$sgt</sgt>
- $xml_prefixes
- </binding>
-</input>"""
- )
- data = templ.substitute(
- {"name": domain, "id": node_id, "sgt": sgt, "xml_prefixes": xml_prefixes}
- )
- return data
-
-
def delete_bindings_xml(node_id, domain, sgt, prefixes):
"""Generate xml for Remove Bindings request
Library Collections
Library RequestsLibrary
Library ./Sxp.py
-Resource CompareStream.robot
Resource KarafKeywords.robot
Resource TemplatedRequests.robot
Resource Utils.robot
Add Bindings
[Documentation] Based on ODL version decide if bindings will be added with or without origin type (introduced in Fluorine)
[Arguments] ${sgt} ${prefixes} ${node}=127.0.0.1 ${session}=session ${domain}=global ${origin}=LOCAL
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... Add Bindings Fluorine
+ Add Bindings Fluorine
... ${sgt}
... ${prefixes}
... ${node}
... ${session}
... ${domain}
... ${origin}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... Add Bindings Oxygen
- ... ${sgt}
- ... ${prefixes}
- ... ${node}
- ... ${session}
- ... ${domain}
Add Bindings Fluorine
[Documentation] Add/Update one or more bindings with origin type via RPC to Master DB of the node
${data} = Sxp.Add Bindings Xml Fluorine ${node} ${domain} ${sgt} ${prefixes} ${origin}
Post To Controller ${session} add-bindings ${data}
-Add Bindings Oxygen
- [Documentation] Add/Update one or more bindings without origin type via RPC to Master DB of the node
- [Arguments] ${sgt} ${prefixes} ${node} ${session} ${domain}
- ${data} = Sxp.Add Bindings Xml Oxygen ${node} ${domain} ${sgt} ${prefixes}
- Post To Controller ${session} add-bindings ${data}
-
Get Bindings
[Documentation] Gets all binding via RPC from Master DB of node
[Arguments] ${node}=127.0.0.1 ${session}=session ${domain}=global ${scope}=all
Add Domain
[Documentation] Based on ODL version decide if domain's bindings will be added with or without origin type (introduced in Fluorine)
[Arguments] ${domain_name} ${sgt}=None ${prefixes}=None ${origin}=LOCAL ${node}=127.0.0.1 ${session}=session
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... Add Domain Fluorine
+ Add Domain Fluorine
... ${domain_name}
... ${sgt}
... ${prefixes}
... ${origin}
... ${node}
... ${session}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... Add Domain Oxygen
- ... ${domain_name}
- ... ${sgt}
- ... ${prefixes}
- ... ${node}
- ... ${session}
Add Domain Fluorine
[Documentation] Add Domain with bindings (with origin) via RPC
${data} = Sxp.Add Domain Xml Fluorine ${node} ${domain_name} ${sgt} ${prefixes} ${origin}
Post To Controller ${session} add-domain ${data}
-Add Domain Oxygen
- [Documentation] Add Domain with bindings (without origin) via RPC
- [Arguments] ${domain_name} ${sgt} ${prefixes} ${node} ${session}
- ${data} = Sxp.Add Domain Xml Oxygen ${node} ${domain_name} ${sgt} ${prefixes}
- Post To Controller ${session} add-domain ${data}
-
Delete Domain
[Documentation] Delete Domain via RPC
[Arguments] ${domain_name} ${node}=127.0.0.1 ${session}=session
Documentation Openstack library. This library is useful for tests to create network, subnet, router and vm instances
Library SSHLibrary
-Resource CompareStream.robot
Resource Utils.robot
Resource TemplatedRequests.robot
Resource KarafKeywords.robot
Associate VPN to Router
[Documentation] Associate the created L3VPN to a router-id received as argument
[Arguments] &{Kwargs}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... TemplatedRequests.Post_As_Json_Templated
+ TemplatedRequests.Post_As_Json_Templated
... folder=${VAR_BASE}/assoc_two_router_l3vpn
... mapping=${Kwargs}
... session=default
... http_timeout=${SESSION_TIMEOUT}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... TemplatedRequests.Post_As_Json_Templated
- ... folder=${VAR_BASE}/assoc_router_l3vpn
- ... mapping=${Kwargs}
- ... session=default
- ... http_timeout=${SESSION_TIMEOUT}
Dissociate VPN to Router
[Documentation] Dissociate the already associated routers from L3VPN
[Arguments] &{Kwargs}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... TemplatedRequests.Post_As_Json_Templated
+ TemplatedRequests.Post_As_Json_Templated
... folder=${VAR_BASE}/dissoc_two_router_l3vpn
... mapping=${Kwargs}
... session=default
... http_timeout=${SESSION_TIMEOUT}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... TemplatedRequests.Post_As_Json_Templated
- ... folder=${VAR_BASE}/dissoc_router_l3vpn
- ... mapping=${Kwargs}
- ... session=default
- ... http_timeout=${SESSION_TIMEOUT}
VPN Delete L3VPN
[Documentation] Delete the created L3VPN
Should Contain ${group_output} group_id=${Group-ID}
${arp_group} = Get Lines Containing String ${group_output} group_id=${Group-ID}
Log ${arp_group}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... BuiltIn.Should Match Regexp
- ... ${arp_group}
- ... ${ARP_REQUEST_GROUP_REGEX}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... BuiltIn.Should Match Regexp
+ BuiltIn.Should Match Regexp
... ${arp_group}
... ${ARP_REQUEST_GROUP_REGEX_FLUORINE}
#Verify ARP_CHECK_TABLE - 43
#arp request and response
${arpchk_table} = Get Lines Containing String ${flow_output} table=${ARP_CHECK_TABLE}
- CompareStream.Run_Keyword_If_At_Most_Oxygen
- ... BuiltIn.Should Match Regexp
- ... ${arpchk_table}
- ... ${ARP_RESPONSE_REGEX}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... BuiltIn.Should Match Regexp
+ BuiltIn.Should Match Regexp
... ${arpchk_table}
... ${ARP_RESPONSE_REGEX_FLUORINE}
${arppunt_table} = String.Get Lines Containing String ${flow_output} table=${ARP_PUNT_TABLE}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... BuiltIn.Should Match Regexp
+ BuiltIn.Should Match Regexp
... ${arppunt_table}
... ${ARP_PUNT_RESPONSE_REGEX}
${match} = Should Match Regexp ${arpchk_table} ${ARP_REQUEST_REGEX}
${L3VPN_EXP} exa_expected
${L3VPN_RSP} bgp_l3vpn_ipv4
${L3VPN_RSPEMPTY} bgp_l3vpn_ipv4_empty
-${L3VPN_RSP_PATH} bgp_l3vpn_ipv4_path
${OLD_AS_PATH} \n"as-path": {},
${NEW_AS_PATH} ${EMPTY}
${PLAY_SCRIPT} ${CURDIR}/../../../../tools/fastbgp/play.py
... INITIATE=false
... BGP_RIB_OPENCONFIG=${RIB_INSTANCE}
... PASSIVE_MODE=true
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... TemplatedRequests.Put_As_Xml_Templated
+ TemplatedRequests.Put_As_Xml_Templated
... ${RT_CONSTRAIN_DIR}/bgp_peer
... mapping=${mapping}
... session=${CONFIG_SESSION}
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... TemplatedRequests.Put_As_Xml_Templated
- ... ${BGP_VAR_FOLDER}/bgp_peer
- ... mapping=${mapping}
- ... session=${CONFIG_SESSION}
L3vpn_Ipv4_To_Odl
[Documentation] Testing mpls vpn ipv4 routes reported to odl from exabgp
[Setup] Setup_Testcase ${L3VPN_EXA_CFG}
- ${L3VPN_RESPONSE} CompareStream.Set_Variable_If_At_Least_Fluorine ${L3VPN_RSP_PATH} ${L3VPN_RSP}
- BuiltIn.Wait_Until_Keyword_Succeeds 15s 1s Verify_Reported_Data ${L3VPN_RESPONSE}
+ BuiltIn.Wait_Until_Keyword_Succeeds 15s 1s Verify_Reported_Data ${L3VPN_RSP}
[Teardown] Teardown_Simple
Start_Play
[Documentation] Start Python speaker to connect to ODL. We need to do WUKS until odl really starts to accept incomming bgp connection. The failure happens if the incomming connection comes too quickly after configuring the peer in the previous test case.
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution "Only run on Fluorine and later"
SSHLibrary.Put_File ${PLAY_SCRIPT} .
SSHKeywords.Assure_Library_Ipaddr target_dir=.
SSHLibrary.Read
Play_To_Odl_rt_constrain_type_0
[Documentation] This keyword sends route-target route containg route-target argument so odl
... can identify this peer as appropriate for advertizement when it recieves such route.
- CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution "Only run on Fluorine and later"
BgpOperations.Play_To_Odl_Non_Removal_Template rt_constrain_type_0 ${RT_CONSTRAIN_DIR}
-Odl_To_Play_l3vpn
- [Documentation] Send l3vpn route to app peer, and than checks that app peer advertizes this route.
- CompareStream.Run_Keyword_If_At_Least_Fluorine BuiltIn.Pass_Execution "Only run on less than Fluorine"
- Setup_Testcase ${DEFAULT_EXA_CFG}
- L3vpn_Ipv4_To_App
- [Teardown] CompareStream.Run_Keyword_If_Less_Than_Fluorine Teardowm_With_Remove_Route
-
Odl_To_Play_l3vpn_rt_arg
[Documentation] Same as TC before but fluorine and further this l3vpn route also needs to contain route-target argument.
- CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution "Only run on Fluorine and later"
BgpOperations.Odl_To_Play_Template l3vpn_rt_arg ${RT_CONSTRAIN_DIR} False
Kill_Talking_BGP_Speaker
[Documentation] Abort the Python speaker
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- CompareStream.Run_Keyword_If_Less_Than_Fluorine BuiltIn.Pass_Execution "Only run on Fluorine and later"
BGPSpeaker.Kill_BGP_Speaker
BGPcliKeywords.Store_File_To_Workspace play.py.out 010_l3vpn_play.log
... ${TOOLS_SYSTEM_IP}
... connection_retries=${3}
-Teardowm_With_Remove_Route
- [Documentation] Removes configured route from application peer and stops the exabgp
- &{mapping} BuiltIn.Create_Dictionary APP_PEER_IP=${ODL_SYSTEM_IP}
- TemplatedRequests.Delete_Templated ${BGP_L3VPN_DIR}/route mapping=${mapping} session=${CONFIG_SESSION}
- Teardown_Simple
-
Teardown_Simple
[Documentation] Testcse teardown with data verification
ExaBgpLib.Stop_ExaBgp
... PASSIVE_MODE=true
... MULTIPATH=${npaths}
... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... TemplatedRequests.Put_As_Xml_Templated
- ... ${MULT_VAR_FOLDER}/rib
- ... mapping=${mapping}
- ... session=${CONFIG_SESSION}
- CompareStream.Run_Keyword_If_At_Least_Fluorine
- ... TemplatedRequests.Put_As_Xml_Templated
+ TemplatedRequests.Put_As_Xml_Templated
... ${MULT_VAR_FOLDER}/rib_policies
... mapping=${mapping}
... session=${CONFIG_SESSION}
${EVPN_DIR} ${CURDIR}/../../../variables/bgpfunctional/l2vpn_evpn
${BGP_TOOL_LOG_LEVEL} debug
${PLAY_SCRIPT} ${CURDIR}/../../../../tools/fastbgp/play.py
-${SS} ${SPACE}${SPACE}${SPACE}${SPACE}
-${PATH_ID_JSON} ${SS}${SS}"path-id": 0,${\n}
-${PATH_ID_XML} ${SS}<path-id>0</path-id>${\n}
${OLD_EVPN_ROUTES_LINE} \n"odl-bgp-evpn:evpn-routes": {},
${NEW_EVPN_ROUTES_LINE} ${EMPTY}
${OLD_AS_PATH} ,\n"as-path": {}
route_mac_rou
Odl_To_Play_pmsi_rsvp_te_p2mp_lsp
[Template] None
- CompareStream.Run_Keyword_If_At_Least_Fluorine Odl_To_Play_Template pmsi_rsvp_te_p2mp_lsp
+ Odl_To_Play_Template pmsi_rsvp_te_p2mp_lsp
Play_To_Odl_pmsi_rsvp_te_p2mp_lsp
[Template] None
- CompareStream.Run_Keyword_If_At_Least_Fluorine Play_To_Odl_Template pmsi_rsvp_te_p2mp_lsp
+ Play_To_Odl_Template pmsi_rsvp_te_p2mp_lsp
Odl_To_Play_pmsi_mldp_p2mp_lsp
pmsi_mldp_p2mp_lsp
Play_To_Odl_pmsi_mldp_p2mp_lsp
${announce_hex} = String.Remove_String ${announce_hex} \n
${withdraw_hex} = OperatingSystem.Get_File ${EVPN_DIR}/${totest}/withdraw_${totest}.hex
${withdraw_hex} = String.Remove_String ${withdraw_hex} \n
- ${data_path_xml} = CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... String.Replace_String
- ... ${data_xml}
- ... ${PATH_ID_XML}
- ... ${EMPTY}
- ${post_data_xml} = CompareStream.Set_Variable_If_At_Least_Fluorine ${data_xml} ${data_path_xml}
- BuiltIn.Log ${post_data_xml}
+ BuiltIn.Log ${data_xml}
BuiltIn.Log ${data_json}
BuiltIn.Log ${announce_hex}
BuiltIn.Log ${withdraw_hex}
${resp} = RequestsLibrary.Post_Request
... ${CONFIG_SESSION}
... ${EVPN_CONF_URL}
- ... data=${post_data_xml}
+ ... data=${data_xml}
... headers=${HEADERS_XML}
BuiltIn.Log ${resp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 201
... ${mapping}
${announce_hex} = OperatingSystem.Get_File ${EVPN_DIR}/${totest}/announce_${totest}.hex
${withdraw_hex} = OperatingSystem.Get_File ${EVPN_DIR}/${totest}/withdraw_${totest}.hex
- ${data_path_json} = CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... String.Replace_String
- ... ${data_json}
- ... ${PATH_ID_JSON}
- ... ${EMPTY}
- ${data_json_exp} = CompareStream.Set_Variable_If_At_Least_Fluorine ${data_json} ${data_path_json}
BuiltIn.Log ${data_xml}
- BuiltIn.Log ${data_json_exp}
+ BuiltIn.Log ${data_json}
BuiltIn.Log ${announce_hex}
BuiltIn.Log ${withdraw_hex}
BgpRpcClient.play_clean
BgpRpcClient.play_send ${announce_hex}
- BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Loc_Rib_Presence ${data_json_exp}
+ BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Loc_Rib_Presence ${data_json}
BgpRpcClient.play_send ${withdraw_hex}
BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Verify_Test_Preconditions
[Teardown] Withdraw_Route_And_Verify ${withdraw_hex}
Resource ../../../libraries/BGPcliKeywords.robot
Resource ../../../libraries/BgpOperations.robot
Resource ../../../libraries/BGPSpeaker.robot
-Resource ../../../libraries/CompareStream.robot
Resource ../../../libraries/FailFast.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/SSHKeywords.robot
TC_LAS_Reconfigure_Odl_To_Accept_Connection
[Documentation] Configure neighbors. One ibgp and one ebgp neighbor with local-as configured.
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
&{mapping} Create Dictionary
... IP=${iBGP_PEER1_IP}
... HOLDTIME=${HOLDTIME}
TC_LAS_Start_iBgp_Speaker_And_Verify_Connected
[Documentation] Verify that peer is present in odl's rib. Peer is configured with local-as.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
SSHLibrary.Switch Connection ibgp_peer1_console
${speaker_args} BuiltIn.Set_Variable
... --firstprefix ${iBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --myip=${iBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
TC_LAS_Start_eBgp_Speaker_And_Verify_Connected
[Documentation] Verify that peer is present in odl's rib. Peer is configured with local-as.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
SSHLibrary.Switch Connection ebgp_peer1_console
${speaker_args} BuiltIn.Set_Variable
... --firstprefix ${eBGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${PREFIX_LEN} --amount 1 --asnumber=${eBGP_AS} --myip=${eBGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --debug
TC_LAS_Verify_iBGP_Rib_Out
[Documentation] Verifies iBGP's adj-rib-out output. Expects local-as, and ebgp peer-as presence.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
&{mapping} Create Dictionary
... IP=${iBGP_PEER1_IP}
... HOLDTIME=${HOLDTIME}
TC_LAS_Verify_eBGP_Rib_Out
[Documentation] Verifies eBGP's adj-rib-out output. Expects local-as, and ibgp peer-as presence.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
&{mapping} Create Dictionary
... IP=${eBGP_PEER1_IP}
... HOLDTIME=${HOLDTIME}
[Documentation] Abort the Python speaker. Also, attempt to stop failing fast.
[Tags] critical
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
SSHLibrary.Switch Connection ibgp_peer1_console
BGPSpeaker.Kill_BGP_Speaker
FailFast.Do_Not_Fail_Fast_From_Now_On
[Documentation] Abort the Python speaker. Also, attempt to stop failing fast.
[Tags] critical
[Setup] SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
SSHLibrary.Switch Connection ebgp_peer1_console
BGPSpeaker.Kill_BGP_Speaker
FailFast.Do_Not_Fail_Fast_From_Now_On
TC_LAS_Delete_Bgp_Peer_Configurations
[Documentation] Delete peer configuration.
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid only for versions fluorine and above.
&{mapping} Create Dictionary IP=${iBGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
TemplatedRequests.Delete_Templated ${BGP_VARIABLES_FOLDER}${/}bgp_peer mapping=${mapping}
&{mapping} Create Dictionary IP=${eBGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
Library DateTime
Resource ../../../libraries/BGPcliKeywords.robot
Resource ../../../libraries/BgpOperations.robot
-Resource ../../../libraries/CompareStream.robot
Resource ../../../libraries/KarafKeywords.robot
Resource ../../../libraries/SetupUtils.robot
Resource ../../../libraries/SSHKeywords.robot
${SKIP_PARAMS} --skipattr
${RIB_INSTANCE} example-bgp-rib
${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
-${OLD_ROUTE_KEY} [0, 5, 0, 21, 7, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 0, 1, 0, 1, 5, 6, 7, 8]
-${NEW_ROUTE_KEY} AAUAFQcAAAAAAAAAAQECAwQAAQABBQYHCA==
+${ROUTE_KEY} AAUAFQcAAAAAAAAAAQECAwQAAQABBQYHCA==
*** Test Cases ***
TC2_Check_Example_Bgp_Rib
[Documentation] Check RIB for linkstate-route(s) and check all of their attributes.
[Tags] critical
- ${route_key} CompareStream.Set_Variable_If_At_Least_Fluorine ${NEW_ROUTE_KEY} ${OLD_ROUTE_KEY}
- &{mapping} BuiltIn.Create_Dictionary IP=${TOOLS_SYSTEM_IP} ROUTE_KEY=${route_key}
+ &{mapping} BuiltIn.Create_Dictionary IP=${TOOLS_SYSTEM_IP} ROUTE_KEY=${ROUTE_KEY}
BuiltIn.Wait_Until_Keyword_Succeeds
... ${DEFAULT_RIB_CHECK_TIMEOUT}
... ${DEFAULT_RIB_CHECK_PERIOD}
TC4_Configure_Two_iBGP_RR_Clients_With_Cluster_Id
[Documentation] Configure two iBGP peers as routing reflector clients with cluster-id argument.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary
... IP=${BGP_PEER1_IP}
... HOLDTIME=${HOLDTIME}
TC4_Connect_BGP_Peers
[Documentation] Connect BGP peers, each set to send 3 prefixes.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
SSHLibrary.Switch Connection bgp_peer1_console
BuiltIn.Set_Suite_Variable ${peer1_cluster_id} 127.0.0.4
BuiltIn.Set_Suite_Variable ${default_cluster_id} 192.0.2.2
... on first peer which should contain default-cluster id from global config reflected
... from the second peer equal to router-id.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary
... IP=${BGP_PEER1_IP}
... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
[Documentation] Check incomming updates for new routes and respective cluster-ids
... in second peer which has local route-reflector-cluster-id
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary
... IP=${BGP_PEER2_IP}
... BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
TC4_Disconnect_BGP_Peers
[Documentation] Stop BGP peer & store logs
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
SSHLibrary.Switch Connection bgp_peer1_console
BGPCliKeywords.Stop_Console_Tool
BGPCliKeywords.Store_File_To_Workspace ${BGP_PEER1_LOG_FILE} tc4_${BGP_PEER1_LOG_FILE}
TC4_Check_for_Empty_IPv4_Topology
[Documentation] Checks for empty topology after
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
BuiltIn.Wait_Until_Keyword_Succeeds
... ${DEFAULT_TOPOLOGY_CHECK_TIMEOUT}
... ${DEFAULT_TOPOLOGY_CHECK_PERIOD}
TC4_Delete_BGP_Peers_Configuration
[Documentation] Delete all previously configured BGP peers.
[Tags] critical
- CompareStream.Run_Keyword_If_Less_Than_Fluorine
- ... BuiltIn.Pass_Execution
- ... Test case valid for version fluorine and above.
&{mapping} BuiltIn.Create_Dictionary IP=${BGP_PEER1_IP} BGP_RIB_OPENCONFIG=${PROTOCOL_OPENCONFIG}
TemplatedRequests.Delete_Templated
... ${BGP_VARIABLES_FOLDER}${/}cluster_id/ibgp_peer
OpenStackOperations.Update Port p1in additional_args=--disable-port-security
OpenStackOperations.Update Port p1out additional_args=--no-security-group
OpenStackOperations.Update Port p1out additional_args=--disable-port-security
- CompareStream.Run_Keyword_If_Equals
- ... oxygen
- ... OpenStackOperations.Update Port
- ... source_vm_port
- ... additional_args=--no-security-group
- CompareStream.Run_Keyword_If_Equals
- ... oxygen
- ... OpenStackOperations.Update Port
- ... source_vm_port
- ... additional_args=--disable-port-security
- CompareStream.Run_Keyword_If_Equals
- ... oxygen
- ... OpenStackOperations.Update Port
- ... dest_vm_port
- ... additional_args=--no-security-group
- CompareStream.Run_Keyword_If_Equals
- ... oxygen
- ... OpenStackOperations.Update Port
- ... dest_vm_port
- ... additional_args=--disable-port-security
OpenStackOperations.Get Suite Debugs
Create Instances For Testing
Documentation SXP holds active SXP nodes only on the cluster owner node. Active SXP node holds its master database and datastore access. This implies that all RPC operation logic must be executed only on cluster owner node. In case RPC is send to another cluster node it must be redirected to owner to be properly executed. This suite contains tests for SxpControllerService and SxpConfigControllerService RPCs.
Library ../../../libraries/Common.py
-Resource ../../../libraries/CompareStream.robot
Resource ../../../libraries/SxpBindingOriginsLib.robot
Resource ../../../libraries/SxpClusterLib.robot
Resource ../../../libraries/SxpLib.robot
Test Add/Update/Delete Binding Origin
[Documentation] Binding origin operations need to be executed on cluster owner because they rely on static map which is present solely on cluster owner. To test that binding origin RPCs are redirected to cluster owner first add binding origin to the first node then update it on the second node (requires up-to date binding origin map) and update it on the third node (requires up-to date binding origin map).
[Tags] sxp clustering redirecting
- CompareStream.Run_Keyword_If_Less_Than
- ... fluorine
- ... BuiltIn.Pass Execution
- ... Binding origins are not supported before Fluorine
SxpBindingOriginsLib.Add Binding Origin CLUSTER 0 session=ClusterManagement__session_1
SxpBindingOriginsLib.Update Binding Origin CLUSTER 3 session=ClusterManagement__session_2
SxpBindingOriginsLib.Delete Binding Origin CLUSTER session=ClusterManagement__session_3
"bgp-vpn-ipv4:vpn-ipv4-routes": {
"vpn-route": [
{
- "attributes": {
- "as-path": {},
+ "attributes": {$AS_PATH
"ipv4-next-hop": {
"global": "10.0.255.254"
},
"label-value": 24005
}
],
+ "path-id": 0,
"prefix": "1.1.1.0/24",
"route-distinguisher": "1.2.3.4:1",
"route-key": "WAABAQIDBAABAQEB"
+++ /dev/null
-{
- "bgp-vpn-ipv4:vpn-ipv4-routes": {
- "vpn-route": [
- {
- "attributes": {$AS_PATH
- "ipv4-next-hop": {
- "global": "10.0.255.254"
- },
- "local-pref": {
- "pref": 100
- },
- "origin": {
- "value": "igp"
- }
- },
- "label-stack": [
- {
- "label-value": 24005
- }
- ],
- "path-id": 0,
- "prefix": "1.1.1.0/24",
- "route-distinguisher": "1.2.3.4:1",
- "route-key": "WAABAQIDBAABAQEB"
- }
- ]
- }
-}
+++ /dev/null
-/rests/data/bgp-rib:bgp-rib/rib=example-bgp-rib/loc-rib/tables=bgp-types%3Aipv4-address-family,bgp-types%3Ampls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes
+++ /dev/null
-<protocol xmlns="http://openconfig.net/yang/network-instance">
- <name>example-bgp-rib</name>
- <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
- <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
- <global>
- <config>
- <router-id>192.0.2.2</router-id>
- <as>64496</as>
- </config>
- <afi-safis>
- <afi-safi>
- <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
- <receive>true</receive>
- <send-max>$MULTIPATH</send-max>
- </afi-safi>
- </afi-safis>
- </global>
- </bgp>
-</protocol>
+++ /dev/null
-/rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types%3ABGP,example-bgp-rib
+++ /dev/null
-/restconf/operations/neutronvpn:associateRouter
+++ /dev/null
-{
- "input":{
- "vpn-id":"$vpnid",
- "router-id":[
- "$routerid"
- ]
- }
-}
+++ /dev/null
-/restconf/operations/neutronvpn:dissociateRouter
+++ /dev/null
-{
- "input":{
- "vpn-id":"$vpnid",
- "router-id":[
- "$routerid"
- ]
- }
-}