From: Hongbo Li <hongbox.li@intel.com>
To: dts@dpdk.org
Cc: Hongbo Li <hongbox.li@intel.com>
Subject: [dts][PATCH V1] tests/ice_iavf_fdir: optimize script
Date: Fri, 13 Jan 2023 22:48:22 +0800 [thread overview]
Message-ID: <20230113144822.25213-1-hongbox.li@intel.com> (raw)
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 <hongbox.li@intel.com>
---
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+(?P<product_name>E810-.*)", 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")
--
2.17.1
reply other threads:[~2023-01-13 6:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230113144822.25213-1-hongbox.li@intel.com \
--to=hongbox.li@intel.com \
--cc=dts@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).