BGPCEP-781: Adjust l3vpn routes 23/70323/6
authorTomas Markovic <tomas.markovic@pantheon.tech>
Wed, 4 Apr 2018 08:09:56 +0000 (10:09 +0200)
committerLuis Gomez <ecelgp@gmail.com>
Wed, 4 Apr 2018 14:45:14 +0000 (14:45 +0000)
path-id is now mandatory for l3vpn routes,
and should be expected and configured as well.

Change-Id: Ib1d5e87391411db73885d35373e2bf108f5348f7
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpfunct/010_bgp_functional_l3vpn.robot
csit/variables/bgpfunctional/l3vpn_ipv4/bgp-l3vpn-ipv4-path.json [new file with mode: 0644]
csit/variables/bgpfunctional/l3vpn_ipv4/route-path/location.uri [new file with mode: 0644]
csit/variables/bgpfunctional/l3vpn_ipv4/route-path/post_data.xml [moved from csit/variables/bgpfunctional/l3vpn_ipv4/route.boron/post_data.xml with 95% similarity]
csit/variables/bgpfunctional/l3vpn_ipv4/route.boron/location.uri [deleted file]

index 81e0ddea256ab95d33d89873ee759e739c42623c..e4e8423332ae8317904d12ced2608ed30dffe643 100644 (file)
@@ -16,12 +16,13 @@ Suite Teardown    Stop_Suite
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Library           RequestsLibrary
 Library           SSHLibrary
-Variables         ${CURDIR}/../../../variables/Variables.py
+Resource          ${CURDIR}/../../../variables/Variables.robot
 Resource          ${CURDIR}/../../../libraries/ExaBgpLib.robot
 Resource          ${CURDIR}/../../../libraries/Utils.robot
 Resource          ${CURDIR}/../../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../../libraries/SSHKeywords.robot
+Resource          ${CURDIR}/../../../libraries/CompareStream.robot
 Library           ${CURDIR}/../../../libraries/BgpRpcClient.py    ${TOOLS_SYSTEM_IP}
 
 *** Variables ***
@@ -37,7 +38,9 @@ ${DEFAUTL_EXA_CFG}    exa.cfg
 ${L3VPN_EXA_CFG}    bgp-l3vpn-ipv4.cfg
 ${L3VPN_RSPEMPTY}    ${BGP_L3VPN_DIR}/bgp-l3vpn-ipv4-empty.json
 ${L3VPN_RSP}      ${BGP_L3VPN_DIR}/bgp-l3vpn-ipv4.json
+${L3VPN_RSP_PATH}    ${BGP_L3VPN_DIR}/bgp-l3vpn-ipv4-path.json
 ${L3VPN_URL}      /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes
+${L3VPN_EXP}      ${BGP_L3VPN_DIR}/route_expected/exa-expected.json
 ${CONFIG_SESSION}    config-session
 ${EXARPCSCRIPT}    ${CURDIR}/../../../../tools/exabgp_files/exarpc.py
 ${PEER_CHECK_URL}    /restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F
@@ -59,7 +62,8 @@ Reconfigure_ODL_To_Accept_Connection
 L3vpn_Ipv4_To_Odl
     [Documentation]    Testing mpls vpn ipv4 routes reported to odl from exabgp
     [Setup]    Setup_Testcase    ${L3VPN_EXA_CFG}
-    BuiltIn.Wait_Until_Keyword_Succeeds    15s    1s    Verify Reported Data    ${L3VPN_URL}    ${L3VPN_RSP}
+    ${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_URL}    ${L3VPN_RESPONSE}
     [Teardown]    Teardown_Simple
 
 L3vpn_Ipv4_From_Odl
@@ -67,8 +71,9 @@ L3vpn_Ipv4_From_Odl
     [Setup]    Setup_Testcase    ${DEFAUTL_EXA_CFG}
     BgpRpcClient.exa_clean_update_message
     &{mapping}    BuiltIn.Create_Dictionary    BGP_PEER_IP=${TOOLS_SYSTEM_IP}    APP_PEER_IP=${ODL_SYSTEM_IP}
-    TemplatedRequests.Post_As_Xml_Templated    ${BGP_L3VPN_DIR}/route    mapping=${mapping}    session=${CONFIG_SESSION}
-    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Update    ${BGP_L3VPN_DIR}/route_expected/exa-expected.json
+    ${BGP_L3VPN_DIR_ROUTE}    CompareStream.Set_Variable_If_At_Least_Fluorine    ${BGP_L3VPN_DIR}/route-path    ${BGP_L3VPN_DIR}/route
+    TemplatedRequests.Post_As_Xml_Templated    ${BGP_L3VPN_DIR_ROUTE}    mapping=${mapping}    session=${CONFIG_SESSION}
+    BuiltIn.Wait_Until_Keyword_Succeeds    5x    2s    Verify_ExaBgp_Received_Update    ${L3VPN_EXP}
     [Teardown]    Teardowm_With_Remove_Route
 
 Delete_Bgp_Peer_Configuration
diff --git a/csit/variables/bgpfunctional/l3vpn_ipv4/bgp-l3vpn-ipv4-path.json b/csit/variables/bgpfunctional/l3vpn_ipv4/bgp-l3vpn-ipv4-path.json
new file mode 100644 (file)
index 0000000..90a97e9
--- /dev/null
@@ -0,0 +1,29 @@
+{
+ "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"
+   }
+  ]
+ }
+}
diff --git a/csit/variables/bgpfunctional/l3vpn_ipv4/route-path/location.uri b/csit/variables/bgpfunctional/l3vpn_ipv4/route-path/location.uri
new file mode 100644 (file)
index 0000000..5308660
--- /dev/null
@@ -0,0 +1 @@
+/restconf/config/bgp-rib:application-rib/$APP_PEER_IP/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes
similarity index 95%
rename from csit/variables/bgpfunctional/l3vpn_ipv4/route.boron/post_data.xml
rename to csit/variables/bgpfunctional/l3vpn_ipv4/route-path/post_data.xml
index 7abd5e9bf81f4a89cc8dbc5aa8e6c2e64e991380..85d776f1a6ebfdb6655d0ff0ffed8dc954d66d78 100644 (file)
@@ -1,4 +1,5 @@
 <vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
+  <path-id>0</path-id>
   <route-key>vpn1</route-key>
   <label-stack>
     <label-value>123</label-value>
diff --git a/csit/variables/bgpfunctional/l3vpn_ipv4/route.boron/location.uri b/csit/variables/bgpfunctional/l3vpn_ipv4/route.boron/location.uri
deleted file mode 100644 (file)
index 8b41322..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/restconf/config/bgp-rib:application-rib/example-app-rib/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes/