X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftest_ip4.py;h=02a31be830a44c2bbf6f291657487484c13da77c;hb=61f702bdd09e569bf9b3ef05d2040de5540fb8db;hp=e501bff3fecb63dd71c84dd0acb867b7c09bca40;hpb=1855b8e48d95289cc9f0a6e339f2148d64ac705c;p=vpp.git diff --git a/test/test_ip4.py b/test/test_ip4.py index e501bff3fec..02a31be830a 100644 --- a/test/test_ip4.py +++ b/test/test_ip4.py @@ -552,7 +552,7 @@ class TestIPNull(VppTestCase): super(TestIPNull, self).setUp() # create 2 pg interfaces - self.create_pg_interfaces(range(1)) + self.create_pg_interfaces(range(2)) for i in self.pg_interfaces: i.admin_up() @@ -624,6 +624,32 @@ class TestIPNull(VppTestCase): self.assertEqual(icmp.src, self.pg0.remote_ip4) self.assertEqual(icmp.dst, "10.0.0.2") + def test_ip_drop(self): + """ IP Drop Routes """ + + p = (Ether(src=self.pg0.remote_mac, + dst=self.pg0.local_mac) / + IP(src=self.pg0.remote_ip4, dst="1.1.1.1") / + UDP(sport=1234, dport=1234) / + Raw('\xa5' * 100)) + + r1 = VppIpRoute(self, "1.1.1.0", 24, + [VppRoutePath(self.pg1.remote_ip4, + self.pg1.sw_if_index)]) + r1.add_vpp_config() + + rx = self.send_and_expect(self.pg0, p * 65, self.pg1) + + # + # insert a more specific as a drop + # + r2 = VppIpRoute(self, "1.1.1.1", 32, [], is_drop=1) + r2.add_vpp_config() + + self.send_and_assert_no_replies(self.pg0, p * 65, "Drop Route") + r2.remove_vpp_config() + rx = self.send_and_expect(self.pg0, p * 65, self.pg1) + class TestIPDisabled(VppTestCase): """ IPv4 disabled """ @@ -1246,6 +1272,24 @@ class TestIPDeag(VppTestCase): route_in_src.add_vpp_config() self.send_and_expect(self.pg0, pkts_src, self.pg2) + # + # loop in the lookup DP + # + route_loop = VppIpRoute(self, "2.2.2.3", 32, + [VppRoutePath("0.0.0.0", + 0xffffffff, + nh_table_id=0)]) + route_loop.add_vpp_config() + + p_l = (Ether(src=self.pg0.remote_mac, + dst=self.pg0.local_mac) / + IP(src="2.2.2.4", dst="2.2.2.3") / + TCP(sport=1234, dport=1234) / + Raw('\xa5' * 100)) + + self.send_and_assert_no_replies(self.pg0, p_l * 257, + "IP lookup loop") + class TestIPInput(VppTestCase): """ IPv4 Input Exceptions """