test suite reviews and discussions
 help / color / mirror / Atom feed
* Re: [dts] [PATCH V1] framework: fix trex mode not working
@ 2020-11-04  3:00 Chen, BoX C
  0 siblings, 0 replies; 3+ messages in thread
From: Chen, BoX C @ 2020-11-04  3:00 UTC (permalink / raw)
  To: dts

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

Tested-by: Chen, BoX C <box.c.chen@intel.com>

Regards,
Chen Bo

> -----Original Message-----
> From: Chen, BoX C <box.c.chen@intel.com>
> Sent: November 4, 2020 10:52
> To: dts@dpdk.org
> Cc: Chen, BoX C <box.c.chen@intel.com>; Chen
> Subject: [dts][PATCH V1] framework: fix Trex mode not working


[-- Attachment #2: framework.log --]
[-- Type: application/octet-stream, Size: 15800 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [dts] [PATCH V1] framework: fix Trex mode not working
@ 2020-11-04  2:52 Chen, BoX C
  2020-11-11  2:50 ` Tu, Lijuan
  0 siblings, 1 reply; 3+ messages in thread
From: Chen, BoX C @ 2020-11-04  2:52 UTC (permalink / raw)
  To: dts; +Cc: Chen, BoX C, Chen

DTS requires Trex compatible scapy, modify package loading mode and scapy version verification rules

Signed-off-by: Chen, BoX C <box.c.chen@intel.com>
---
 framework/packet.py | 23 +++++++++++++----------
 framework/tester.py | 12 ++++--------
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/framework/packet.py b/framework/packet.py
index dbc0058..7d974db 100644
--- a/framework/packet.py
+++ b/framework/packet.py
@@ -57,19 +57,22 @@ scapy_modules_required = {'gtp': ['GTP_U_Header', 'GTPPDUSessionContainer'],
 local_modules = [m[:-3] for m in os.listdir(DEP_FOLDER + '/scapy_modules') if (m.endswith('.py') and not m.startswith('__'))]
 
 for m in scapy_modules_required:
-    if m in local_modules:
-        module = import_module(m)
-        for clazz in scapy_modules_required[m]:
-            locals().update({clazz: getattr(module, clazz)})
-    else:
-        if m == 'sctp':
-            module = import_module(f'scapy.layers.{m}')
+    try:
+        if m in local_modules:
+            module = import_module(m)
             for clazz in scapy_modules_required[m]:
                 locals().update({clazz: getattr(module, clazz)})
         else:
-            module = import_module(f'scapy.contrib.{m}')
-            for clazz in scapy_modules_required[m]:
-                locals().update({clazz: getattr(module, clazz)})
+            if m == 'sctp':
+                module = import_module(f'scapy.layers.{m}')
+                for clazz in scapy_modules_required[m]:
+                    locals().update({clazz: getattr(module, clazz)})
+            else:
+                module = import_module(f'scapy.contrib.{m}')
+                for clazz in scapy_modules_required[m]:
+                    locals().update({clazz: getattr(module, clazz)})
+    except Exception as e:
+        print(e)
 
 def get_scapy_module_impcmd():
     cmd_li = list()
diff --git a/framework/tester.py b/framework/tester.py
index df432d5..b2cbdb0 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -111,21 +111,17 @@ class Tester(Crb):
 
     def check_scapy_version(self):
         require_version = '2.4.4'
-        self.scapy_session.get_session_before(timeout = 1)
+        self.scapy_session.get_session_before(timeout=1)
         self.scapy_session.send_expect('conf.version', '\'')
-        out = self.scapy_session.get_session_before(timeout = 1)
+        out = self.scapy_session.get_session_before(timeout=1)
         cur_version = out[:out.find('\'')]
         out = self.session.send_expect('grep scapy requirements.txt', '# ')
         value = re.search('scapy\s*==\s*(\S*)', out)
         if value is not None:
             require_version = value.group(1)
-        cur_version = cur_version.split('.')
-        require_version = require_version.split('.')
-        for i in range(len(require_version)):
-            if int(cur_version[i]) < int(require_version[i]):
-                self.logger.warning('The scapy vesrion not meet the requirement on tester,' +
+        if cur_version != require_version:
+            self.logger.warning('The scapy vesrion not meet the requirement on tester,' +
                     'please update your scapy, otherwise maybe some suite will failed')
-                break
 
     def init_ext_gen(self):
         """
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-11  2:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  3:00 [dts] [PATCH V1] framework: fix trex mode not working Chen, BoX C
  -- strict thread matches above, loose matches on Subject: below --
2020-11-04  2:52 [dts] [PATCH V1] framework: fix Trex " Chen, BoX C
2020-11-11  2:50 ` Tu, Lijuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).