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 7F4A6A0542; Thu, 13 Feb 2020 11:31:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 760933256; Thu, 13 Feb 2020 11:31:24 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D90EC2BF1 for ; Thu, 13 Feb 2020 11:31:22 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 02:31:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,436,1574150400"; d="scan'208";a="222605163" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga007.jf.intel.com with ESMTP; 13 Feb 2020 02:31:21 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 13 Feb 2020 02:31:21 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 13 Feb 2020 02:31:21 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.98]) with mapi id 14.03.0439.000; Thu, 13 Feb 2020 18:31:19 +0800 From: "Tu, Lijuan" To: "Mo, YufengX" , "dts@dpdk.org" , "Ma, LihongX" CC: "Mo, YufengX" Thread-Topic: [dts] [PATCH V1 2/2] test/vxlan_sample: python3 support Thread-Index: AQHV4jZuL5Z0UbbvNke5Ou4bc5m0oagY7Pzg Date: Thu, 13 Feb 2020 10:31:18 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBC6995@SHSMSX101.ccr.corp.intel.com> References: <20200213062816.80145-1-yufengx.mo@intel.com> <20200213062816.80145-3-yufengx.mo@intel.com> In-Reply-To: <20200213062816.80145-3-yufengx.mo@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 2/2] test/vxlan_sample: python3 support 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 yufengmx > Sent: Thursday, February 13, 2020 2:28 PM > To: dts@dpdk.org; Ma, LihongX > Cc: Mo, YufengX > Subject: [dts] [PATCH V1 2/2] test/vxlan_sample: python3 support >=20 >=20 > python3 support. >=20 > Signed-off-by: yufengmx > --- > tests/TestSuite_vxlan_sample.py | 42 ++++++++++++++++----------------- > 1 file changed, 21 insertions(+), 21 deletions(-) >=20 > diff --git a/tests/TestSuite_vxlan_sample.py > b/tests/TestSuite_vxlan_sample.py index 7d4be40..df9d3a6 100644 > --- a/tests/TestSuite_vxlan_sample.py > +++ b/tests/TestSuite_vxlan_sample.py > @@ -202,11 +202,11 @@ class TestVxlanSample(TestCase): > if self.vm_dut is None: > raise Exception("Set up VM ENV failed!") > except Exception as e: > - print(utils.RED("Failure for %s" % str(e))) > + self.logger.error("Failure for %s" % str(e)) >=20 > # create another vm > if vm_num =3D=3D 2: > - print("not implemented now") > + self.logger.warning("not implemented now") >=20 > return True >=20 > @@ -303,11 +303,11 @@ class TestVxlanSample(TestCase): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > case_pass =3D False > - print(utils.RED("Failure in checking packet payload")) > + self.logger.error("Failure in checking packet payload") >=20 > if case_pass: > - print(utils.GREEN("Check normal udp packet forward pass = on " > - "virtIO port %d" % vf_id)) > + self.logger.info("Check normal udp packet forward pass o= n " > + "virtIO port %d" % vf_id) >=20 > if pkt_type =3D=3D "vxlan_udp_decap": > # create vxlan packet pf mac + vni=3D1000 + inner virtIO por= t0 mac @@ > -338,11 +338,11 @@ class TestVxlanSample(TestCase): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > case_pass =3D False > - print(utils.RED("Failure in checking packet payload")) > + self.logger.error("Failure in checking packet payload") >=20 > if case_pass: > - print(utils.GREEN("Check vxlan packet decap pass on virt= IO port" > - " %d" % vf_id)) > + self.logger.info("Check vxlan packet decap pass on virtI= O port" > + " %d" % vf_id) >=20 > if pkt_type =3D=3D "vxlan_udp": > # create vxlan packet pf mac + vni=3D1000 + inner virtIO por= t0 mac @@ > -373,11 +373,11 @@ class TestVxlanSample(TestCase): > self.verify(ord(payload[i]) =3D=3D 88, "Check udp da= ta failed") > except: > case_pass =3D False > - print(utils.RED("Failure in checking packet payload")) > + self.logger.error("Failure in checking packet payload") >=20 > if case_pass: > - print(utils.GREEN("Check vxlan packet decap and encap pa= ss on " > - "virtIO port %d" % vf_id)) > + self.logger.info("Check vxlan packet decap and encap pas= s on " > + "virtIO port %d" % vf_id) >=20 > if pkt_type =3D=3D "vxlan_udp_chksum": > params['inner_l4_type'] =3D 'UDP' > @@ -396,7 +396,7 @@ class TestVxlanSample(TestCase): > vxlan_pkt =3D VxlanTestConfig(self, **params) > vxlan_pkt.create_pcap() > chksums_ref =3D vxlan_pkt.get_chksums() > - print(utils.GREEN("Checksum reference: %s" % chksums_ref)) > + self.logger.info("Checksum reference: %s" % chksums_ref) >=20 > params['inner_ip_invalid'] =3D 1 > params['inner_l4_invalid'] =3D 1 @@ -419,14 +419,14 @@ class > TestVxlanSample(TestCase): > pk_new.pktgen.assign_pkt(pkts) > pk_new.pktgen.update_pkts() > chksums =3D vxlan_pkt.get_chksums(pk_new) > - print(utils.GREEN("Checksum : %s" % chksums)) > + self.logger.info("Checksum : %s" % chksums) > for key in chksums_ref: > if 'inner' in key: # only check inner packet chksum > self.verify(chksums[key] =3D=3D chksums_ref[key], > "%s not matched to %s" > % (key, chksums_ref[key])) >=20 > - print(utils.GREEN("%s checksum pass" % params['inner_l4_type= '])) > + self.logger.info("%s checksum pass" % > + params['inner_l4_type']) >=20 > if pkt_type =3D=3D "vxlan_tcp_tso": > # create vxlan packet pf mac + vni=3D1000 + inner virtIO por= t0 mac + > @@ -459,15 +459,15 @@ class TestVxlanSample(TestCase): > del inner.chksum > inner[IP] =3D inner[IP].__class__(str(inner[IP])) > inner_ip_chksum_ref =3D inner[IP].chksum > - print(utils.GREEN("inner ip checksum reference: %x" % > inner_ip_chksum_ref)) > - print(utils.GREEN("inner ip checksum: %x" % inner_ip_chk= sum)) > + 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 =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_l4_chksum_ref =3D inner[params['inner_l4_type']].= chksum > - print(utils.GREEN("inner l4 checksum reference: %x" % > inner_l4_chksum_ref)) > - print(utils.GREEN("inner l4 checksum: %x" % inner_l4_chk= sum)) > + self.logger.info("inner l4 checksum reference: %x" % > inner_l4_chksum_ref) > + self.logger.info("inner l4 checksum: %x" % > + inner_l4_chksum) > self.verify(inner_l4_chksum =3D=3D inner_l4_chksum_ref, = "inner %s > checksum error" % params['inner_l4_type']) >=20 > length =3D 0 > @@ -481,12 +481,12 @@ class TestVxlanSample(TestCase): > length +=3D len(payload) > except: > case_pass =3D False > - print(utils.RED("Failure in checking tso payload")) > + self.logger.error("Failure in checking tso > + payload") >=20 > self.verify(length =3D=3D 892, "Total tcp payload size not m= atch") > if case_pass: > - print(utils.GREEN("Vxlan packet tso pass on virtIO port = %d" > - % vf_id)) > + self.logger.info("Vxlan packet tso pass on virtIO port %= d" > + % vf_id) >=20 > def test_perf_vxlan_sample(self): > # vxlan payload length for performance test > -- > 2.21.0