diff mbox series

[V1] framework/packet: add Dot1BR module to sys search path

Message ID 1635329993-169002-1-git-send-email-junx.dong@intel.com (mailing list archive)
State Superseded
Headers show
Series [V1] framework/packet: add Dot1BR module to sys search path | expand

Checks

Context Check Description
ci/Intel-dts-suite-test success Testing OK

Commit Message

DongJunX Oct. 27, 2021, 10:19 a.m. UTC
From: "Dong, JunX" <junx.dong@intel.com>

Signed-off-by: Dong, JunX <junx.dong@intel.com>
---
 framework/packet.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/framework/packet.py b/framework/packet.py
index e6fd74a0..633dd36f 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -35,22 +35,24 @@  Base on scapy(python program for packet manipulation)
 
 from importlib import import_module
 from socket import AF_INET6
-
 from scapy.all import *
-
 from .utils import convert_int2ip, convert_ip2int
 
 # load extension layers
 exec_file = os.path.realpath(__file__)
 DTS_PATH = exec_file.replace('/framework/packet.py', '')
+
 # exec_file might be .pyc file, if so, remove 'c'.
 TMP_PATH = DTS_PATH[:-1] + '/output/tmp/pcap/' if exec_file.endswith('.pyc') else DTS_PATH + '/output/tmp/pcap/'
 if not os.path.exists(TMP_PATH):
     os.system('mkdir -p %s' % TMP_PATH)
 
+# add /tmp/dep to sys.path
+sys.path.append('/tmp/dep')
+
 scapy_modules_required = {'scapy.contrib.gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'],
                           'scapy.contrib.lldp': ['LLDPDU', 'LLDPDUManagementAddress'],
-                          'dep.scapy_modules.Dot1BR': ['Dot1BR'],
+                          'Dot1BR': ['Dot1BR'],
                           'scapy.contrib.pfcp': ['PFCP'],
                           'scapy.contrib.nsh': ['NSH'],
                           'scapy.contrib.igmp': ['IGMP'],