From deb698447172d8cae94df9871bb32a9d21705dbb Mon Sep 17 00:00:00 2001 From: Matej Klotton Date: Fri, 9 Dec 2016 15:05:46 +0100 Subject: make test: Use VXLAN built in scapy 2.3.3 - fix documentation issues. - fix mpls test. Change-Id: Ieef6b4b5e4aca99e89bd03e45a991be89d42adba Signed-off-by: Matej Klotton --- test/test_vxlan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test/test_vxlan.py') diff --git a/test/test_vxlan.py b/test/test_vxlan.py index ac435852b46..1978cf0c018 100644 --- a/test/test_vxlan.py +++ b/test/test_vxlan.py @@ -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) -- cgit 1.2.3-korg