testutils: add new functions to check for dataplane packets
`receive_pkt_check` and `receive_pkt_verify` had slightly different
functionality and neither were sufficient for complex tests. This change
deprecates them and adds new functions.
The high level `verify_packets` function is sufficient for most tests. When
more complex logic is needed the primitive functions `verify_packet`,
`verify_no_packet`, and `verify_no_other_packets` should be used directly.
All OpenFlow 1.0/1.3 tests are updated to use the new functions. The old
functions are left around for compatibility with out of tree tests.
diff --git a/tests/actions.py b/tests/actions.py
index d25108d..1a99deb 100644
--- a/tests/actions.py
+++ b/tests/actions.py
@@ -163,8 +163,7 @@
#Verifying packets recieved on expected dataplane ports
yes_ports = set(of_ports).difference([ingress_port])
- receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
- self)
+ verify_packets(self, pkt, yes_ports)
class ForwardController(base_tests.SimpleDataPlane):
@@ -312,8 +311,7 @@
#Verifying packets recieved on expected dataplane ports
yes_ports = set(of_ports).difference([ingress_port])
- receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
- self)
+ verify_packets(self, pkt, yes_ports)
class ForwardInport(base_tests.SimpleDataPlane):
@@ -358,11 +356,9 @@
#Send packet matching the flow
logging.info("Sending packet to dp port " + str(ingress_port))
self.dataplane.send(ingress_port, str(pkt))
- yes_ports = [ingress_port]
#Verfying packet recieved on expected dataplane ports
- receive_pkt_check(self.dataplane, pkt, yes_ports,set(of_ports).difference([ingress_port]),
- self)
+ verify_packets(self, pkt, [ingress_port])
class ForwardTable(base_tests.SimpleDataPlane):