Added L2 dest modify + VLAN modify test
Moved egr_count calculation down into flow_test_match; defaults to 1
for existing calls.
diff --git a/tests/oft b/tests/oft
index 48816a1..c397372 100755
--- a/tests/oft
+++ b/tests/oft
@@ -221,8 +221,8 @@
parser.add_option("-p", "--port", dest="controller_port",
type="int", help="Port number of the test controller")
test_list_help = """Indicate tests to run. Valid entries are "all" (the
- default) or a comma separated list of:\n
- module Run all tests in the named module\n
+ default) or a comma separated list of:
+ module Run all tests in the named module
testcase Run tests in all modules with the name testcase
module.testcase Run the specific test case
"""
diff --git a/tests/pktact.py b/tests/pktact.py
index 86fc44e..0bd21dc 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -953,62 +953,72 @@
(pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_tos'],
check_test_params=True)
flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
- action_list=acts, max_test=2)
+ action_list=acts, max_test=2, egr_count=-1)
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")
+ skip_message_emit(self, "ModifyL2dstMC 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)
+ action_list=acts, max_test=2, egr_count=-1)
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")
+ skip_message_emit(self, "ModifyL2SrcMC 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)
+ action_list=acts, max_test=2, egr_count=-1)
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")
+ if (not (sup_acts & 1 << ofp.OFPAT_SET_DL_DST) or
+ not (sup_acts & 1 << ofp.OFPAT_SET_DL_SRC)):
+ skip_message_emit(self, "ModifyL2SrcDstMC 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)
+ action_list=acts, max_test=2, egr_count=-1)
+
+class ModifyL2DstVIDMC(BaseMatchCase):
+ """
+ Modify the L2 dest and send to 2 ports
+ """
+ def runTest(self):
+ sup_acts = supported_actions_get(self)
+ if (not (sup_acts & 1 << ofp.OFPAT_SET_DL_DST) or
+ not (sup_acts & 1 << ofp.OFPAT_SET_VLAN_VID)):
+ skip_message_emit(self, "ModifyL2DstVIDMC test")
+ return
+
+ mod_fields = ['dl_dst', 'dl_vlan']
+ (pkt, exp_pkt, acts) = pkt_action_setup(self,
+ start_field_vals={'dl_vlan_enable':True}, 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=-1)
#@todo Need to implement tagged versions of the above tests
diff --git a/tests/testutils.py b/tests/testutils.py
index 4c7420c..fe705f4 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -532,12 +532,16 @@
@param exp_pkt If not None, use this as the expected output pkt; els use pkt
@param action_list Additional actions to add to flow mod
@param check_expire Check for flow expiration message
+ @param egr_count Number of egress ports; -1 means get from config w/ dflt 2
"""
of_ports = port_map.keys()
of_ports.sort()
parent.assertTrue(len(of_ports) > 1, "Not enough ports for test")
test_count = 0
+ if egr_count == -1:
+ egr_count = test_param_get(parent.config, 'egr_count', default=2)
+
for ing_idx in range(len(of_ports)):
ingress_port = of_ports[ing_idx]
egr_ports = get_egr_list(parent, of_ports, egr_count,