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 903A5A0525; Fri, 21 Feb 2020 03:03:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 439C5397D; Fri, 21 Feb 2020 03:03:11 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 1FC6725B3 for ; Fri, 21 Feb 2020 03:03:08 +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 orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 18:03:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,466,1574150400"; d="scan'208";a="229689120" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 20 Feb 2020 18:03:07 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 20 Feb 2020 18:03:07 -0800 Received: from shsmsx105.ccr.corp.intel.com (10.239.4.158) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 20 Feb 2020 18:03:07 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.222]) by SHSMSX105.ccr.corp.intel.com ([169.254.11.138]) with mapi id 14.03.0439.000; Fri, 21 Feb 2020 10:03:05 +0800 From: "Tu, Lijuan" To: "Xiao, QimaiX" , "dts@dpdk.org" CC: "Xiao, QimaiX" Thread-Topic: [dts] [PATCH V1]framework/tester: add log info Thread-Index: AQHV55d20AKtsz1YhEaUstolda8a26gk5uhg Date: Fri, 21 Feb 2020 02:03:04 +0000 Message-ID: <8CE3E05A3F976642AAB0F4675D0AD20E0BBCC920@SHSMSX101.ccr.corp.intel.com> References: <1582166230-118849-1-git-send-email-qimaix.xiao@intel.com> In-Reply-To: <1582166230-118849-1-git-send-email-qimaix.xiao@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]framework/tester: add log info 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 Xiao Qimai > Sent: Thursday, February 20, 2020 10:37 AM > To: dts@dpdk.org > Cc: Xiao, QimaiX > Subject: [dts] [PATCH V1]framework/tester: add log info >=20 > *. add log info for tester when checking packets >=20 > Signed-off-by: Xiao Qimai > --- > framework/tester.py | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) >=20 > diff --git a/framework/tester.py b/framework/tester.py index > 427164e..a858081 100644 > --- a/framework/tester.py > +++ b/framework/tester.py > @@ -689,7 +689,7 @@ class Tester(Crb): > for txport, rxport in portList: > txIntf =3D self.get_interface(txport) > rxIntf =3D self.get_interface(rxport) > - print(GREEN("Preparing transmit packets, please wait few > minutes...")) > + self.logger.info(GREEN("Preparing transmit packets, please > + wait few minutes...")) > pkt =3D pkt_c() > pkt.generate_random_pkts(pktnum=3Dpktnum, > random_type=3Drandom_type, ip_increase=3DTrue, random_payload=3DTrue, > options=3D{"layers_config": params}= ) @@ -712,7 +712,7 > @@ class Tester(Crb): > for i in filenames: > flag =3D self.send_expect('ps -ef |grep %s|grep -v grep'= % i, > expected=3D'# ') > if flag: > - print('wait for the completion of sending pkts...') > + self.logger.info('wait for the completion of > + sending pkts...') > sleep(1.5) > continue > prev_id =3D -1 > @@ -721,13 +721,13 @@ class Tester(Crb): > recv_pkts =3D p.pktgen.pkts > # only report when received number not matched > if len(tx_pkts[txport].pktgen.pkts) > len(recv_pkts): > - print(("Pkt number not matched,%d sent and %d received\n= " % ( > + self.logger.info(("Pkt number not matched,%d sent and > + %d received\n" % ( > len(tx_pkts[txport].pktgen.pkts), len(recv_pkts)))) > if allow_miss is False: > return False >=20 > # check each received packet content > - print(GREEN("Comparing sniffed packets, please wait few minu= tes...")) > + self.logger.info(GREEN("Comparing sniffed packets, please > + wait few minutes...")) > for idx in range(len(recv_pkts)): > try: > l3_type =3D p.strip_element_layer2('type', p_index= =3Didx) @@ - > 745,16 +745,16 @@ class Tester(Crb): >=20 > if seq_check: > if t_idx <=3D prev_id: > - print("Packet %d sequence not correct" % t_idx) > + self.logger.info("Packet %d sequence not > + correct" % t_idx) > return False > else: > prev_id =3D t_idx >=20 > if compare_f(tx_pkts[txport].pktgen.pkts[t_idx], recv_pk= ts[idx], "L4") > is False: > - print("Pkt received index %d not match original " \ > + self.logger.warning("Pkt received index %d not > + match original " \ > "index %d" % (idx, t_idx)) > - print("Sent: %s" % strip_f(tx_pkts[txport].pktgen.pk= ts[t_idx], > "L4")) > - print("Recv: %s" % strip_f(recv_pkts[idx], "L4")) > + self.logger.info("Sent: %s" % > strip_f(tx_pkts[txport].pktgen.pkts[t_idx], "L4")) > + self.logger.info("Recv: %s" % > + strip_f(recv_pkts[idx], "L4")) > return False >=20 > return True > -- > 1.8.3.1