X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_pg_interface.py;h=1300f1f1f006b3d5f769482068fe985e32151cc2;hb=e88865d;hp=4707f0b7fdf0dc298d97fefd26b9337f8f628c49;hpb=acb9b8e8c3394d06964ad0f8387b764c01f43152;p=vpp.git diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py index 4707f0b7fdf..1300f1f1f00 100644 --- a/test/vpp_pg_interface.py +++ b/test/vpp_pg_interface.py @@ -84,11 +84,11 @@ class VppPGInterface(VppInterface): def __init__(self, test, pg_index): """ Create VPP packet-generator interface """ - r = test.vapi.pg_create_interface(pg_index) - self._sw_if_index = r.sw_if_index - super(VppPGInterface, self).__init__(test) + r = test.vapi.pg_create_interface(pg_index) + self.set_sw_if_index(r.sw_if_index) + self._in_history_counter = 0 self._out_history_counter = 0 self._out_assert_counter = 0 @@ -220,6 +220,10 @@ class VppPGInterface(VppInterface): if len(capture.res) == expected_count: # bingo, got the packets we expected return capture + elif len(capture.res) > expected_count: + self.test.logger.error( + ppc("Unexpected packets captured:", capture)) + break else: self.test.logger.debug("Partial capture containing %s " "packets doesn't match expected " @@ -251,8 +255,6 @@ class VppPGInterface(VppInterface): if not capture or len(capture.res) == 0: # junk filtered out, we're good return - self.test.logger.error( - ppc("Unexpected packets captured:", capture)) except: pass self.generate_debug_aid("empty-assert")