tests docs: upgrade python packages
[vpp.git] / test / test_ip4_vrf_multi_instance.py
old mode 100644 (file)
new mode 100755 (executable)
index f1ad670..c0e2ff3
@@ -3,9 +3,9 @@
 
 **NOTES:**
     - higher number of pg-ip4 interfaces causes problems => only 15 pg-ip4 \
-    interfaces in 5 VRFs are tested
+      interfaces in 5 VRFs are tested
     - jumbo packets in configuration with 15 pg-ip4 interfaces leads to \
-    problems too
+      problems too
 
 **config 1**
     - add 15 pg-ip4 interfaces
@@ -18,8 +18,8 @@
 
 **verify 1**
     - check VRF data by parsing output of ip_fib_dump API command
-    - all packets received correctly in case of pg-ip4 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip4 interfaces in the
+      same VRF
     - no packet received in case of pg-ip4 interfaces not in VRF
     - no packet received in case of pg-ip4 interfaces in different VRFs
 
@@ -30,8 +30,8 @@
     - send IP4 packets between all pg-ip4 interfaces in all VRF groups
 
 **verify 2**
-    - all packets received correctly in case of pg-ip4 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip4 interfaces in the
+      same VRF
     - no packet received in case of pg-ip4 interfaces not in VRF
     - no packet received in case of pg-ip4 interfaces in different VRFs
 
@@ -43,8 +43,8 @@
 
 **verify 3**
     - check VRF data by parsing output of ip_fib_dump API command
-    - all packets received correctly in case of pg-ip4 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip4 interfaces in the
+      same VRF
     - no packet received in case of pg-ip4 interfaces not in VRF
     - no packet received in case of pg-ip4 interfaces in different VRFs
 
@@ -56,8 +56,8 @@
 
 **verify 4**
     - check VRF data by parsing output of ip_fib_dump API command
-    - all packets received correctly in case of pg-ip4 interfaces in the same
-    VRF
+    - all packets received correctly in case of pg-ip4 interfaces in the
+      same VRF
     - no packet received in case of pg-ip4 interfaces not in VRF
     - no packet received in case of pg-ip4 interfaces in different VRFs
 """
@@ -68,8 +68,8 @@ import socket
 
 import scapy.compat
 from scapy.packet import Raw
-from scapy.layers.l2 import Ether
-from scapy.layers.inet import IP, UDP, ARP
+from scapy.layers.l2 import Ether, ARP
+from scapy.layers.inet import IP, UDP
 
 from framework import VppTestCase, VppTestRunner
 from util import ppp
@@ -167,7 +167,7 @@ class TestIp4VrfMultiInst(VppTestCase):
 
     def show_commands_at_teardown(self):
         self.logger.info(self.vapi.ppcli("show ip fib"))
-        self.logger.info(self.vapi.ppcli("show ip arp"))
+        self.logger.info(self.vapi.ppcli("show ip4 neighbors"))
 
     def create_vrf_and_assign_interfaces(self, count, start=1):
         """
@@ -182,9 +182,7 @@ class TestIp4VrfMultiInst(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_ip4n
-            dest_addr_len = 24
-            self.vapi.ip_table_add_del(is_add=1, table_id=vrf_id)
+            self.vapi.ip_table_add_del(is_add=1, table={'table_id': vrf_id})
             self.logger.info("IPv4 VRF ID %d created" % vrf_id)
             if vrf_id not in self.vrf_list:
                 self.vrf_list.append(vrf_id)
@@ -202,7 +200,7 @@ class TestIp4VrfMultiInst(VppTestCase):
                 pg_if.config_ip4()
                 pg_if.configure_ipv4_neighbors()
         self.logger.debug(self.vapi.ppcli("show ip fib"))
-        self.logger.debug(self.vapi.ppcli("show ip arp"))
+        self.logger.debug(self.vapi.ppcli("show ip4 neighbors"))
 
     def reset_vrf_and_remove_from_vrf_list(self, vrf_id):
         """
@@ -210,8 +208,7 @@ class TestIp4VrfMultiInst(VppTestCase):
 
         :param int vrf_id: The FIB table / VRF ID to be reset.
         """
-        # self.vapi.reset_vrf(vrf_id, is_ipv6=0)
-        self.vapi.reset_fib(vrf_id, is_ipv6=0)
+        self.vapi.ip_table_flush(table={'table_id': vrf_id})
         if vrf_id in self.vrf_list:
             self.vrf_list.remove(vrf_id)
         if vrf_id not in self.vrf_reset_list:
@@ -225,8 +222,8 @@ class TestIp4VrfMultiInst(VppTestCase):
                 self.pg_not_in_vrf.append(pg_if)
         self.logger.info("IPv4 VRF ID %d reset finished" % vrf_id)
         self.logger.debug(self.vapi.ppcli("show ip fib"))
-        self.logger.debug(self.vapi.ppcli("show ip arp"))
-        self.vapi.ip_table_add_del(is_add=0, table_id=vrf_id)
+        self.logger.debug(self.vapi.ppcli("show ip neighbors"))
+        self.vapi.ip_table_add_del(is_add=0, table={'table_id': vrf_id})
 
     def create_stream(self, src_if, packet_sizes):
         """
@@ -399,9 +396,10 @@ class TestIp4VrfMultiInst(VppTestCase):
     def run_crosswise_vrf_test(self):
         """
         Create packet streams for every pg-ip4 interface in VRF towards all
-        pg-ip4 interfaces in other VRFs, send all prepared packet streams and \
+        pg-ip4 interfaces in other VRFs, send all prepared packet streams and
         verify that:
-             - no packet received on all configured pg-ip4 interfaces
+
+        - no packet received on all configured pg-ip4 interfaces
 
         :raise RuntimeError: If any packet is captured on any pg-ip4 interface.
         """