Fix bgp default policies test 40/77540/2
authortomas.markovic <tomas.markovic@pantheon.tech>
Tue, 6 Nov 2018 13:57:48 +0000 (14:57 +0100)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 6 Nov 2018 18:12:15 +0000 (18:12 +0000)
Change-Id: I378ba8ba4d56a217cd43b555e3976d9183aa47ca
Signed-off-by: tomas.markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpfunct/bgp_policies_default.robot
csit/variables/bgpfunctional/bgppolicies/app_peer_rib/data.json
csit/variables/bgpfunctional/bgppolicies/effective_rib_in/peer_1/data.json
csit/variables/bgpfunctional/bgppolicies/effective_rib_in/peer_2/data.json
csit/variables/bgpfunctional/bgppolicies/effective_rib_in/peer_5/data.json

index ec711a3f60e54e2ce09cd3792df1384763bc029f..32c22bda3b900c073eb837b0f3cd451c69054fb2 100644 (file)
@@ -17,6 +17,7 @@ Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Library           RequestsLibrary
 Library           SSHLibrary
 Resource          ../../../variables/Variables.robot
+Resource          ../../../libraries/CompareStream.robot
 Resource          ../../../libraries/ExaBgpLib.robot
 Resource          ../../../libraries/SetupUtils.robot
 Resource          ../../../libraries/TemplatedRequests.robot
@@ -30,6 +31,8 @@ ${CMD}            env exabgp.tcp.port=1790 exabgp --debug
 ${HOLDTIME}       180
 ${RIB_INSTANCE}    example-bgp-rib
 ${CONFIG_SESSION}    config-session
+${OLD_AS_PATH}    \n"as-path": {},
+${NEW_AS_PATH}    ${EMPTY}
 
 *** Test Cases ***
 Verify_Rib_Empty
@@ -109,11 +112,12 @@ Verify_Rib_Status
     # gets and outputs full rib output for debug purposes if one of the peers reports faulty data.
     ${output}    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/rib_state    session=${CONFIG_SESSION}
     BuiltIn.Log    ${output}
+    ${AS_PATH} =    CompareStream.Set_Variable_If_At_Least_Neon    ${NEW_AS_PATH}    ${OLD_AS_PATH}
     : FOR    ${index}    IN    @{NUMBERS}
-    \    &{mapping}    BuiltIn.Create_Dictionary    IP=127.0.0.${index}
+    \    &{mapping}    BuiltIn.Create_Dictionary    IP=127.0.0.${index}    AS_PATH=${AS_PATH}
     \    BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/effective_rib_in/peer_${index}    mapping=${mapping}
     \    ...    session=${CONFIG_SESSION}    verify=True
-    &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${ODL_SYSTEM_IP}    AS_PATH=${AS_PATH}
     # application peer verification
     BuiltIn.Wait_Until_Keyword_Succeeds    5x    3s    TemplatedRequests.Get_As_Json_Templated    ${POLICIES_VAR}/app_peer_rib    mapping=${mapping}    session=${CONFIG_SESSION}
     ...    verify=True
index 2145c18604d9e00f238fcf488d214ad53e180b3a..202065676b9bbfd7069270a3f591cef71196ef6e 100644 (file)
@@ -2,8 +2,7 @@
     "bgp-inet:ipv4-routes": {
         "ipv4-route": [
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "ipv4-next-hop": {
                         "global": "10.11.1.1"
                     },
index e1fbdb7c8e7e217410cea553727f0195db90a501..d7002a4093e821c1332ef200374156dbfa3b117e 100644 (file)
@@ -2,8 +2,7 @@
     "bgp-inet:ipv4-routes": {
         "ipv4-route": [
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "communities": [
                         {
                             "as-number": 30741,
index 6a6636c958dc01d29bea521f403bddfefbab1bb8..f6796b9a97c5f4e73ad61e359d8095c2931477c7 100644 (file)
@@ -2,8 +2,7 @@
     "bgp-inet:ipv4-routes": {
         "ipv4-route": [
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "ipv4-next-hop": {
                         "global": "12.0.255.254"
                     },
@@ -19,8 +18,7 @@
                 "route-key": "2.1.1.0/24"
             },
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "ipv4-next-hop": {
                         "global": "12.1.255.254"
                     },
@@ -36,8 +34,7 @@
                 "route-key": "2.2.1.0/24"
             },
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "ipv4-next-hop": {
                         "global": "12.3.255.254"
                     },
index ade0d2635364176e523f35513b3d9c4d92c122b0..93a7e7ce8317afd17fc24fd9d81638c8737f3bae 100644 (file)
@@ -2,8 +2,7 @@
     "bgp-inet:ipv4-routes": {
         "ipv4-route": [
             {
-                "attributes": {
-                    "as-path": {},
+                "attributes": {$AS_PATH
                     "extended-communities": [
                         {
                             "route-target-extended-community": {