From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A2931A04F9; Thu, 16 Jan 2020 08:53:19 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5146D1C1B8; Thu, 16 Jan 2020 08:53:19 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E6E4A1BFCA for ; Thu, 16 Jan 2020 08:53:16 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2020 23:53:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,325,1574150400"; d="scan'208";a="218439776" Received: from unknown (HELO dpdk-xinfengx-dut.sh.intel.com) ([10.67.117.16]) by orsmga008.jf.intel.com with ESMTP; 15 Jan 2020 23:53:15 -0800 From: xinfengx To: dts@dpdk.org Cc: xinfengx Date: Thu, 16 Jan 2020 06:33:00 +0800 Message-Id: <20200115223300.21661-3-xinfengx.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200115223300.21661-1-xinfengx.zhao@intel.com> References: <20200115223300.21661-1-xinfengx.zhao@intel.com> Subject: [dts] [PATCH V1 3/3] tests: fix the statement errors that not supported by python3 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" Signed-off-by: xinfengx --- 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