tests: enhance counter comparison error message
[vpp.git] / test / asf / asfframework.py
index 5c64454..1997d9f 100644 (file)
@@ -288,7 +288,7 @@ class VppTestCase(CPUInterface, unittest.TestCase):
     """
 
     extra_vpp_statseg_config = ""
-    extra_vpp_punt_config = []
+    extra_vpp_config = []
     extra_vpp_plugin_config = []
     logger = null_logger
     vapi_response_timeout = 5
@@ -481,8 +481,8 @@ class VppTestCase(CPUInterface, unittest.TestCase):
             ]
         )
 
-        if cls.extra_vpp_punt_config is not None:
-            cls.vpp_cmdline.extend(cls.extra_vpp_punt_config)
+        if cls.extra_vpp_config is not None:
+            cls.vpp_cmdline.extend(cls.extra_vpp_config)
 
         if not cls.debug_attach:
             cls.logger.info("vpp_cmdline args: %s" % cls.vpp_cmdline)
@@ -1280,13 +1280,15 @@ class VppTestCase(CPUInterface, unittest.TestCase):
                             f"{stats_snapshot[cntr][:, sw_if_index].sum()}, "
                             f"expected diff: {diff})",
                         )
-                    except IndexError:
+                    except IndexError as e:
                         # if diff is 0, then this most probably a case where
                         # test declares multiple interfaces but traffic hasn't
                         # passed through this one yet - which means the counter
                         # value is 0 and can be ignored
                         if 0 != diff:
-                            raise
+                            raise Exception(
+                                f"Couldn't sum counter: {cntr} on sw_if_index: {sw_if_index}"
+                            ) from e
 
     def send_and_assert_no_replies(
         self, intf, pkts, remark="", timeout=None, stats_diff=None, trace=True, msg=None