X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ip4_vrf_multi_instance.py;h=5a8d676058659675937df93eb7a821b704026f72;hb=2aa22909c70ff5c5eed6a7f7a0f8a587c9260da8;hp=1449ef7d5faa644efd1d54c430dde0853295d2cc;hpb=e546d3b0f739d35ec2e4702181d99ff4190e8b46;p=vpp.git diff --git a/test/test_ip4_vrf_multi_instance.py b/test/test_ip4_vrf_multi_instance.py index 1449ef7d5fa..5a8d6760586 100644 --- a/test/test_ip4_vrf_multi_instance.py +++ b/test/test_ip4_vrf_multi_instance.py @@ -95,7 +95,8 @@ class TestIp4VrfMultiInst(VppTestCase): try: # Create pg interfaces - cls.create_pg_interfaces(range(cls.nr_of_vrfs * cls.pg_ifs_per_vrf)) + cls.create_pg_interfaces( + range(cls.nr_of_vrfs * cls.pg_ifs_per_vrf)) # Packet flows mapping pg0 -> pg1, pg2 etc. cls.flows = dict() @@ -141,7 +142,7 @@ class TestIp4VrfMultiInst(VppTestCase): raise def setUp(self): - """ip_add_del_route + """ Clear trace and packet infos before running each test. """ super(TestIp4VrfMultiInst, self).setUp() @@ -157,7 +158,7 @@ class TestIp4VrfMultiInst(VppTestCase): self.logger.info(self.vapi.ppcli("show ip arp")) def create_vrf_and_assign_interfaces(self, count, start=1): - """" + """ Create required number of FIB tables / VRFs, put 3 l2-pg interfaces to every FIB table / VRF. @@ -171,9 +172,10 @@ class TestIp4VrfMultiInst(VppTestCase): pg_if = self.pg_if_by_vrf_id[vrf_id][0] dest_addr = pg_if.remote_hosts[0].ip4n dest_addr_len = 24 + self.vapi.ip_table_add_del(vrf_id, is_add=1) self.vapi.ip_add_del_route( dest_addr, dest_addr_len, pg_if.local_ip4n, - table_id=vrf_id, create_vrf_if_needed=1, is_multipath=1) + table_id=vrf_id, is_multipath=1) self.logger.info("IPv4 VRF ID %d created" % vrf_id) if vrf_id not in self.vrf_list: self.vrf_list.append(vrf_id) @@ -189,12 +191,12 @@ class TestIp4VrfMultiInst(VppTestCase): if pg_if in self.pg_not_in_vrf: self.pg_not_in_vrf.remove(pg_if) pg_if.config_ip4() - pg_if.configure_ipv4_neighbors(vrf_id) + pg_if.configure_ipv4_neighbors() self.logger.debug(self.vapi.ppcli("show ip fib")) self.logger.debug(self.vapi.ppcli("show ip arp")) def delete_vrf(self, vrf_id): - """" + """ Delete required FIB table / VRF. :param int vrf_id: The FIB table / VRF ID to be deleted. @@ -207,6 +209,7 @@ class TestIp4VrfMultiInst(VppTestCase): self.vrf_deleted_list.append(vrf_id) for j in range(self.pg_ifs_per_vrf): pg_if = self.pg_if_by_vrf_id[vrf_id][j] + pg_if.unconfig_ip4() if pg_if in self.pg_in_vrf: self.pg_in_vrf.remove(pg_if) if pg_if not in self.pg_not_in_vrf: @@ -214,6 +217,7 @@ class TestIp4VrfMultiInst(VppTestCase): self.logger.info("IPv4 VRF ID %d reset" % 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(vrf_id, is_add=0) def create_stream(self, src_if, packet_sizes): """ @@ -306,16 +310,16 @@ class TestIp4VrfMultiInst(VppTestCase): def run_verify_test(self): """ - Create packet streams for all configured l2-pg interfaces, send all + Create packet streams for all configured l2-pg interfaces, send all \ prepared packet streams and verify that: - - all packets received correctly on all pg-l2 interfaces assigned to - bridge domains + - all packets received correctly on all pg-l2 interfaces assigned + to bridge domains - no packet received on all pg-l2 interfaces not assigned to bridge - domains + domains :raise RuntimeError: If no packet captured on l2-pg interface assigned - to the bridge domain or if any packet is captured on l2-pg interface - not assigned to the bridge domain. + to the bridge domain or if any packet is captured on l2-pg + interface not assigned to the bridge domain. """ # Test # Create incoming packet streams for packet-generator interfaces