test suite reviews and discussions
 help / color / mirror / Atom feed
From: xinfengx <xinfengx.zhao@intel.com>
To: dts@dpdk.org
Cc: xinfengx <xinfengx.zhao@intel.com>
Subject: [dts] [PATCH V1 3/3] tests: fix the statement errors that not supported by python3
Date: Thu, 16 Jan 2020 06:33:00 +0800	[thread overview]
Message-ID: <20200115223300.21661-3-xinfengx.zhao@intel.com> (raw)
In-Reply-To: <20200115223300.21661-1-xinfengx.zhao@intel.com>

Signed-off-by: xinfengx <xinfengx.zhao@intel.com>
---
 tests/TestSuite_eventdev_pipeline.py | 5 ++++-
 tests/TestSuite_telemetry.py         | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tests/TestSuite_eventdev_pipeline.py b/tests/TestSuite_eventdev_pipeline.py
index 29a42be..4818fc4 100644
--- a/tests/TestSuite_eventdev_pipeline.py
+++ b/tests/TestSuite_eventdev_pipeline.py
@@ -198,7 +198,10 @@ class TestEventdevPipeline(TestCase):
                     if packet_index == 0:
                         packet_index = int(self.pkts[i]['Raw'].load[-2:])
                         pay_load = "0000%.2d" % (packet_index)
-                    self.verify(self.pkts[i]['Raw'].load == pay_load,
+                    rev_pkt_load = self.pkts[i]['Raw'].load
+                    if isinstance(self.pkts[i]['Raw'].load, bytes):
+                        rev_pkt_load = str(self.pkts[i]['Raw'].load, encoding='utf-8')
+                    self.verify(rev_pkt_load == pay_load,
                             "%s : The packets not ordered" % case_info)
                     packet_index = packet_index + 1
 
diff --git a/tests/TestSuite_telemetry.py b/tests/TestSuite_telemetry.py
index e8ef6b7..000963b 100644
--- a/tests/TestSuite_telemetry.py
+++ b/tests/TestSuite_telemetry.py
@@ -405,7 +405,7 @@ class TestTelemetry(TestCase):
                 pformat(metric_missed_paras), ])
             error_msg.append(msg)
         # check if metric parameters and values are the same
-        if cmp(metric, xstat) != 0:
+        if metric != xstat:
             msg = 'telemetry metric data is not the same as testpmd xstat data'
             error_msg.append(msg)
             msg_fmt = 'port {} <{}>: metric is <{}>, xstat is is <{}>'.format
-- 
2.17.1


  parent reply	other threads:[~2020-01-16  7:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 22:32 [dts] [PATCH V1 1/3] framework: fix the issues of dts rerun error and writing error xinfengx
2020-01-15 22:32 ` [dts] [PATCH V1 2/3] nics: fix indentation error xinfengx
2020-01-15 22:33 ` xinfengx [this message]
2020-01-16  8:58 ` [dts] [PATCH V1 1/3] framework: fix the issues of dts rerun error and writing error 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=20200115223300.21661-3-xinfengx.zhao@intel.com \
    --to=xinfengx.zhao@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).