Added L2 modify + MC tests and support
Added support to flow_match_test (and flow_match_test_port_pair)
to send generate flows/packets for multiple output port actions.
Added test cases for L2SrcModMC, L2DstModMC, L2SrcDstModMC which
modify and send to multiple output ports
Use egr_count to modify the number of output ports via test params.
Added warning to comments that test params need to be proper
Python identifiers.
diff --git a/tests/pktact.py b/tests/pktact.py
index 1861c89..86fc44e 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -955,6 +955,62 @@
flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
action_list=acts, max_test=2)
+class ModifyL2DstMC(BaseMatchCase):
+ """
+ Modify the L2 dest and send to 2 ports
+
+ Uses egr_count test parameter; defaults to 2
+ """
+ def runTest(self):
+ sup_acts = supported_actions_get(self)
+ if not (sup_acts & 1 << ofp.OFPAT_SET_DL_DST):
+ skip_message_emit(self, "ModifyL2dst test")
+ return
+
+ egr_count = test_param_get(self.config, 'egr_count', default=2)
+ (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_dst'],
+ check_test_params=True)
+ flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ action_list=acts, max_test=2, egr_count=egr_count)
+
+class ModifyL2SrcMC(BaseMatchCase):
+ """
+ Modify the source MAC address (TP1) and send to multiple
+
+ Uses egr_count test parameter; defaults to 2
+ """
+ def runTest(self):
+ sup_acts = supported_actions_get(self)
+ if not (sup_acts & 1 << ofp.OFPAT_SET_DL_SRC):
+ skip_message_emit(self, "ModifyL2Src test")
+ return
+
+ egr_count = test_param_get(self.config, 'egr_count', default=2)
+ (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['dl_src'],
+ check_test_params=True)
+ flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ action_list=acts, max_test=2, egr_count=egr_count)
+
+class ModifyL2SrcDstMC(BaseMatchCase):
+ """
+ Modify the L2 source and dest and send to 2 ports
+
+ Uses egr_count test parameter; defaults to 2
+ """
+ def runTest(self):
+ sup_acts = supported_actions_get(self)
+ if not (sup_acts & 1 << ofp.OFPAT_SET_DL_DST):
+ skip_message_emit(self, "ModifyL2dst test")
+ return
+
+ egr_count = test_param_get(self.config, 'egr_count', default=2)
+ mod_fields = ['dl_dst', 'dl_src']
+ (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=mod_fields,
+ check_test_params=True)
+ flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+ action_list=acts, max_test=2, egr_count=egr_count)
+
+
#@todo Need to implement tagged versions of the above tests
#
#@todo Implement a test case that strips tag 2, adds tag 3