[dts][PATCH V1] tests/ice_iavf_fdir: optimize script

Hongbo Li hongbox.li at intel.com
Fri Jan 13 15:48:22 CET 2023


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 at 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



More information about the dts mailing list