From patchwork Tue Aug 30 07:43:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 115647 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 D1966A034C; Tue, 30 Aug 2022 09:47:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C25A540F18; Tue, 30 Aug 2022 09:47:20 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id AF91140F17 for ; Tue, 30 Aug 2022 09:47:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661845638; x=1693381638; h=from:to:cc:subject:date:message-id; bh=VpsRC6UBkd/AunhVwUiodzJiNxiq7PmMzbRgpTtQIwI=; b=dd7EKQheSPYfh5Yy5/zTPj+abTob75/6q7HM45gQvtlBBfSgABvqU+ap zKM7Ez1piBRo/NOsOfykkZRQwzVoV7F9z5dwQWOMj9R2qjprgMyuN/iWy OOaunkCLIcIjbnpVoC6zvZx1G7kUQy0dvA9wglcqgoevlG2CF5Sf6+CRW vz+sXcxim3CUDTn5xX6jQtlqGi0p2y/bqHGTSSScRKVvM/ObtbdzbYejD +sPcB7CeAcp0Acr1MmRIUv9bu7GkXQU31ZrrnxVjIpEzMaJD8AKDu77TG SImLw60gcDXRGvPh9bRza8eVHSLahST5RQv7GPDIWbiV+MzkntmKMIAc0 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10454"; a="292687344" X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="292687344" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Aug 2022 00:47:16 -0700 X-IronPort-AV: E=Sophos;i="5.93,274,1654585200"; d="scan'208";a="607752834" 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 00:47:02 -0700 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V1] tests/multiprocess modify the regular expression Date: Tue, 30 Aug 2022 15:43:10 +0800 Message-Id: <20220830074310.32508-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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py index da382a41..9817c9c7 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,10 @@ 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,