From patchwork Tue Aug 30 08:12:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 115648 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9CC1DA034C; Tue, 30 Aug 2022 10:16:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71CE840F18; Tue, 30 Aug 2022 10:16:26 +0200 (CEST) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 6256840F17 for ; Tue, 30 Aug 2022 10:16:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661847385; x=1693383385; h=from:to:cc:subject:date:message-id; bh=j59DGgTfDpvgaIQ5jB38JOdDNNGoQY46SwIG73MFRyU=; b=gJV44//rS7B3IXLvW0HvET+RSpLlPnDlaLj09cPZo+2+2b7rMk1mOAX3 x3AKpqzDv3CwJl02jOuXBned4Ld2t1/KzK7xiEJ4VikYVAPSvpMcaq/Vg j+qMfb+WUMfaEYcjnqkilXhp0E/UFz+TRdcdNzEY2nYnVD7b8WysgO5+l awc3PI2NRjtawupi1pnWoeGIw68yAYh/zkeqJiwfd+i8M/kelVieFuLfN sQGOct/9dJXhJnwcC37CgZqQRgu/Fm6r8s3L/rB7mNVOJqd1NFYzb1jW3 DrwaOedFI9wdcicSou2HTUMWgfa7cMxeUZhMc7pEOBxv8ADLJXtTN3OLK Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="356831369" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="356831369" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 01:16:24 -0700 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="607760280" Received: from unknown (HELO localhost.localdomain) ([10.239.252.15]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 01:16:23 -0700 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V2] tests/multiprocess modify the regular expression Date: Tue, 30 Aug 2022 16:12:31 +0800 Message-Id: <20220830081231.1255-1-dukaix.yuan@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.29 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 Modify re.search to re.findall to get all the list. Signed-off-by: Dukai Yuan --- tests/TestSuite_multiprocess.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py index da382a41..3d408ea9 100644 --- a/tests/TestSuite_multiprocess.py +++ b/tests/TestSuite_multiprocess.py @@ -175,6 +175,7 @@ class TestMultiprocess(TestCase): pktnum=pkt_num, dstmac="00:11:22:33:44:55", ) + time.sleep(3) pkt.send_pkt(crb=self.tester, tx_port=self.tester_ifaces[0], count=1) def specify_packet(self, que_num): @@ -1014,10 +1015,13 @@ class TestMultiprocess(TestCase): self.logger.err("Error occured:{}".format(traceback.format_exc(e))) finally: session_obj.close() - res = re.search( - r"Port \d+\s+-\s+rx:\s+(?P\d+)\s+tx:.*PORTS", out, re.DOTALL + res = re.findall( + r"Port \d+\s+-\s+rx:\s+\d+.*?Client\s+[1]\s+-.*?tx_drop:\s+\d+", + out, + re.DOTALL, ) - rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res.group(0)) + rx_num = re.findall(r"Client\s+\d\s+-\s+rx:\s+(\d+)", res[-1]) + for i in range(proc_num): self.verify( int(rx_num[i]) > 0,