update tests after ODL bump to Neon 16/18616/14
authorMichal Cmarada <mcmarada@cisco.com>
Tue, 9 Apr 2019 06:12:05 +0000 (08:12 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Tue, 9 Apr 2019 06:12:05 +0000 (08:12 +0200)
Change-Id: Ia733ad304c51b28f2a945e570120821254077189
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
resources/libraries/python/honeycomb/BGP.py
resources/libraries/robot/honeycomb/bgp.robot
resources/test_data/honeycomb/bgp.py
resources/test_data/honeycomb/routing.py
tests/honeycomb/func/mgmt-cfg-bgp-apihc-func.robot

index 37a9cb6..976e41d 100644 (file)
@@ -392,4 +392,5 @@ class BGPKeywords(object):
         for item in ref:
             if item not in data:
                 raise HoneycombError(
-                    "RIB entry {0} not found in operational data.")
+                    "RIB entry {0} not found in operational data {1}."
+                    .format(item, data))
index aa96cc6..b390551 100644 (file)
@@ -48,7 +48,7 @@
 | | [Arguments] | ${node}
 | | ...
 | | ${oper_data}= | Get Full BGP Configuration | ${node}
-| | Should be Empty | ${oper_data['bgp-openconfig-extensions:bgp']['neighbors']}
+| | Should be Empty | ${oper_data['bgp-openconfig-extensions:bgp']}
 
 | Honeycomb adds BGP peer
 | | [Documentation] | Uses Honeycomb API to add a BGP peer.
 | | ... | ${node} | ${peer_address} | ${ip_version}
 | | Should be Empty | ${oper_data['bgp-inet:${ip_version}-routes']}
 
+| No BGP routes should exist
+| | [Documentation] | Uses Honeycomb API to verify that no BGP routes\
+| | ... | exist under the specified peer.
+| | ...
+| | ... | *Arguments:*
+| | ... | - node - Information about a DUT node. Type: dictionary
+| | ... | - peer_address - IP address of the peer. Type: string
+| | ... | - ip_version - IP protocol version, ipv4 or ipv6. Type: string
+| | ...
+| | ... | *Example:*
+| | ...
+| | ... | \| No BGP routes should be configured \| ${nodes['DUT1']} \
+| | ... | \| 192.168.0.1 \| ipv4 \|
+| | ...
+| | [Arguments] | ${node} | ${peer_address} | ${ip_version}
+| | ...
+| | Run keyword and expect error | *Status code: 404*
+| | ... | Get All Peer Routes
+| | ... | ${node} | ${peer_address} | ${ip_version}
+
 | BGP Loc-RIB table should include
 | | [Documentation] | Uses Honeycomb API to retrieve local BGP RIB table\
 | | ... | And verifies that it contains the specified entry.
index 52513f0..f514d83 100644 (file)
@@ -119,6 +119,25 @@ route_data_ipv4 = {
     }]
 }
 
+route_data_ipv4_oper = {
+    "bgp-inet:ipv4-route": [{
+        "route-key": route_address_ipv4,
+        "path-id": route_id_ipv4,
+        "prefix": route_address_ipv4,
+        "attributes": {
+            "origin": {
+                "value": "igp"
+            },
+            "local-pref": {
+                "pref": 100
+            },
+            "ipv4-next-hop": {
+                "global": "192.168.1.1"
+            }
+        }
+    }]
+}
+
 # IPv4 route for testing Update operation
 route_data_ipv4_update = {
     "bgp-inet:ipv4-route": [{
@@ -139,6 +158,24 @@ route_data_ipv4_update = {
         }
     }]
 }
+route_data_ipv4_update_oper = {
+    "bgp-inet:ipv4-route": [{
+        "route-key": route_address_ipv4,
+        "path-id": route_id_ipv4,
+        "prefix": route_address_ipv4,
+        "attributes": {
+            "origin": {
+                "value": "egp"
+            },
+            "local-pref": {
+                "pref": 200
+            },
+            "ipv4-next-hop": {
+                "global": "192.168.1.2"
+            }
+        }
+    }]
+}
 
 # IPv4 route for testing multiple routes
 route_address_ipv4_2 = "192.168.0.6/32"
@@ -163,6 +200,25 @@ route_data_ipv4_2 = {
     }]
 }
 
+route_data_ipv4_2_oper = {
+    "bgp-inet:ipv4-route": [{
+        "route-key": route_address_ipv4_2,
+        "path-id": route_id_ipv4_2,
+        "prefix": route_address_ipv4_2,
+        "attributes": {
+            "origin": {
+                "value": "igp"
+            },
+            "local-pref": {
+                "pref": 100
+            },
+            "ipv4-next-hop": {
+                "global": "192.168.1.2"
+            }
+        }
+    }]
+}
+
 # IPv6 route for CRUD test
 route_address_ipv6 = "3ffe:62::1/64"
 route_id_ipv6 = 0
@@ -285,6 +341,25 @@ dut1_route = {
     }]
 }
 
+dut1_route_oper = {
+    "bgp-inet:ipv4-route": [{
+        "route-key": dut1_route_address,
+        "path-id": dut1_route_id,
+        "prefix": dut1_route_address,
+        "attributes": {
+            "origin": {
+                "value": "igp"
+            },
+            "local-pref": {
+                "pref": 100
+            },
+            "ipv4-next-hop": {
+                "global": "192.168.1.3"
+            }
+        }
+    }]
+}
+
 # IPv4 route in peer operational data
 rib_operational = {
     "loc-rib": {"tables": [
@@ -292,7 +367,7 @@ rib_operational = {
             "afi": "bgp-types:ipv4-address-family",
             "safi": "bgp-types:unicast-subsequent-address-family",
             "bgp-inet:ipv4-routes": {
-                "ipv4-route": dut1_route["bgp-inet:ipv4-route"]
+                "ipv4-route": dut1_route_oper["bgp-inet:ipv4-route"]
             }
         }
     ]}
@@ -300,7 +375,6 @@ rib_operational = {
 
 route_operational = {
     "next-hop": {"next-hop-address": "192.168.1.3"},
-    "vpp-ipv4-unicast-routing:vpp-ipv4-route": {},
     "destination-prefix": dut1_route_address
 }
 
@@ -326,6 +400,24 @@ dut1_route_ip6 = {
         }
     }]
 }
+dut1_route_ip6_oper = {
+    "bgp-inet:ipv6-route": [{
+        "route-key": dut1_route_ip6_prefix,
+        "path-id": dut1_route_ip6_id,
+        "prefix": dut1_route_ip6_prefix,
+        "attributes": {
+            "origin": {
+                "value": "igp"
+            },
+            "local-pref": {
+                "pref": 100
+            },
+            "ipv6-next-hop": {
+                "global": "3ffe:63::1"
+            }
+        }
+    }]
+}
 
 # IPv6 route in peer operational data
 rib_ip6_operational = {
@@ -334,7 +426,7 @@ rib_ip6_operational = {
             "afi": "bgp-types:ipv6-address-family",
             "safi": "bgp-types:unicast-subsequent-address-family",
             "bgp-inet:ipv6-routes": {
-                "ipv6-route": dut1_route_ip6["bgp-inet:ipv6-route"]
+                "ipv6-route": dut1_route_ip6_oper["bgp-inet:ipv6-route"]
             }
         }
     ]}
@@ -342,6 +434,5 @@ rib_ip6_operational = {
 
 route_ip6_operational = {
     "next-hop": {"next-hop-address": "3ffe:63::1"},
-    "vpp-ipv6-unicast-routing:vpp-ipv6-route": {},
     "destination-prefix": dut1_route_ip6_prefix
 }
index 25fefe9..2016ca5 100644 (file)
@@ -67,7 +67,7 @@ def get_variables(node, ip_version, out_interface):
             "destination-prefix":
                 "{0}/{1}".format(ipv4_base["dst_net"], ipv4_base["prefix_len"]),
             "next-hop": {
-                "next-hop-address" : ipv4_base["next_hop"],
+                "next-hop-address": ipv4_base["next_hop"],
                 "outgoing-interface": out_interface
             },
             "vpp-ipv4-unicast-routing:vpp-ipv4-route": {}
@@ -151,16 +151,15 @@ def get_variables(node, ip_version, out_interface):
         "table1_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv4_base["dst_net"], ipv4_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "next-hop-address": ipv4_base["next_hop"],
                 "outgoing-interface": out_interface
-            },
-            "vpp-ipv4-unicast-routing:vpp-ipv4-route": {}
+            }
         },
         "table2_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv4_base["dst_net"], ipv4_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "next-hop-list": {
                     "next-hop": [
                         {
@@ -177,32 +176,29 @@ def get_variables(node, ip_version, out_interface):
                         }
                     ]
                 }
-            },
-            "vpp-ipv4-unicast-routing:vpp-ipv4-route": {}
+            }
         },
         "table3_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv4_base["dst_net"], ipv4_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "special-next-hop-enum": "blackhole"
-            },
-            "vpp-ipv4-unicast-routing:vpp-ipv4-route": {}
+            }
         },
         "table4_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv6_base["dst_net"],
                                  ipv6_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "next-hop-address": ipv6_base["next_hop"],
                 "outgoing-interface": out_interface
-            },
-            "vpp-ipv6-unicast-routing:vpp-ipv6-route": {}
+            }
         },
         "table5_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv6_base["dst_net"],
                                  ipv6_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "next-hop-list": {
                     "next-hop": [
                         {
@@ -219,17 +215,15 @@ def get_variables(node, ip_version, out_interface):
                         }
                     ]
                 }
-            },
-            "vpp-ipv6-unicast-routing:vpp-ipv6-route": {}
+            }
         },
         "table6_oper": {
             "destination-prefix":
                 "{0}/{1}".format(ipv6_base["dst_net"],
                                  ipv6_base["prefix_len"]),
-            "next-hop":{
+            "next-hop": {
                 "special-next-hop-enum": "blackhole"
-            },
-            "vpp-ipv6-unicast-routing:vpp-ipv6-route": {}
+            }
         }
     }
 
index d418201..8cf7a7c 100644 (file)
 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 | | Then BGP Route from Honeycomb should be
-| | ... | ${node} | ${address_internal} | ${route_data_ipv4}
+| | ... | ${node} | ${address_internal} | ${route_data_ipv4_oper}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 
 | TC07: Honeycomb removes IPv4 route configuration
 | | Given BGP peer from Honeycomb should be
 | | ... | ${node} | ${address_internal} | ${peer_internal}
 | | And BGP Route from Honeycomb should be
-| | ... | ${node} | ${address_internal} | ${route_data_ipv4}
+| | ... | ${node} | ${address_internal} | ${route_data_ipv4_oper}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 | | When Honeycomb removes BGP route | ${node} | ${address_internal}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
-| | Then No BGP Routes Should be Configured
+| | Then No BGP Routes Should exist
 | | ... | ${node} | ${address_internal} | ipv4
 
 | TC08: Honeycomb updates existing IPv4 route using BGP
 | | ...
 | | Given BGP peer from Honeycomb should be
 | | ... | ${node} | ${address_internal} | ${peer_internal}
-| | And No BGP Routes Should be Configured
+| | And No BGP Routes Should exist
 | | ... | ${node} | ${address_internal} | ipv4
 | | When Honeycomb configures BGP route
 | | ... | ${node} | ${address_internal} | ${route_data_ipv4}
 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_update}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 | | Then BGP Route from Honeycomb should be
-| | ... | ${node} | ${address_internal} | ${route_data_ipv4_update}
+| | ... | ${node} | ${address_internal} | ${route_data_ipv4_update_oper}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 
 | TC09: Honeycomb configures a second IPv4 route
 | | ... | ${node} | ${address_internal} | ${route_data_ipv4_2}
 | | ... | ${route_address_ipv4_2} | ${route_id_ipv4_2} | ipv4
 | | Then BGP Route from Honeycomb should be
-| | ... | ${node} | ${address_internal} | ${route_data_ipv4}
+| | ... | ${node} | ${address_internal} | ${route_data_ipv4_oper}
 | | ... | ${route_address_ipv4} | ${route_id_ipv4} | ipv4
 | | And BGP Route from Honeycomb should be
-| | ... | ${node} | ${address_internal} | ${route_data_ipv4_2}
+| | ... | ${node} | ${address_internal} | ${route_data_ipv4_2_oper}
 | | ... | ${route_address_ipv4_2} | ${route_id_ipv4_2} | ipv4
 
 | TC10: Honeycomb sends BGP OPEN messages to configured peer