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 D8FDEA0525; Fri, 21 Feb 2020 02:58:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A7D0B397D; Fri, 21 Feb 2020 02:58:54 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id DD1D825B3 for ; Fri, 21 Feb 2020 02:58:52 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 17:58:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,466,1574150400"; d="scan'208";a="383325637" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 20 Feb 2020 17:58:50 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 20 Feb 2020 17:58:50 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 20 Feb 2020 17:58:49 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.158]) with mapi id 14.03.0439.000; Fri, 21 Feb 2020 09:58:47 +0800 From: "Tu, Lijuan" To: "Xie, WeiX" , "dts@dpdk.org" CC: "Xie, WeiX" Thread-Topic: [dts] [PATCH V1] tests/vxlan_sample:fix to support py3 Thread-Index: AQHV5weO/96on5x6EUWePyBq5AQl/qgk5svw Date: Fri, 21 Feb 2020 01:58:47 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBCC8AA@SHSMSX101.ccr.corp.intel.com> References: <1582105053-65445-1-git-send-email-weix.xie@intel.com> In-Reply-To: <1582105053-65445-1-git-send-email-weix.xie@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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" Applied, thanks > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Xie Wei > Sent: Wednesday, February 19, 2020 5:38 PM > To: dts@dpdk.org > Cc: Xie, WeiX > Subject: [dts] [PATCH V1] tests/vxlan_sample:fix to support py3 >=20 > bytes type is str in python2.x, not support python3.x >=20 > Signed-off-by: Xie Wei > --- > tests/TestSuite_vxlan_sample.py | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > 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') =3D=3D 1, > "Packet not encapsulated") > try: > - payload =3D str(pkts[0][UDP]['VXLAN'][UDP].payload) > + payload =3D pkts[0][UDP]['VXLAN'][UDP].payload > for i in range(18): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > @@ -333,7 +333,7 @@ class TestVxlanSample(TestCase): > "Packet not de-encapsulated") >=20 > try: > - payload =3D str(pkts[0][UDP].payload) > + payload =3D pkts[0][UDP].payload > for i in range(18): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > @@ -368,7 +368,7 @@ class TestVxlanSample(TestCase): > self.verify(pkts[0].haslayer('VXLAN') =3D=3D 1, > "Packet not encapsulated") > try: > - payload =3D str(pkts[0][UDP]['VXLAN'][UDP].payload) > + payload =3D pkts[0][UDP]['VXLAN'][UDP].payload > for i in range(18): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > @@ -457,14 +457,14 @@ class TestVxlanSample(TestCase): > inner =3D pkt['VXLAN'] > inner_ip_chksum =3D inner[IP].chksum > del inner.chksum > - inner[IP] =3D inner[IP].__class__(str(inner[IP])) > + inner[IP] =3D inner[IP].__class__(inner[IP]) > inner_ip_chksum_ref =3D inner[IP].chksum > self.logger.info("inner ip checksum reference: %x" % > inner_ip_chksum_ref) > self.logger.info("inner ip checksum: %x" % inner_ip_chks= um) > self.verify(inner_ip_chksum =3D=3D inner_ip_chksum_ref, = "inner ip > checksum error") > inner_l4_chksum =3D inner[params['inner_l4_type']].chksu= m > del inner[params['inner_l4_type']].chksum > - inner[params['inner_l4_type']] =3D > inner[params['inner_l4_type']].__class__(str(inner[params['inner_l4_type'= ]])) > + inner[params['inner_l4_type']] =3D > + inner[params['inner_l4_type']].__class__(inner[params['inner_l4_type'] > + ]) > inner_l4_chksum_ref =3D 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_chks= um) @@ - > 475,7 +475,7 @@ class TestVxlanSample(TestCase): > self.verify(pkt.haslayer('VXLAN') =3D=3D 1, > "Packet not encapsulated") > try: > - payload =3D str(pkt[UDP]['VXLAN'][TCP].payload) > + payload =3D pkt[UDP]['VXLAN'][TCP].payload > self.verify(len(payload) <=3D self.def_mss, > "TCP payload oversized") > length +=3D len(payload) > -- > 2.17.2