VPP-1283: IPv6 PMTU missing MTU value in ICMP6 message.
[vpp.git] / test / test_gre.py
index 5cdc063..2559381 100644 (file)
@@ -18,6 +18,12 @@ from scapy.volatile import RandMAC, RandIP
 from util import ppp, ppc
 
 
+class GreTunnelTypes:
+    TT_L3 = 0
+    TT_TEB = 1
+    TT_ERSPAN = 2
+
+
 class TestGRE(VppTestCase):
     """ GRE Test Case """
 
@@ -673,6 +679,25 @@ class TestGRE(VppTestCase):
         rx = self.pg0.get_capture(len(tx))
         self.verify_decapped_4o4(self.pg0, rx, tx)
 
+        #
+        # Send tunneled packets that match the created tunnel and
+        # but arrive on an interface that is not in the tunnel's
+        # encap VRF, these are dropped
+        #
+        self.vapi.cli("clear trace")
+        tx = self.create_tunnel_stream_4o4(self.pg2,
+                                           "2.2.2.2",
+                                           self.pg1.local_ip4,
+                                           self.pg0.local_ip4,
+                                           self.pg0.remote_ip4)
+        self.pg1.add_stream(tx)
+
+        self.pg_enable_capture(self.pg_interfaces)
+        self.pg_start()
+
+        self.pg0.assert_nothing_captured(
+            remark="GRE decap packets in wrong VRF")
+
         #
         # test case cleanup
         #
@@ -701,10 +726,10 @@ class TestGRE(VppTestCase):
         #
         gre_if1 = VppGreInterface(self, self.pg0.local_ip4,
                                   "2.2.2.2",
-                                  is_teb=1)
+                                  type=GreTunnelTypes.TT_TEB)
         gre_if2 = VppGreInterface(self, self.pg0.local_ip4,
                                   "2.2.2.3",
-                                  is_teb=1)
+                                  type=GreTunnelTypes.TT_TEB)
         gre_if1.add_vpp_config()
         gre_if2.add_vpp_config()