*** Variables ***
${BGPSpeaker__OUTPUT_LOG} play.py.out
-${PEER_URL} restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
*** Keywords ***
Start_BGP_Speaker
[Arguments] ${session} ${ip} ${connected}=${True}
[Documentation] Verifies peer's presence in bgp rib.
${exp_status_code} BuiltIn.Set_Variable_If ${connected} ${200} ${404}
- ${url} BuiltIn.Set_Variable ${PEER_URL}${ip}
+ ${url}= BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F${ip}?content=nonconfig
${response} RequestsLibrary.Get_Request ${session} ${url}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${response.status_code}
[Return] ${response.content}
*** Variables ***
${BGP_BMP_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/filled_structure
${BGP_BMP_FEAT_DIR} ${CURDIR}/../variables/bgpfunctional/bmp_basic/empty_structure
-${BGP_RIB_URI} ${OPERATIONAL_API}/bgp-rib:bgp-rib/rib/example-bgp-rib
-${BGP_TOPOLOGY_URI} ${OPERATIONAL_TOPO_API}/topology/example-ipv4-topology
+${BGP_RIB_URI} bgp-rib:bgp-rib/rib=example-bgp-rib
+${BGP_TOPOLOGY_URI} ${TOPOLOGY_URL}=example-ipv4-topology
${VAR_BASE_BGP} ${CURDIR}/../variables/bgpfunctional
${RIB_NAME} example-bgp-rib
${OLD_AS_PATH} \n"as-path": {},
Check_Example_Bgp_Rib_Content
[Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} not found, but expected.
[Documentation] Check the example-bgp-rib content for string
- ${response}= RequestsLibrary.Get Request ${session} ${BGP_RIB_URI}
+ ${response}= RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_RIB_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Contain ${response.text} ${substr} ${error_message} values=False
Check_Example_Bgp_Rib_Does_Not_Contain
[Arguments] ${session} ${substr} ${error_message}=${JSONKEYSTR} found, but not expected.
[Documentation] Check the example-bgp-rib does not contain the string
- ${response}= RequestsLibrary.Get Request ${session} ${BGP_RIB_URI}
+ ${response}= RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_RIB_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Not_Contain ${response.text} ${substr} ${error_message} values=False
Check_Example_IPv4_Topology_Content
[Arguments] ${session} ${string_to_check}=${EMPTY}
[Documentation] Check the example-ipv4-topology content for string
- ${response}= RequestsLibrary.Get Request ${session} ${BGP_TOPOLOGY_URI}
+ ${response}= RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Contain ${response.text} ${string_to_check}
Check_Example_IPv4_Topology_Does_Not_Contain
[Arguments] ${session} ${string_to_check}
[Documentation] Check the example-ipv4-topology does not contain the string
- ${response}= RequestsLibrary.Get Request ${session} ${BGP_TOPOLOGY_URI}
+ ${response}= RequestsLibrary.Get Request ${session} ${REST_API}/${BGP_TOPOLOGY_URI}?content=nonconfig
BuiltIn.Log ${response.status_code}
BuiltIn.Log ${response.text}
BuiltIn.Should_Not_Contain ${response.text} ${string_to_check}
*** Variables ***
${EXABGP_KILL_COMMAND} ps axf | grep exabgp | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
${CMD} env exabgp.tcp.port=1790 exabgp --debug
-${PEER_CHECK_URL} {$REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
*** Keywords ***
Start_ExaBgp
Verify_ExaBgps_Connection
[Arguments] ${session} ${exabgp_ip}=${TOOLS_SYSTEM_IP} ${connected}=${True}
[Documentation] Checks peer presence in operational datastore
+ ${peer_check_url}= BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
${exp_status_code}= BuiltIn.Set_Variable_If ${connected} ${200} ${404}
- ${rsp}= RequestsLibrary.Get Request ${session} ${PEER_CHECK_URL}${exabgp_ip}?content=nonconfig
+ ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${exabgp_ip}?content=nonconfig
BuiltIn.Log ${rsp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
*** Variables ***
${GOBGP_KILL_COMMAND} ps axf | grep gobgp | grep -v grep | awk '{print \"kill -9 \" $1}' | sh
${GOBGP_EXECUTION_COMMAND} /home/jenkins/gobgpd -l debug -f
-${PEER_CHECK_URL} ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
*** Keywords ***
Start_GoBgp
Verify_GoBgps_Connection
[Arguments] ${session} ${gobgp_ip}=${TOOLS_SYSTEM_IP} ${connected}=${True}
[Documentation] Checks peer presence in operational datastore
+ ${peer_check_url}= BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
${exp_status_code}= BuiltIn.Set_Variable_If ${connected} ${ALLOWED_STATUS_CODES} ${DELETED_STATUS_CODES}
- ${rsp}= RequestsLibrary.Get Request ${session} ${PEER_CHECK_URL}${gobgp_ip}?content=nonconfig
+ ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${gobgp_ip}?content=nonconfig
BuiltIn.Log ${rsp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
Setup_Pcep_Operations
[Documentation] Creates Requests session to be used by subsequent keywords.
# Do not append slash at the end uf URL, Requests would add another, resulting in error.
- Create_Session pcep_session http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/restconf/operations headers=${HEADERS_XML} auth=${AUTH}
+ Create_Session pcep_session http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations headers=${HEADERS_XML} auth=${AUTH}
Teardown_Pcep_Operations
[Documentation] Teardown to pair with Setup (otherwise no-op).
Pcep_Json_Is_Refused
[Arguments] ${actual_raw}
[Documentation] Given text should be equal to json response when device refuses tunnel removal.
- ${expected_raw}= BuiltIn.Set_Variable {"output":{"error":[{"error-object":{"ignore":false,"processing-rule":false,"type":19,"value":9}}],"failure":"failed"}}
+ ${expected_raw}= BuiltIn.Set_Variable {"network-topology-pcep:output":{"error":[{"error-object":{"ignore":false,"processing-rule":false,"type":19,"value":9}}],"failure":"failed"}}
# TODO: Is that JSON worth referencing pcepuser variables from this library?
${expected_normalized}= norm_json.normalize_json_text ${expected_raw}
${actual_normalized}= norm_json.normalize_json_text ${actual_raw}
${RIB_INSTANCE} example-bgp-rib
${PROTOCOL_OPENCONFIG} ${RIB_INSTANCE}
${BGP_PEER_NAME} example-bgp-peer
-${PEER_CHECK_URL} ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
@{SHARD_MONITOR_LIST} default:config default:operational topology:config topology:operational inventory:config inventory:operational
*** Keywords ***
[Arguments] ${session} ${peer_ip} ${connected}=${True}
[Documentation] Checks peer presence in operational datastore
# TODO: This keyword is not specific to prefix counting. Find a better place for it.
+ ${peer_check_url}= BuiltIn.Set_Variable ${REST_API}/bgp-rib:bgp-rib/rib=example-bgp-rib/peer=bgp:%2F%2F
${exp_status_code}= BuiltIn.Set_Variable_If ${connected} ${200} ${404}
- ${rsp}= RequestsLibrary.Get Request ${session} ${PEER_CHECK_URL}${peer_ip}?content=nonconfig
+ ${rsp}= RequestsLibrary.Get Request ${session} ${peer_check_url}${peer_ip}?content=nonconfig
BuiltIn.Log ${rsp.content}
BuiltIn.Should_Be_Equal_As_Numbers ${exp_status_code} ${rsp.status_code}
RequestsLibrary.Create Session ${CONFIG_SESSION} http://${ODL_SYSTEM_IP}:${RESTCONFPORT} auth=${AUTH}
SSHLibrary.Put File ${PLAY_SCRIPT} .
SSHKeywords.Assure_Library_Ipaddr target_dir=.
- BuiltIn.Set_Suite_Variable ${EVPN_CONF_URL} /restconf/config/bgp-rib:application-rib/${ODL_SYSTEM_IP}/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes
- BuiltIn.Set_Suite_Variable ${EVPN_LOC_RIB} /restconf/operational/bgp-rib:bgp-rib/rib/${RIB_NAME}/loc-rib/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes
- BuiltIn.Set_Suite_Variable ${EVPN_FAMILY_LOC_RIB} /restconf/operational/bgp-rib:bgp-rib/rib/${RIB_NAME}/loc-rib/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/
+ BuiltIn.Set_Suite_Variable ${EVPN_CONF_URL} /rests/data/bgp-rib:application-rib=${ODL_SYSTEM_IP}/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes
+ BuiltIn.Set_Suite_Variable ${EVPN_LOC_RIB} /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family/odl-bgp-evpn:evpn-routes?content=nonconfig
+ BuiltIn.Set_Suite_Variable ${EVPN_FAMILY_LOC_RIB} /rests/data/bgp-rib:bgp-rib/rib=${RIB_NAME}/loc-rib/tables=odl-bgp-evpn%3Al2vpn-address-family,odl-bgp-evpn%3Aevpn-subsequent-address-family?content=nonconfig
${evpn_routes_line} = CompareStream.Set_Variable_If_At_Least_Neon ${NEW_EVPN_ROUTES_LINE} ${OLD_EVPN_ROUTES_LINE}
&{mapping} BuiltIn.Create_Dictionary EVPN_ROUTES=${evpn_routes_line}
${EMPTY_ROUTES} = TemplatedRequests.Resolve_Text_From_Template_File ${EVPN_DIR}/empty_routes empty_routes.json ${mapping}
BgpRpcClient.play_clean
${resp} = RequestsLibrary.Post_Request ${CONFIG_SESSION} ${EVPN_CONF_URL} data=${post_data_xml} headers=${HEADERS_XML}
BuiltIn.Log ${resp.content}
- BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 204
- ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL} headers=${HEADERS_XML}
+ BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 201
+ ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}?content=config headers=${HEADERS_XML}
BuiltIn.Log ${resp.content}
${aupdate} = BuiltIn.Wait_Until_Keyword_Succeeds 4x 2s Get_Update_Content
BuiltIn.Log ${aupdate}
[Teardown] Withdraw_Route_And_Verify ${withdraw_hex}
Verify_Test_Preconditions
- ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}
+ ${resp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}?content=config
BuiltIn.Should_Contain ${DELETED_STATUS_CODES} ${resp.status_code}
${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_FAMILY_LOC_RIB} headers=${HEADERS}
TemplatedRequests.Normalize_Jsons_And_Compare ${EMPTY_ROUTES} ${rsp.content}
[Documentation] Removes the route if present. First GET is for debug purposes.
${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_LOC_RIB} headers=${HEADERS}
Log ${rsp.content}
- ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL} headers=${HEADERS}
+ ${rsp} = RequestsLibrary.Get_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}?content=config headers=${HEADERS}
Log ${rsp.content}
BuiltIn.Return_From_Keyword_If ${rsp.status_code} in ${DELETED_STATUS_CODES}
${resp} = RequestsLibrary.Delete_Request ${CONFIG_SESSION} ${EVPN_CONF_URL}
- BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 200
+ BuiltIn.Should_Be_Equal_As_Numbers ${resp.status_code} 204
Withdraw_Route_And_Verify
[Arguments] ${withdraw_hex}
Start_Bgp_Peer
[Arguments] ${ip} ${as_number} ${port} ${filename}
[Documentation] Starts bgp peer.
- ${command} = BuiltIn.Set_Variable python play.py --amount 0 --myip=${ip} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --asnumber=${as_number} --peerport=${ODL_BGP_PORT} --port=${port} --usepeerip --debug --allf --wfr 1 &> ${filename} &
+ ${command} = BuiltIn.Set_Variable python3 play.py --amount 0 --myip=${ip} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --asnumber=${as_number} --peerport=${ODL_BGP_PORT} --port=${port} --usepeerip --debug --allf --wfr 1 &> ${filename} &
BuiltIn.Log ${command}
${output} = SSHLibrary.Write ${command}
[Arguments] ${prefix}=${FIRST_PREFIX} ${amount}=1 ${myip}=${PEER1_IP} ${port}=${PEER1_PORT} ${as_number}=${PEER1_AS} ${grace}=0
... ${log_name}=play.py.out ${multiple}=& ${ipv6}=${EMPTY}
[Documentation] Starts bgp peer.
- ${command} = BuiltIn.Set_Variable python play.py${ipv6} --firstprefix ${prefix} --prefixlen ${PREFIX_LEN} --amount ${amount} --myip ${myip} --myport ${BGP_TOOL_PORT} --peerip ${ODL_SYSTEM_IP} --peerport ${ODL_BGP_PORT} --port ${port} --usepeerip --nexthop ${NEXT_HOP} --asnumber ${as_number} --debug --grace ${grace} --wfr 1 &> ${log_name} ${multiple}
+ ${command} = BuiltIn.Set_Variable python3 play.py${ipv6} --firstprefix ${prefix} --prefixlen ${PREFIX_LEN} --amount ${amount} --myip ${myip} --myport ${BGP_TOOL_PORT} --peerip ${ODL_SYSTEM_IP} --peerport ${ODL_BGP_PORT} --port ${port} --usepeerip --nexthop ${NEXT_HOP} --asnumber ${as_number} --debug --grace ${grace} --wfr 1 &> ${log_name} ${multiple}
BuiltIn.Log ${command}
${output} = SSHLibrary.Write ${command}
${IPV6_IP_2} 2607:f0d0:1002:11:0:0:0:2
${IPV6_IP_3} 2607:f0d0:1002:11::2
${IPV6_IP_GW} 2607:f0d0:1002:0011:0000:0000:0000:0001
+${IPV6_PREFIX_LENGTH} 64
${HOLDTIME} 180
${RIB_INSTANCE} example-bgp-rib
Configure_Ipv6_Network
[Documentation] Reconfigures basic network settings on controller
- SSHLibrary.Execute_Command sudo sh -c 'echo "NETWORKING_IPV6=yes" >> /etc/sysconfig/network'
- SSHLibrary.Execute_Command sudo sh -c 'echo "IPV6INIT=yes" >> /etc/sysconfig/network-scripts/ifcfg-eth0'
- SSHLibrary.Execute_Command sudo sh -c 'echo "IPV6ADDR=${IPV6_IP}" >> /etc/sysconfig/network-scripts/ifcfg-eth0'
- SSHLibrary.Execute_Command sudo sh -c 'echo "IPV6_DEFAULTGW=${IPV6_IP_GW}" >> /etc/sysconfig/network-scripts/ifcfg-eth0'
- SSHLibrary.Execute_Command sudo /etc/init.d/network restart
+ SSHLibrary.Execute_Command sudo ip -6 addr add ${IPV6_IP}/${IPV6_PREFIX_LENGTH} dev eth0
+ SSHLibrary.Execute_Command sudo ip -6 route add default via ${IPV6_IP_GW}
+ ${stdout}= SSHLibrary.Execute_Command sudo ip -6 addr show
+ Log ${stdout}
+ ${stdout}= SSHLibrary.Execute_Command sudo ip -6 route show
+ Log ${stdout}
Verify_Rib_Status_Empty
[Documentation] Verifies that example-ipv6-topology is empty
${BGP_PEER2_PREFIX_COUNT} ${PREFIX_COUNT}
${BGP_PEER1_LOG_FILE} bgp_peer1.log
${BGP_PEER2_LOG_FILE} bgp_peer2.log
-${BGP_PEER1_COMMAND} python play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
-${BGP_PEER2_COMMAND} python play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
+${BGP_PEER1_COMMAND} python3 play.py --firstprefix ${BGP_PEER1_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER1_PREFIX_LEN} --amount ${BGP_PEER1_PREFIX_COUNT} --myip=${BGP_PEER1_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER1_LOG_FILE}
+${BGP_PEER2_COMMAND} python3 play.py --firstprefix ${BGP_PEER2_FIRST_PREFIX_IP} --prefixlen ${BGP_PEER2_PREFIX_LEN} --amount ${BGP_PEER2_PREFIX_COUNT} --myip=${BGP_PEER2_IP} --myport=${BGP_TOOL_PORT} --peerip=${ODL_SYSTEM_IP} --peerport=${ODL_BGP_PORT} --${BGP_PEER_LOG_LEVEL} --logfile ${BGP_PEER2_LOG_FILE}
${BGP_PEER1_OPTIONS} &>${BGP_PEER1_LOG_FILE}
${BGP_PEER2_OPTIONS} &>${BGP_PEER2_LOG_FILE}
${DEFAULT_LOG_CHECK_TIMEOUT} 20s
*** Variables ***
${CONFIG_SESSION} session
-${PATH_SESSION_URI} node/pcc:%2F%2F${TOOLS_SYSTEM_IP}/path-computation-client
+${PATH_SESSION_URI} node=pcc:%2F%2F${TOOLS_SYSTEM_IP}/network-topology-pcep:path-computation-client
${PCEP_VARIABLES_FOLDER} ${CURDIR}/../../../variables/pcepuser/${ODL_STREAM}
*** Test Cases ***
... Error codes and normalized jsons should match exactly.
# TODO: Add Node Session State Check For Oxygen, see tcpmd5user
# TODO: Possibly remake all tests with TemplatedRequests
- ${response}= RequestsLibrary.Get Request ${CONFIG_SESSION} ${OPERATIONAL_TOPO_API}/topology/pcep-topology/${uri}
+ ${topology_uri}= BuiltIn.Set_Variable_If '${uri}'=='${EMPTY}'
+ ... ${REST_API}/${TOPOLOGY_URL}=pcep-topology?content=nonconfig ${REST_API}/${TOPOLOGY_URL}=pcep-topology/${uri}?content=nonconfig
+ ${response}= RequestsLibrary.Get Request ${CONFIG_SESSION} ${topology_uri}
BuiltIn.Should_Be_Equal_As_Strings ${response.status_code} 200
TemplatedRequests.Normalize_Jsons_And_Compare ${exp} ${response.text}
{
- "tables": [
+ "bgp-rib:tables": [
{
"afi": "odl-bgp-evpn:l2vpn-address-family",
"safi": "odl-bgp-evpn:evpn-subsequent-address-family",$EVPN_ROUTES
-restconf/operations/bgp-peer-rpc:reset-session
+rests/operations/bgp-peer-rpc:reset-session
variables[
"off_json"
] = """{
- "topology": [
+ "network-topology:topology": [
{
"topology-id": "pcep-topology",
"topology-types": {
{
- "topology": [
+ "network-topology:topology": [
{
"topology-id": "pcep-topology",
"topology-types": {
-restconf/operational/network-topology:network-topology/topology/pcep-topology
+rests/data/network-topology:network-topology/topology=pcep-topology?content=nonconfig
{
- "topology": [
+ "network-topology:topology": [
{
"node": [
{
-restconf/operational/network-topology:network-topology/topology/pcep-topology
+rests/data/network-topology:network-topology/topology=pcep-topology?content=nonconfig
{
- "topology": [
+ "network-topology:topology": [
{
"node": [
{
-restconf/operational/network-topology:network-topology/topology/pcep-topology
+rests/data/network-topology:network-topology/topology=pcep-topology?content=nonconfig
-restconf/config/network-topology:network-topology/topology/pcep-topology/node/$IP
+rests/data/network-topology:network-topology/topology=pcep-topology/node=$IP
-restconf/config/network-topology:network-topology/topology/pcep-topology/node/$IP
+rests/data/network-topology:network-topology/topology=pcep-topology/node=$IP
-restconf/operations/network-topology-pcep:update-lsp
+rests/operations/network-topology-pcep:update-lsp