tests docs: upgrade python packages
[vpp.git] / test / test_ip6_vrf_multi_instance.py
old mode 100644 (file)
new mode 100755 (executable)
index 49e5cab..c2964b6
@@ -1,11 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """IP6 VRF Multi-instance Test Case HLD:
 
 **NOTES:**
     - higher number of pg-ip6 interfaces causes problems => only 15 pg-ip6 \
-    interfaces in 5 VRFs are tested
+      interfaces in 5 VRFs are tested
     - jumbo packets in configuration with 15 pg-ip6 interfaces leads to \
-    problems too
+      problems too
 
 **config 1**
     - add 15 pg-ip6 interfaces
@@ -18,8 +18,8 @@
 
 **verify 1**
     - check VRF data by parsing output of ip_route_dump API command
-    - all packets received correctly in case of pg-ip6 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip6 interfaces in the
+      same VRF
     - no packet received in case of pg-ip6 interfaces not in VRF
     - no packet received in case of pg-ip6 interfaces in different VRFs
 
@@ -31,8 +31,8 @@
 
 **verify 2**
     - check VRF data by parsing output of ip_route_dump API command
-    - all packets received correctly in case of pg-ip6 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip6 interfaces in the
+      same VRF
     - no packet received in case of pg-ip6 interfaces not in VRF
     - no packet received in case of pg-ip6 interfaces in different VRFs
 
@@ -44,8 +44,8 @@
 
 **verify 3**
     - check VRF data by parsing output of ip_route_dump API command
-    - all packets received correctly in case of pg-ip6 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip6 interfaces in the
+      same VRF
     - no packet received in case of pg-ip6 interfaces not in VRF
     - no packet received in case of pg-ip6 interfaces in different VRFs
 
@@ -57,8 +57,8 @@
 
 **verify 4**
     - check VRF data by parsing output of ip_route_dump API command
-    - all packets received correctly in case of pg-ip6 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip6 interfaces in the
+      same VRF
     - no packet received in case of pg-ip6 interfaces not in VRF
     - no packet received in case of pg-ip6 interfaces in different VRFs
 """
@@ -193,9 +193,8 @@ class TestIP6VrfMultiInst(VppTestCase):
         for i in range(count):
             vrf_id = i + start
             pg_if = self.pg_if_by_vrf_id[vrf_id][0]
-            dest_addr = pg_if.local_ip6n
-            dest_addr_len = 64
-            self.vapi.ip_table_add_del(is_ipv6=1, is_add=1, table_id=vrf_id)
+            self.vapi.ip_table_add_del(is_add=1,
+                                       table={'table_id': vrf_id, 'is_ip6': 1})
             self.logger.info("IPv6 VRF ID %d created" % vrf_id)
             if vrf_id not in self.vrf_list:
                 self.vrf_list.append(vrf_id)
@@ -222,8 +221,7 @@ class TestIP6VrfMultiInst(VppTestCase):
 
         :param int vrf_id: The FIB table / VRF ID to be reset.
         """
-        # self.vapi.reset_vrf(vrf_id, is_ipv6=1)
-        self.vapi.reset_fib(vrf_id, is_ipv6=1)
+        self.vapi.ip_table_flush(table={'table_id': vrf_id, 'is_ip6': 1})
         if vrf_id in self.vrf_list:
             self.vrf_list.remove(vrf_id)
         if vrf_id not in self.vrf_reset_list:
@@ -238,7 +236,8 @@ class TestIP6VrfMultiInst(VppTestCase):
         self.logger.info("IPv6 VRF ID %d reset finished" % vrf_id)
         self.logger.debug(self.vapi.ppcli("show ip6 fib"))
         self.logger.debug(self.vapi.ppcli("show ip6 neighbors"))
-        self.vapi.ip_table_add_del(is_ipv6=1, is_add=0, table_id=vrf_id)
+        self.vapi.ip_table_add_del(is_add=0,
+                                   table={'table_id': vrf_id, 'is_ip6': 1})
 
     def create_stream(self, src_if, packet_sizes):
         """
@@ -411,9 +410,10 @@ class TestIP6VrfMultiInst(VppTestCase):
     def run_crosswise_vrf_test(self):
         """
         Create packet streams for every pg-ip6 interface in VRF towards all
-        pg-ip6 interfaces in other VRFs, send all prepared packet streams and \
+        pg-ip6 interfaces in other VRFs, send all prepared packet streams and
         verify that:
-             - no packet received on all configured pg-ip6 interfaces
+
+        - no packet received on all configured pg-ip6 interfaces
 
         :raise RuntimeError: If any packet is captured on any pg-ip6 interface.
         """