IP-local: any IP can appear as the source (VPP-1522)
[vpp.git] / test / test_ip4.py
index c18ce4c..5409044 100644 (file)
@@ -1213,7 +1213,7 @@ class TestIPPunt(VppTestCase):
         for p in punts:
             self.assertEqual(p.punt.tx_sw_if_index, self.pg3.sw_if_index)
         self.assertNotEqual(punts[1].punt.nh.un.ip4, self.pg3.remote_ip4)
-        self.assertEqual(punts[2].punt.nh.un.ip4.address, '\x00'*4)
+        self.assertEqual(punts[2].punt.nh.un.ip4, '\x00'*4)
 
 
 class TestIPDeag(VppTestCase):
@@ -1470,6 +1470,25 @@ class TestIPInput(VppTestCase):
         # Reset MTU for subsequent tests
         self.vapi.sw_interface_set_mtu(self.pg1.sw_if_index, [9000, 0, 0, 0])
 
+        #
+        # source address 0.0.0.0 and 25.255.255.255 and for-us
+        #
+        p_s0 = (Ether(src=self.pg0.remote_mac,
+                      dst=self.pg0.local_mac) /
+                IP(src="0.0.0.0",
+                   dst=self.pg0.local_ip4) /
+                ICMP(id=4, seq=4) /
+                Raw(load='\x0a' * 18))
+        rx = self.send_and_assert_no_replies(self.pg0, p_s0 * 17)
+
+        p_s0 = (Ether(src=self.pg0.remote_mac,
+                      dst=self.pg0.local_mac) /
+                IP(src="255.255.255.255",
+                   dst=self.pg0.local_ip4) /
+                ICMP(id=4, seq=4) /
+                Raw(load='\x0a' * 18))
+        rx = self.send_and_assert_no_replies(self.pg0, p_s0 * 17)
+
 
 class TestIPDirectedBroadcast(VppTestCase):
     """ IPv4 Directed Broadcast """