Test lsp output more precisely 17/72017/4
authorTomas Markovic <tomas.markovic@pantheon.tech>
Tue, 15 May 2018 14:47:44 +0000 (16:47 +0200)
committerTomas Markovic <tomas.markovic@pantheon.tech>
Tue, 15 May 2018 15:26:09 +0000 (17:26 +0200)
Attributes can change between versions,
therefore we want to see these changes
and address them when necessary.

Currently it's just checking for one line
which is actually several times in the output.

Adding fulltext for comparison for rib which
matters the most in this case.

Change-Id: I02ec42fc0176128da4264fa7f83811917d62ab04
Signed-off-by: Tomas Markovic <tomas.markovic@pantheon.tech>
csit/suites/bgpcep/bgpuser/ibgp_peer_lsp.robot
csit/variables/bgpuser/lsp/effective_rib_in.fluorine/data.json [new file with mode: 0644]
csit/variables/bgpuser/lsp/effective_rib_in.fluorine/location.uri [new file with mode: 0644]
csit/variables/bgpuser/lsp/effective_rib_in/data.json [new file with mode: 0644]
csit/variables/bgpuser/lsp/effective_rib_in/location.uri [new file with mode: 0644]

index d8c5dec742d18dd5aa72c57df96437646901e0f0..bc975f35ece3922fdb3a4304f8b0e0326fa4ed35 100644 (file)
@@ -57,13 +57,11 @@ TC1_Configure_iBGP_Peer
 TC1_Check_Example_Bgp_Rib_Is_Empty
     [Documentation]    Check RIB for none linkstate-routes
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BgpOperations.Check_Example_Bgp_Rib_Does_Not_Contain    ${CONFIG_SESSION}    ${JSONKEYSTR}
 
 TC1_Connect_BGP_Peer
     [Documentation]    Connect BGP peer with advertising the routes without mandatory params like LOC_PREF.
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BuiltIn.Run_Keyword_And_Ignore_Error    KarafKeywords.Log_Message_To_Controller_Karaf    Error = WELL_KNOWN_ATTR_MISSING is EXPECTED in this test case, and should be thrown when missing mandatory attributes.
     BGPcliKeywords.Start_Console_Tool    ${BGP_PEER_COMMAND} ${SKIP_PARAMS}    ${BGP_PEER_OPTIONS}
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
@@ -71,13 +69,11 @@ TC1_Connect_BGP_Peer
 TC1_Check_Example_Bgp_Rib
     [Documentation]    Check RIB for not containig linkstate-route(s), because update messages were not good.
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     WaitForFailure.Verify_Keyword_Does_Not_Fail_Within_Timeout    ${DEFAULT_RIB_CHECK_TIMEOUT}    ${DEFAULT_RIB_CHECK_PERIOD}    BgpOperations.Check_Example_Bgp_Rib_Does_Not_Contain    ${CONFIG_SESSION}    ${JSONKEYSTR}
 
 TC1_Disconnect_BGP_Peer
     [Documentation]    Stop BGP peer & store logs
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BGPcliKeywords.Stop_Console_Tool
     BGPcliKeywords.Store_File_To_Workspace    ${BGP_PEER_LOG_FILE}    tc1_${BGP_PEER_LOG_FILE}
 
@@ -95,26 +91,24 @@ TC2_Configure_iBGP_Peer
 TC2_Check_Example_Bgp_Rib_Is_Empty
     [Documentation]    Check RIB for none linkstate-routes
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BgpOperations.Check_Example_Bgp_Rib_Does_Not_Contain    ${CONFIG_SESSION}    ${JSONKEYSTR}
 
 TC2_Connect_BGP_Peer
     [Documentation]    Connect BGP peer
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BGPcliKeywords.Start_Console_Tool    ${BGP_PEER_COMMAND}    ${BGP_PEER_OPTIONS}
     BGPcliKeywords.Read_And_Fail_If_Prompt_Is_Seen
 
 TC2_Check_Example_Bgp_Rib
-    [Documentation]    Check RIB for linkstate-route(s)
+    [Documentation]    Check RIB for linkstate-route(s) and check all of their attributes.
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
-    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_RIB_CHECK_TIMEOUT}    ${DEFAULT_RIB_CHECK_PERIOD}    BgpOperations.Check_Example_Bgp_Rib_Content    ${CONFIG_SESSION}    ${JSONKEYSTR}
+    &{mapping}    BuiltIn.Create_Dictionary    IP=${TOOLS_SYSTEM_IP}
+    BuiltIn.Wait_Until_Keyword_Succeeds    ${DEFAULT_RIB_CHECK_TIMEOUT}    ${DEFAULT_RIB_CHECK_PERIOD}    TemplatedRequests.Get_As_Json_Templated    ${BGP_VARIABLES_FOLDER}/lsp/effective_rib_in    mapping=${mapping}    session=${CONFIG_SESSION}
+    ...    verify=True
 
 TC2_Disconnect_BGP_Peer
     [Documentation]    Stop BGP peer & store logs
     [Tags]    critical
-    SSHLibrary.Switch Connection    bgp_peer_console
     BGPcliKeywords.Stop_Console_Tool
     BGPcliKeywords.Store_File_To_Workspace    ${BGP_PEER_LOG_FILE}    tc2_${BGP_PEER_LOG_FILE}
 
@@ -129,7 +123,7 @@ Setup_Everything
     ...    prepare directories for responses, put Python tool to mininet machine, setup imported resources.
     SetupUtils.Setup_Utils_For_Setup_And_Teardown
     SSHLibrary.Set_Default_Configuration    prompt=${TOOLS_SYSTEM_PROMPT}
-    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}    alias=bgp_peer_console
+    SSHLibrary.Open_Connection    ${TOOLS_SYSTEM_IP}
     SSHKeywords.Flexible_Mininet_Login
     SSHKeywords.Require_Python
     SSHKeywords.Assure_Library_Ipaddr    target_dir=.
diff --git a/csit/variables/bgpuser/lsp/effective_rib_in.fluorine/data.json b/csit/variables/bgpuser/lsp/effective_rib_in.fluorine/data.json
new file mode 100644 (file)
index 0000000..1d7e68e
--- /dev/null
@@ -0,0 +1,36 @@
+{
+    "bgp-linkstate:linkstate-routes": {
+        "linkstate-route": [
+            {
+                "path-id": 0,
+                "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]",
+                "tunnel-id": 1,
+                "lsp-id": 1,
+                "ipv4-tunnel-endpoint-address": "5.6.7.8",
+                "ipv4-tunnel-sender-address": "1.2.3.4",
+                "attributes": {
+                    "ipv4-next-hop": {
+                        "global": "192.0.2.1"
+                    },
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "as-path": {
+                        "segments": [
+                            {
+                                "as-sequence": [
+                                    64496
+                                ]
+                            }
+                        ]
+                    },
+                    "local-pref": {
+                        "pref": 100
+                    }
+                },
+                "identifier": 1,
+                "protocol-id": "bgp-epe"
+            }
+        ]
+    }
+}
diff --git a/csit/variables/bgpuser/lsp/effective_rib_in.fluorine/location.uri b/csit/variables/bgpuser/lsp/effective_rib_in.fluorine/location.uri
new file mode 100644 (file)
index 0000000..ab37ad6
--- /dev/null
@@ -0,0 +1 @@
+restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F$IP/effective-rib-in/tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/bgp-linkstate:linkstate-routes
diff --git a/csit/variables/bgpuser/lsp/effective_rib_in/data.json b/csit/variables/bgpuser/lsp/effective_rib_in/data.json
new file mode 100644 (file)
index 0000000..6cca8d7
--- /dev/null
@@ -0,0 +1,35 @@
+{
+    "bgp-linkstate:linkstate-routes": {
+        "linkstate-route": [
+            {
+                "route-key": "AAUAFQcAAAAAAAAAAQECAwQAAQABBQYHCA==",
+                "lsp-id": 1,
+                "ipv4-tunnel-endpoint-address": "5.6.7.8",
+                "ipv4-tunnel-sender-address": "1.2.3.4",
+                "tunnel-id": 1,
+                "protocol-id": "bgp-epe",
+                "identifier": 1,
+                "attributes": {
+                    "origin": {
+                        "value": "igp"
+                    },
+                    "local-pref": {
+                        "pref": 100
+                    },
+                    "as-path": {
+                        "segments": [
+                            {
+                                "as-sequence": [
+                                    64496
+                                ]
+                            }
+                        ]
+                    },
+                    "ipv4-next-hop": {
+                        "global": "192.0.2.1"
+                    }
+                }
+            }
+        ]
+    }
+}
diff --git a/csit/variables/bgpuser/lsp/effective_rib_in/location.uri b/csit/variables/bgpuser/lsp/effective_rib_in/location.uri
new file mode 100644 (file)
index 0000000..ab37ad6
--- /dev/null
@@ -0,0 +1 @@
+restconf/operational/bgp-rib:bgp-rib/rib/example-bgp-rib/peer/bgp:%2F%2F$IP/effective-rib-in/tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/bgp-linkstate:linkstate-routes