[dts] [PATCH 1/2] vxlan: fix vlan load pcap error

Lijuan Tu lijuanx.a.tu at intel.com
Fri Sep 2 04:56:16 CEST 2016


vxlan is not supported by scapy,
and thus the packets are interpreted as raw packets.

Signed-off-by: Lijuan Tu <lijuanx.a.tu at intel.com>
---
 tests/TestSuite_vxlan.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/TestSuite_vxlan.py b/tests/TestSuite_vxlan.py
index c1d0200..d5274fc 100644
--- a/tests/TestSuite_vxlan.py
+++ b/tests/TestSuite_vxlan.py
@@ -24,7 +24,7 @@ from scapy.config import conf
 from scapy.route import *
 
 from test_case import TestCase
-from settings import HEADER_SIZE
+from settings import HEADER_SIZE, FOLDERS
 from etgen import IxiaPacketGenerator
 
 #
@@ -236,6 +236,11 @@ class VxlanTestConfig(object):
         """
         Send vxlan pcap file by iface
         """
+        # load vxlan module to scapy
+        cwd = os.getcwd()
+        dir_vxlan_module = cwd + r'/' + FOLDERS['Depends']
+        self.test_case.tester.scapy_append("sys.path.append('%s')" % dir_vxlan_module)
+        self.test_case.tester.scapy_append("from vxlan import Vxlan")
         self.test_case.tester.scapy_append(
             'pcap = rdpcap("%s")' % self.pcap_file)
         self.test_case.tester.scapy_append(
-- 
1.9.3



More information about the dts mailing list