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 67D6AA0555; Wed, 19 Feb 2020 10:32:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 281DE1B13C; Wed, 19 Feb 2020 10:32:09 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2C73458C4 for ; Wed, 19 Feb 2020 10:32:06 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2020 01:32:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,459,1574150400"; d="scan'208";a="254043734" Received: from unknown (HELO dpdk-wenjielx-dtspatch135.sh.intel.com) ([10.240.176.135]) by orsmga002.jf.intel.com with ESMTP; 19 Feb 2020 01:32:04 -0800 From: Xie Wei To: dts@dpdk.org Cc: Xie Wei Date: Wed, 19 Feb 2020 17:37:33 +0800 Message-Id: <1582105053-65445-1-git-send-email-weix.xie@intel.com> X-Mailer: git-send-email 1.9.3 Subject: [dts] [PATCH V1] tests/vxlan_sample:fix to support py3 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" bytes type is str in python2.x, not support python3.x Signed-off-by: Xie Wei --- tests/TestSuite_vxlan_sample.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/TestSuite_vxlan_sample.py b/tests/TestSuite_vxlan_sample.py index df9d3a6..4ab9f18 100644 --- a/tests/TestSuite_vxlan_sample.py +++ b/tests/TestSuite_vxlan_sample.py @@ -298,7 +298,7 @@ class TestVxlanSample(TestCase): self.verify(pkts[0].haslayer('VXLAN') == 1, "Packet not encapsulated") try: - payload = str(pkts[0][UDP]['VXLAN'][UDP].payload) + payload = pkts[0][UDP]['VXLAN'][UDP].payload for i in range(18): self.verify(ord(payload[i]) == 88, "Check udp data failed") except: @@ -333,7 +333,7 @@ class TestVxlanSample(TestCase): "Packet not de-encapsulated") try: - payload = str(pkts[0][UDP].payload) + payload = pkts[0][UDP].payload for i in range(18): self.verify(ord(payload[i]) == 88, "Check udp data failed") except: @@ -368,7 +368,7 @@ class TestVxlanSample(TestCase): self.verify(pkts[0].haslayer('VXLAN') == 1, "Packet not encapsulated") try: - payload = str(pkts[0][UDP]['VXLAN'][UDP].payload) + payload = pkts[0][UDP]['VXLAN'][UDP].payload for i in range(18): self.verify(ord(payload[i]) == 88, "Check udp data failed") except: @@ -457,14 +457,14 @@ class TestVxlanSample(TestCase): inner = pkt['VXLAN'] inner_ip_chksum = inner[IP].chksum del inner.chksum - inner[IP] = inner[IP].__class__(str(inner[IP])) + inner[IP] = inner[IP].__class__(inner[IP]) inner_ip_chksum_ref = inner[IP].chksum self.logger.info("inner ip checksum reference: %x" % inner_ip_chksum_ref) self.logger.info("inner ip checksum: %x" % inner_ip_chksum) self.verify(inner_ip_chksum == inner_ip_chksum_ref, "inner ip checksum error") inner_l4_chksum = inner[params['inner_l4_type']].chksum del inner[params['inner_l4_type']].chksum - inner[params['inner_l4_type']] = inner[params['inner_l4_type']].__class__(str(inner[params['inner_l4_type']])) + inner[params['inner_l4_type']] = inner[params['inner_l4_type']].__class__(inner[params['inner_l4_type']]) inner_l4_chksum_ref = inner[params['inner_l4_type']].chksum self.logger.info("inner l4 checksum reference: %x" % inner_l4_chksum_ref) self.logger.info("inner l4 checksum: %x" % inner_l4_chksum) @@ -475,7 +475,7 @@ class TestVxlanSample(TestCase): self.verify(pkt.haslayer('VXLAN') == 1, "Packet not encapsulated") try: - payload = str(pkt[UDP]['VXLAN'][TCP].payload) + payload = pkt[UDP]['VXLAN'][TCP].payload self.verify(len(payload) <= self.def_mss, "TCP payload oversized") length += len(payload) -- 2.17.2