summaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorKlement Sekera <ksekera@cisco.com>2019-05-16 14:35:46 +0200
committerOle Trøan <otroan@employees.org>2019-05-20 12:13:11 +0000
commit3a343d42d7bd90753ea6ed48fe750a7a209b1ddf (patch)
treeba831c36c69365d67a2d20d7a6d447b831a1b88e /test/framework.py
parentb388e1a50603a07e20007141221ca4f4a18ab698 (diff)
reassembly: prevent long chain attack
limit max # of fragments to 3 per packet by default add API option to configure the limit at runtime Change-Id: Ie4b9507bf5c6095b9a5925972b37fe0032f4f9e8 Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/framework.py b/test/framework.py
index 47de2c4d967..201892aea27 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -1000,6 +1000,19 @@ class VppTestCase(unittest.TestCase):
if pkt.haslayer(ICMPv6EchoReply):
self.assert_checksum_valid(pkt, 'ICMPv6EchoReply', 'cksum')
+ def get_packet_counter(self, counter):
+ if counter.startswith("/"):
+ counter_value = self.statistics.get_counter(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
+ return counter_value
+
def assert_packet_counter_equal(self, counter, expected_value):
if counter.startswith("/"):
counter_value = self.statistics.get_counter(counter)