[V1] tests/ice_iavf_fdir: optimize script
Checks
Context |
Check |
Description |
ci/Intel-dts-format-test |
success
|
Testing OK
|
ci/Intel-dts-pylama-test |
success
|
Testing OK
|
Commit Message
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(-)
@@ -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")