make test: Use VXLAN built in scapy 2.3.3
[vpp.git] / test / test_vxlan.py
index ac43585..1978cf0 100644 (file)
@@ -6,7 +6,7 @@ from template_bd import BridgeDomain
 
 from scapy.layers.l2 import Ether
 from scapy.layers.inet import IP, UDP
-from scapy_handlers.vxlan import VXLAN
+from scapy.layers.vxlan import VXLAN
 
 
 class TestVxlan(BridgeDomain, VppTestCase):
@@ -24,13 +24,15 @@ class TestVxlan(BridgeDomain, VppTestCase):
         return (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) /
                 IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4) /
                 UDP(sport=self.dport, dport=self.dport, chksum=0) /
-                VXLAN(vni=self.vni) /
+                VXLAN(vni=self.vni, flags=self.flags) /
                 pkt)
 
     def decapsulate(self, pkt):
         """
         Decapsulate the original payload frame by removing VXLAN header
         """
+        # check if is set I flag
+        self.assertEqual(pkt[VXLAN].flags, int('0x8', 16))
         return pkt[VXLAN].payload
 
     # Method for checking VXLAN encapsulation.
@@ -62,6 +64,7 @@ class TestVxlan(BridgeDomain, VppTestCase):
 
         try:
             cls.dport = 4789
+            cls.flags = 0x8
             cls.vni = 1
 
             # Create 2 pg interfaces.
@@ -95,5 +98,6 @@ class TestVxlan(BridgeDomain, VppTestCase):
         if not self.vpp_dead:
             self.logger.info(self.vapi.cli("show bridge-domain 1 detail"))
 
+
 if __name__ == '__main__':
     unittest.main(testRunner=VppTestRunner)