summaryrefslogtreecommitdiffstats
path: root/test/framework.py
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-02-19 16:39:13 +0100
committerBeno�t Ganne <bganne@cisco.com>2021-03-02 10:38:24 +0000
commit8c45e5109522cf9bbc98785283cd4c923f486fe6 (patch)
tree7ccab546f7c83daa72fd9cae5273935fc0f27c28 /test/framework.py
parent2c0b6b462b86d4010cf551b545083c3509839cac (diff)
classify: fix multiple filters support
This fix the classify filter if we attach several different filters. This also fix some issues with l3 and l4 parsing. Type: fix Change-Id: I9dc6c55049a3bbc0110d1097b40d9da27633626b Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'test/framework.py')
-rw-r--r--test/framework.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/framework.py b/test/framework.py
index 9bb3e01c31e..4d0f45621b4 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -824,9 +824,11 @@ class VppTestCase(unittest.TestCase):
cls.sleep(0.1)
@classmethod
- def pg_start(cls):
+ def pg_start(cls, trace=True):
""" Enable the PG, wait till it is done, then clean up """
- cls.vapi.cli("trace add pg-input 1000")
+ if trace:
+ cls.vapi.cli("clear trace")
+ cls.vapi.cli("trace add pg-input 1000")
cls.vapi.cli('packet-generator enable')
# PG, when starts, runs to completion -
# so let's avoid a race condition,
@@ -1192,11 +1194,10 @@ class VppTestCase(unittest.TestCase):
"Finished sleep (%s) - slept %es (wanted %es)",
remark, after - before, timeout)
- def pg_send(self, intf, pkts, worker=None):
- self.vapi.cli("clear trace")
+ def pg_send(self, intf, pkts, worker=None, trace=True):
intf.add_stream(pkts, worker=worker)
self.pg_enable_capture(self.pg_interfaces)
- self.pg_start()
+ self.pg_start(trace=trace)
def send_and_assert_no_replies(self, intf, pkts, remark="", timeout=None):
self.pg_send(intf, pkts)
@@ -1207,10 +1208,11 @@ class VppTestCase(unittest.TestCase):
i.assert_nothing_captured(remark=remark)
timeout = 0.1
- def send_and_expect(self, intf, pkts, output, n_rx=None, worker=None):
+ def send_and_expect(self, intf, pkts, output, n_rx=None, worker=None,
+ trace=True):
if not n_rx:
n_rx = len(pkts)
- self.pg_send(intf, pkts, worker=worker)
+ self.pg_send(intf, pkts, worker=worker, trace=trace)
rx = output.get_capture(n_rx)
return rx