From patchwork Mon Aug 29 09:44:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yuan, DukaiX" X-Patchwork-Id: 115593 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 E2054A0542; Mon, 29 Aug 2022 11:48:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A2E614113C; Mon, 29 Aug 2022 11:48:37 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 173D74003C for ; Mon, 29 Aug 2022 11:48:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661766516; x=1693302516; h=from:to:cc:subject:date:message-id; bh=/f/7FMbD7bUVYxO3afCUEftMwGHQU02dNiD/E2VnGh4=; b=OmkfP3TY1a6BMzgjfFXitiMKVLC4w71YLoBHOPeNdfmiefWn0c0aaAuD yW/goytaZ6i5iFn9fZkJY5mV3lZOfPnQ0giAVhliRMQBxqv6MabdccWSx vRJ/UPg+kZ+TbD7qr+jK6vIwkzNS88//0RHmzsgbbBxg9FXt0fbAU+015 dWhS7ipyUuEBCh8BYqJCPvIDw5iTYR0/mH1I+wRzihIkR1NmvHpmnxtCn 2668xNfq4q6hzyhG4+OiQhfztNBG7J65y9GQfQUGZZkleARlxdgBS/lNx +ZXvNY0JdfJSz2C8c+9wRpDp4V31i+Hm5sQviCbt+AHJPnxEP9yJCxioX w==; X-IronPort-AV: E=McAfee;i="6500,9779,10453"; a="320976664" X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="320976664" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 02:48:34 -0700 X-IronPort-AV: E=Sophos;i="5.93,272,1654585200"; d="scan'208";a="607398148" Received: from unknown (HELO localhost.localdomain) ([10.239.252.15]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2022 02:48:33 -0700 From: Dukai Yuan To: dts@dpdk.org Cc: Dukai Yuan Subject: [dts][PATCH V1] tests/multiprocess modify the regular expression Date: Mon, 29 Aug 2022 17:44:42 +0800 Message-Id: <20220829094442.25202-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 I40E_10G-SFP_XL710/I40E_10G-10G_BASE_T_X722/IGC-I226_LM use re.search,return (0, 0). Use re.findall will right. Signed-off-by: Dukai Yuan --- tests/TestSuite_multiprocess.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_multiprocess.py b/tests/TestSuite_multiprocess.py index da382a41..7cbf64c2 100644 --- a/tests/TestSuite_multiprocess.py +++ b/tests/TestSuite_multiprocess.py @@ -1014,10 +1014,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,