diff options
author | Neale Ranns <neale@graphiant.com> | 2022-02-17 09:22:16 +0000 |
---|---|---|
committer | Neale Ranns <neale@graphiant.com> | 2022-02-18 09:20:40 +0000 |
commit | 699bea24944907fed5f7516e339aa2eca7c2dd17 (patch) | |
tree | 2088543dfa2900a09313501df65aefcd971420db /test/framework.py | |
parent | aacd3ed6d5c9c32b646795583a634ca5925603d2 (diff) |
tests: Consolidate the implementations of send_and_expect_X
Type: test
there were multiple instances of send_and_expect_load_balancing
and a send_and_expect_one_itf which has the same functionality as send_and_expect_one.
Put one implementation of both in framework.py (where the other send_and_X functions reside).
Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: I7f629d440220bee29368067f475059322e1134f7
Diffstat (limited to 'test/framework.py')
-rw-r--r-- | test/framework.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/framework.py b/test/framework.py index 572207db3f8..7d03eebef9a 100644 --- a/test/framework.py +++ b/test/framework.py @@ -1275,6 +1275,18 @@ class VppTestCase(CPUInterface, unittest.TestCase): self.logger.debug(self.vapi.cli("show trace")) return rx + def send_and_expect_load_balancing(self, input, pkts, outputs, + worker=None, trace=True): + self.pg_send(input, pkts, worker=worker, trace=trace) + rxs = [] + for oo in outputs: + rx = oo._get_capture(1) + self.assertNotEqual(0, len(rx)) + rxs.append(rx) + if trace: + self.logger.debug(self.vapi.cli("show trace")) + return rxs + def send_and_expect_only(self, intf, pkts, output, timeout=None): self.pg_send(intf, pkts) rx = output.get_capture(len(pkts)) |