* [dts][PATCH V1] tests/ice_iavf_fdir: optimize script
@ 2023-01-13 14:48 Hongbo Li
0 siblings, 0 replies; only message in thread
From: Hongbo Li @ 2023-01-13 14:48 UTC (permalink / raw)
To: dts; +Cc: Hongbo Li
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-13 6:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 14:48 [dts][PATCH V1] tests/ice_iavf_fdir: optimize script Hongbo Li
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).