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 4D57CA0555; Thu, 20 Feb 2020 03:42:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 184451BF78; Thu, 20 Feb 2020 03:42:34 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 018DD3B5 for ; Thu, 20 Feb 2020 03:42:31 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Feb 2020 18:42:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,462,1574150400"; d="scan'208";a="269415316" Received: from unknown (HELO dpdk-xiaoqimai-dut.sh.intel.com) ([10.240.179.33]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2020 18:42:29 -0800 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Thu, 20 Feb 2020 10:37:10 +0800 Message-Id: <1582166230-118849-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [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" *. add log info for tester when checking packets Signed-off-by: Xiao Qimai --- framework/tester.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 = self.get_interface(txport) rxIntf = 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 = pkt_c() pkt.generate_random_pkts(pktnum=pktnum, random_type=random_type, ip_increase=True, random_payload=True, options={"layers_config": params}) @@ -712,7 +712,7 @@ class Tester(Crb): for i in filenames: flag = self.send_expect('ps -ef |grep %s|grep -v grep' % i, expected='# ') 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 = -1 @@ -721,13 +721,13 @@ class Tester(Crb): recv_pkts = 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 # check each received packet content - print(GREEN("Comparing sniffed packets, please wait few minutes...")) + self.logger.info(GREEN("Comparing sniffed packets, please wait few minutes...")) for idx in range(len(recv_pkts)): try: l3_type = p.strip_element_layer2('type', p_index=idx) @@ -745,16 +745,16 @@ class Tester(Crb): if seq_check: if t_idx <= 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 = t_idx if compare_f(tx_pkts[txport].pktgen.pkts[t_idx], recv_pkts[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.pkts[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 return True -- 1.8.3.1