test suite reviews and discussions
 help / color / mirror / Atom feed
From: LihongX Ma <lihongx.ma@intel.com>
To: dts@dpdk.org
Cc: LihongX Ma <lihongx.ma@intel.com>
Subject: [dts] [PATCH V2] framework: add the check of scapy version
Date: Tue, 20 Oct 2020 01:34:34 +0800	[thread overview]
Message-ID: <1603128874-18697-1-git-send-email-lihongx.ma@intel.com> (raw)

v2: modify the comments information

 - modify the requirement scapy version to 2.4.4
 - add the check of the scapy version on tester

Signed-off-by: LihongX Ma <lihongx.ma@intel.com>
---
 framework/tester.py | 19 +++++++++++++++++++
 requirements.txt    |  2 +-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/framework/tester.py b/framework/tester.py
index ca179b2..008c10d 100644
--- a/framework/tester.py
+++ b/framework/tester.py
@@ -80,6 +80,7 @@ class Tester(Crb):
         # prepare for scapy env
         self.scapy_sessions_li = list()
         self.scapy_session = self.prepare_scapy_env()
+        self.check_scapy_version()
         self.tmp_file = '/tmp/tester/'
         out = self.send_expect('ls -d %s' % self.tmp_file, '# ', verify=True)
         if out == 2:
@@ -105,6 +106,24 @@ class Tester(Crb):
             session.logger.warning(f'entering import error: {out}')
         return session
 
+    def check_scapy_version(self):
+        require_version = '2.4.4'
+        self.scapy_session.get_session_before(timeout = 1)
+        self.scapy_session.send_expect('conf.version', '\'')
+        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,' +
+                    'please update your scapy, otherwise maybe some suite will failed')
+                break
+
     def init_ext_gen(self):
         """
         Initialize tester packet generator object.
diff --git a/requirements.txt b/requirements.txt
index cb9f636..fae0ace 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -36,5 +36,5 @@ numpy==1.18.5
 docutils
 pcapy
 xlrd
-scapy==2.4.3
+scapy==2.4.4
 threadpool
-- 
2.7.4


             reply	other threads:[~2020-10-20  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 17:34 LihongX Ma [this message]
2020-11-03  1:31 ` Tu, Lijuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603128874-18697-1-git-send-email-lihongx.ma@intel.com \
    --to=lihongx.ma@intel.com \
    --cc=dts@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).