diff options
author | Klement Sekera <ksekera@cisco.com> | 2018-12-10 13:46:09 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-12-13 14:42:50 +0000 |
commit | 14d7e90788f87a4b7b174bb5a67171f8c9a7f842 (patch) | |
tree | e89f6b874b29d9d20ea243a635728cacc4d2d85d /test/framework.py | |
parent | 69db1a60846f3e7dea3e1f615c396c356a49532e (diff) |
VPP-1522: harden reassembly code
Change-Id: Ib5a20bff7d8a340ecf50bcd4a023d6bf36382ba3
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r-- | test/framework.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/test/framework.py b/test/framework.py index f82f0750387..859010cf325 100644 --- a/test/framework.py +++ b/test/framework.py @@ -916,15 +916,18 @@ class VppTestCase(unittest.TestCase): self.assert_checksum_valid(pkt, 'ICMPv6EchoReply', 'cksum') def assert_packet_counter_equal(self, counter, expected_value): - counters = self.vapi.cli("sh errors").split('\n') - counter_value = -1 - for i in range(1, len(counters)): - results = counters[i].split() - if results[1] == counter: - counter_value = int(results[0]) - break - self.assert_equal(counter_value, expected_value, - "packet counter `%s'" % counter) + if counter.startswith("/"): + counter_value = self.statistics.get_counter(counter) + self.assert_equal(counter_value, expected_value, + "packet counter `%s'" % counter) + else: + counters = self.vapi.cli("sh errors").split('\n') + counter_value = -1 + for i in range(1, len(counters) - 1): + results = counters[i].split() + if results[1] == counter: + counter_value = int(results[0]) + break @classmethod def sleep(cls, timeout, remark=None): |