X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ip6.py;h=6c959a2712cb54f2d0630ea5a27e8761eeefe32d;hb=b31c0ce2194ddb198320e91f42973e35a1ab4619;hp=6cfb04be14266748080e684a08f7fcae2ed7d55e;hpb=a5b2eec0535f9025319a752891d77ff9948ae0df;p=vpp.git diff --git a/test/test_ip6.py b/test/test_ip6.py index 6cfb04be142..6c959a2712c 100644 --- a/test/test_ip6.py +++ b/test/test_ip6.py @@ -161,6 +161,10 @@ class TestIPv6(TestIPv6ND): def setUpClass(cls): super(TestIPv6, cls).setUpClass() + @classmethod + def tearDownClass(cls): + super(TestIPv6, cls).tearDownClass() + def setUp(self): """ Perform test setup before test case. @@ -563,7 +567,7 @@ class TestIPv6(TestIPv6ND): # # remove the duplicate on pg1 - # packet stream shoud generate NSs out of pg1 + # packet stream should generate NSs out of pg1 # ns_pg1.remove_vpp_config() @@ -626,7 +630,7 @@ class TestIPv6(TestIPv6ND): # decipher how to decode. this 1st layer of option always returns # nested classes, so a direct obj1=obj2 comparison always fails. # however, the getlayer(.., 2) does give one instnace. - # so we cheat here and construct a new opt instnace for comparison + # so we cheat here and construct a new opt instance for comparison rd = ICMPv6NDOptPrefixInfo( prefixlen=raos.prefixlen, prefix=raos.prefix, @@ -685,7 +689,8 @@ class TestIPv6(TestIPv6ND): self.send_and_assert_no_replies(self.pg0, pkts, "RA rate limited") # - # When we reconfiure the IPv6 RA config, we reset the RA rate limiting, + # When we reconfigure the IPv6 RA config, + # we reset the RA rate limiting, # so we need to do this before each test below so as not to drop # packets for rate limiting reasons. Test this works here. # @@ -856,7 +861,7 @@ class TestIPv6(TestIPv6ND): opt=opt) # - # Use the reset to defults option to revert to defaults + # Use the reset to defaults option to revert to defaults # L and A flag are clear in the advert # self.pg0.ip6_ra_prefix(self.pg0.local_ip6, @@ -905,7 +910,7 @@ class TestIPv6(TestIPv6ND): opt=opt) # - # Remove the first refix-info - expect the second is still in the + # Remove the first prefix-info - expect the second is still in the # advert # self.pg0.ip6_ra_prefix(self.pg0.local_ip6, @@ -925,7 +930,7 @@ class TestIPv6(TestIPv6ND): opt=opt) # - # Remove the second prefix-info - expect no prefix-info i nthe adverts + # Remove the second prefix-info - expect no prefix-info in the adverts # self.pg0.ip6_ra_prefix(self.pg1.local_ip6, self.pg1.local_ip6_prefix_len, @@ -945,6 +950,14 @@ class TestIPv6(TestIPv6ND): class TestICMPv6Echo(VppTestCase): """ ICMPv6 Echo Test Case """ + @classmethod + def setUpClass(cls): + super(TestICMPv6Echo, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestICMPv6Echo, cls).tearDownClass() + def setUp(self): super(TestICMPv6Echo, self).setUp() @@ -1014,6 +1027,10 @@ class TestIPv6RD(TestIPv6ND): def setUpClass(cls): super(TestIPv6RD, cls).setUpClass() + @classmethod + def tearDownClass(cls): + super(TestIPv6RD, cls).tearDownClass() + def setUp(self): super(TestIPv6RD, self).setUp() @@ -1131,6 +1148,10 @@ class TestIPv6RDControlPlane(TestIPv6ND): def setUpClass(cls): super(TestIPv6RDControlPlane, cls).setUpClass() + @classmethod + def tearDownClass(cls): + super(TestIPv6RDControlPlane, cls).tearDownClass() + def setUp(self): super(TestIPv6RDControlPlane, self).setUp() @@ -1166,10 +1187,10 @@ class TestIPv6RDControlPlane(TestIPv6ND): if entry.address_length == 0: for path in entry.path: if path.sw_if_index != 0xFFFFFFFF: - defaut_route = {} - defaut_route['sw_if_index'] = path.sw_if_index - defaut_route['next_hop'] = path.next_hop - list.append(defaut_route) + default_route = {} + default_route['sw_if_index'] = path.sw_if_index + default_route['next_hop'] = path.next_hop + list.append(default_route) return list @staticmethod @@ -1303,6 +1324,14 @@ class TestIPv6RDControlPlane(TestIPv6ND): class IPv6NDProxyTest(TestIPv6ND): """ IPv6 ND ProxyTest Case """ + @classmethod + def setUpClass(cls): + super(IPv6NDProxyTest, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(IPv6NDProxyTest, cls).tearDownClass() + def setUp(self): super(IPv6NDProxyTest, self).setUp() @@ -1492,6 +1521,14 @@ class IPv6NDProxyTest(TestIPv6ND): class TestIPNull(VppTestCase): """ IPv6 routes via NULL """ + @classmethod + def setUpClass(cls): + super(TestIPNull, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIPNull, cls).tearDownClass() + def setUp(self): super(TestIPNull, self).setUp() @@ -1560,13 +1597,21 @@ class TestIPNull(VppTestCase): class TestIPDisabled(VppTestCase): """ IPv6 disabled """ + @classmethod + def setUpClass(cls): + super(TestIPDisabled, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIPDisabled, cls).tearDownClass() + def setUp(self): super(TestIPDisabled, self).setUp() # create 2 pg interfaces self.create_pg_interfaces(range(2)) - # PG0 is IP enalbed + # PG0 is IP enabled self.pg0.admin_up() self.pg0.config_ip6() self.pg0.resolve_ndp() @@ -1649,6 +1694,14 @@ class TestIPDisabled(VppTestCase): class TestIP6LoadBalance(VppTestCase): """ IPv6 Load-Balancing """ + @classmethod + def setUpClass(cls): + super(TestIP6LoadBalance, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIP6LoadBalance, cls).tearDownClass() + def setUp(self): super(TestIP6LoadBalance, self).setUp() @@ -1743,7 +1796,7 @@ class TestIP6LoadBalance(VppTestCase): src_ip_hdr)) # - # A route for the IP pacekts + # A route for the IP packets # route_3000_1 = VppIpRoute(self, "3000::1", 128, [VppRoutePath(self.pg1.remote_ip6, @@ -1781,7 +1834,7 @@ class TestIP6LoadBalance(VppTestCase): # src,dst # We are not going to ensure equal amounts of packets across each link, # since the hash algorithm is statistical and therefore this can never - # be guaranteed. But wuth 64 different packets we do expect some + # be guaranteed. But with 64 different packets we do expect some # balancing. So instead just ensure there is traffic on each link. # self.send_and_expect_load_balancing(self.pg0, port_ip_pkts, @@ -1797,7 +1850,7 @@ class TestIP6LoadBalance(VppTestCase): # # The packets with Entropy label in should not load-balance, - # since the Entorpy value is fixed. + # since the Entropy value is fixed. # self.send_and_expect_one_itf(self.pg0, port_ent_pkts, self.pg1) @@ -1914,6 +1967,14 @@ class TestIP6LoadBalance(VppTestCase): class TestIP6Punt(VppTestCase): """ IPv6 Punt Police/Redirect """ + @classmethod + def setUpClass(cls): + super(TestIP6Punt, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIP6Punt, cls).tearDownClass() + def setUp(self): super(TestIP6Punt, self).setUp() @@ -1965,7 +2026,7 @@ class TestIP6Punt(VppTestCase): self.pg_start() # - # the number of packet recieved should be greater than 0, + # the number of packet received should be greater than 0, # but not equal to the number sent, since some were policed # rx = self.pg1._get_capture(1) @@ -2042,6 +2103,14 @@ class TestIP6Punt(VppTestCase): class TestIPDeag(VppTestCase): """ IPv6 Deaggregate Routes """ + @classmethod + def setUpClass(cls): + super(TestIPDeag, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIPDeag, cls).tearDownClass() + def setUp(self): super(TestIPDeag, self).setUp() @@ -2161,6 +2230,14 @@ class TestIPDeag(VppTestCase): class TestIP6Input(VppTestCase): """ IPv6 Input Exception Test Cases """ + @classmethod + def setUpClass(cls): + super(TestIP6Input, cls).setUpClass() + + @classmethod + def tearDownClass(cls): + super(TestIP6Input, cls).tearDownClass() + def setUp(self): super(TestIP6Input, self).setUp()