From patchwork Fri Jan 13 14:48:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, HongboX" X-Patchwork-Id: 122003 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 6BFEB423BE; Fri, 13 Jan 2023 07:29:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41A6F410EF; Fri, 13 Jan 2023 07:29:13 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A285C410D4 for ; Fri, 13 Jan 2023 07:29:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673591351; x=1705127351; h=from:to:cc:subject:date:message-id; bh=FqDMFn2itTQO6FxD1T90r/v02ZZqnD7jU/IhLQFh2fQ=; b=EWbcSDhYkoXm92ftAp83vYQapeKfYz2tvcHlijpLp62lk5yrrymgh+2W hhc/FwiieEiSav6hzkrdXWkIycbpg9j/oiibnRi8AaH0UwpAcr2l+5c+o 55rB7FzpcImci3eXTFp+UaDVpuDXyOGZYHq+CKeDSOb90DofRgZ/wHw1p grZI2fkG51We7IIYUoEhliEIwskTjSGjJArORhFlWoAVodSbb1rIljFCc oxypuDLpRFN7OeuNwV5WZ9C7mNsLgiFRzBJJzoPHzCT/PYZ6pI29U0mxv 1FYSNIla2RwrqVA6fATW4IRUoQ4lznyQLP2zk7dMX7onzwY63kAMgWVQ+ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="351161718" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="351161718" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 22:29:07 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10588"; a="782056157" X-IronPort-AV: E=Sophos;i="5.97,213,1669104000"; d="scan'208";a="782056157" Received: from unknown (HELO localhost.localdomain) ([10.239.252.93]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2023 22:29:06 -0800 From: Hongbo Li To: dts@dpdk.org Cc: Hongbo Li Subject: [dts][PATCH V1] tests/ice_iavf_fdir: optimize script Date: Fri, 13 Jan 2023 22:48:22 +0800 Message-Id: <20230113144822.25213-1-hongbox.li@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 some platforms cannot get the product name, which leads to test interruption, so catch exceptions to ensure that the test can continue Signed-off-by: Hongbo Li --- tests/TestSuite_ice_iavf_fdir.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/TestSuite_ice_iavf_fdir.py b/tests/TestSuite_ice_iavf_fdir.py index 458368ad..1d1ef12a 100644 --- a/tests/TestSuite_ice_iavf_fdir.py +++ b/tests/TestSuite_ice_iavf_fdir.py @@ -10475,10 +10475,13 @@ class TestICEIAVFFdir(TestCase): 'lspci -s {} -vvv |grep "Product Name"'.format(pf_pci), "#" ) res = re.search(r"Network Adapter\s+(?PE810-.*)", out) - self.verify(res, "product name not found'") # if card is chapman beach 100g*2, one pf port equals a general 100g*2 card,so 118 profiles can be used for vf - if "E810-2CQDA2" in res.group("product_name"): - nex_cnt = 118 // 8 + try: + self.verify(res, "product name not found") + if "E810-2CQDA2" in res.group("product_name"): + nex_cnt = 118 // 8 + except Exception as e: + self.logger.warning(e) else: self.verify(False, "The number of ports is not supported")