define priorities as a property on the test class
This is just cleaner than keeping a global dictionary.
diff --git a/tests/pktact.py b/tests/pktact.py
index ef7505e..d22690c 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -38,10 +38,6 @@
#@var pa_config Local copy of global configuration data
pa_config = None
-# For test priority
-#@var test_prio Set test priority for local tests
-test_prio = {}
-
WILDCARD_VALUES = [ofp.OFPFW_IN_PORT,
ofp.OFPFW_DL_VLAN | ofp.OFPFW_DL_VLAN_PCP,
ofp.OFPFW_DL_SRC,
@@ -972,6 +968,8 @@
ExactMatchTagged with many VLANS
"""
+ priority = -1
+
def runTest(self):
for vid in range(2,100,10):
flow_match_test(self, pa_port_map, dl_vlan=vid, max_test=5)
@@ -979,10 +977,6 @@
flow_match_test(self, pa_port_map, dl_vlan=vid, max_test=5)
flow_match_test(self, pa_port_map, dl_vlan=4094, max_test=5)
-# Don't run by default
-test_prio["ExactMatchTaggedMany"] = -1
-
-
class SingleWildcardMatchPriority(BaseMatchCase):
"""
SingleWildcardMatchPriority
@@ -1303,6 +1297,9 @@
"""
Just send a packet thru the switch
"""
+
+ priority = -1
+
def runTest(self):
pkt = simple_tcp_packet()
of_ports = pa_port_map.keys()
@@ -1316,6 +1313,9 @@
"""
Just send a packet thru the switch
"""
+
+ priority = -1
+
def runTest(self):
vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
pkt = simple_tcp_packet(dl_vlan_enable=True, dl_vlan=vid)
@@ -1326,9 +1326,6 @@
logging.debug("Data: " + str(pkt).encode('hex'))
self.dataplane.send(ing_port, str(pkt))
-test_prio["PacketOnly"] = -1
-test_prio["PacketOnlyTagged"] = -1
-
class ModifyVID(BaseMatchCase):
"""
Modify the VLAN ID in the VLAN tag of a tagged packet
@@ -1813,6 +1810,8 @@
The cases come from the list above
"""
+ priority = -1
+
def runTest(self):
count = test_param_get(self.config, 'iter_count', default=10)
tests_done = 0
@@ -1842,9 +1841,6 @@
logging.info(" active: %d. lookups: %d. matched %d." %
(stats["active"], stats["lookups"], stats["matched"]))
-# Don't run by default
-test_prio["IterCases"] = -1
-
#@todo Need to implement tagged versions of the above tests
#
#@todo Implement a test case that strips tag 2, adds tag 3
@@ -1874,7 +1870,7 @@
If only VID 5 distinguishes pkt, this will fail on some platforms
"""
-test_prio["MixedVLAN"] = -1
+ priority = -1
class MatchEach(basic.SimpleDataPlane):
"""