From 2b97ac55edc5ba9fadf987d1c787102786ea8c4d Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 8 Jan 2018 04:41:42 -0800 Subject: test: consolidate the multiple versions of send_and_* Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05 Signed-off-by: Neale Ranns (cherry picked from commit 52fae862646e25bac6d1cd11b9fc7ac77299bc25) --- test/framework.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/framework.py') diff --git a/test/framework.py b/test/framework.py index 210eadbf4c5..2e3f9781e5d 100644 --- a/test/framework.py +++ b/test/framework.py @@ -747,6 +747,25 @@ class VppTestCase(unittest.TestCase): "Finished sleep (%s) - slept %ss (wanted %ss)" % ( remark, after - before, timeout)) + def send_and_assert_no_replies(self, intf, pkts, remark=""): + self.vapi.cli("clear trace") + intf.add_stream(pkts) + self.pg_enable_capture(self.pg_interfaces) + self.pg_start() + timeout = 1 + for i in self.pg_interfaces: + i.get_capture(0, timeout=timeout) + i.assert_nothing_captured(remark=remark) + timeout = 0.1 + + def send_and_expect(self, input, pkts, output): + self.vapi.cli("clear trace") + input.add_stream(pkts) + self.pg_enable_capture(self.pg_interfaces) + self.pg_start() + rx = output.get_capture(len(pkts)) + return rx + class TestCasePrinter(object): _shared_state = {} -- cgit 1.2.3-korg