action_list: throw exception if value is not an action
This is a programmer error, not a switch issue.
diff --git a/tests/pktact.py b/tests/pktact.py
index dff4420..5a1bedf 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -122,7 +122,7 @@
request.buffer_id = 0xffffffff
act.port = egress_port
- self.assertTrue(request.actions.add(act), "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
rv = self.controller.message_send(request)
@@ -188,7 +188,7 @@
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_CONTROLLER
act.max_len = 65535
- self.assertTrue(request.actions.add(act), "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
rv = self.controller.message_send(request)
@@ -277,7 +277,7 @@
request.buffer_id = 0xffffffff
act.port = egress_port
act.queue_id = egress_queue_id
- self.assertTrue(request.actions.add(act), "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
rv = self.controller.message_send(request)
@@ -408,7 +408,7 @@
request.buffer_id = 0xffffffff
act.port = egress_port
act.queue_id = egress_queue_id
- self.assertTrue(request.actions.add(act), "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
rv = self.controller.message_send(request)
@@ -527,9 +527,9 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = egress_port1
- self.assertTrue(request.actions.add(act), "Could not add action1")
+ request.actions.add(act)
act.port = egress_port2
- self.assertTrue(request.actions.add(act), "Could not add action2")
+ request.actions.add(act)
# logging.info(request.show())
logging.info("Inserting flow")
@@ -585,8 +585,7 @@
if egress_port == ingress_port:
continue
act.port = egress_port
- self.assertTrue(request.actions.add(act),
- "Could not add output to " + str(egress_port))
+ request.actions.add(act)
logging.debug(request.show())
logging.info("Inserting flow")
@@ -640,8 +639,7 @@
act.port = ofp.OFPP_IN_PORT
else:
act.port = egress_port
- self.assertTrue(request.actions.add(act),
- "Could not add output to " + str(egress_port))
+ request.actions.add(act)
# logging.info(request.show())
logging.info("Inserting flow")
@@ -686,8 +684,7 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_FLOOD
- self.assertTrue(request.actions.add(act),
- "Could not add flood port action")
+ request.actions.add(act)
logging.info(request.show())
logging.info("Inserting flow")
@@ -735,11 +732,9 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_FLOOD
- self.assertTrue(request.actions.add(act),
- "Could not add flood port action")
+ request.actions.add(act)
act.port = ofp.OFPP_IN_PORT
- self.assertTrue(request.actions.add(act),
- "Could not add ingress port for output")
+ request.actions.add(act)
logging.info(request.show())
logging.info("Inserting flow")
@@ -784,8 +779,7 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_ALL
- self.assertTrue(request.actions.add(act),
- "Could not add ALL port action")
+ request.actions.add(act)
logging.info(request.show())
logging.info("Inserting flow")
@@ -833,11 +827,9 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_ALL
- self.assertTrue(request.actions.add(act),
- "Could not add ALL port action")
+ request.actions.add(act)
act.port = ofp.OFPP_IN_PORT
- self.assertTrue(request.actions.add(act),
- "Could not add ingress port for output")
+ request.actions.add(act)
logging.info(request.show())
logging.info("Inserting flow")
@@ -896,8 +888,7 @@
request.match = match
request.buffer_id = 0xffffffff
act.port = ofp.OFPP_FLOOD
- self.assertTrue(request.actions.add(act),
- "Could not add flood port action")
+ request.actions.add(act)
logging.info(request.show())
logging.info("Inserting flow")
@@ -1978,7 +1969,7 @@
request.priority = priority
act = action.action_output()
act.port = output_port
- self.assertTrue(request.actions.add(act), "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
self.controller.message_send(request)
@@ -2110,8 +2101,7 @@
request.buffer_id = 0xffffffff
for act in acts:
act.port = egress_port
- rv = request.actions.add(act)
- self.assertTrue(rv, "Could not add action")
+ request.actions.add(act)
logging.info("Inserting flow")
rv = self.controller.message_send(request)