testutils: add verify_no_errors
This is useful when sending messages like flow-mods or group-mods that do not
have a reply. It should be called after a barrier to ensure the switch has
processed the previous requests.
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index f6e7298..ccd8be7 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -1678,5 +1678,9 @@
verify_no_packet(test, pkt, ofport)
verify_no_other_packets(test)
+def verify_no_errors(ctrl):
+ error, _ = ctrl.poll(ofp.OFPT_ERROR, 0)
+ if error:
+ raise AssertionError("unexpected error type=%d code=%d" % (error.err_type, error.code))
__all__ = list(set(locals()) - _import_blacklist)