define priorities as a property on the test class
This is just cleaner than keeping a global dictionary.
diff --git a/tests/basic.py b/tests/basic.py
index 65f875a..a96adc8 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -38,8 +38,6 @@
#@var basic_config Local copy of global configuration data
basic_config = None
-test_prio = {}
-
TEST_VID_DEFAULT = 2
def test_set_init(config):
@@ -60,6 +58,8 @@
Root class for setting up the controller
"""
+ priority = 1
+
def setUp(self):
self.config = basic_config
logging.info("** START TEST CASE " + str(self))
@@ -127,8 +127,6 @@
logging.error("** FAILED ASSERTION: " + msg)
unittest.TestCase.assertTrue(self, cond, msg)
-test_prio["SimpleProtocol"] = 1
-
class SimpleDataPlane(SimpleProtocol):
"""
Root class that sets up the controller and dataplane
@@ -166,6 +164,8 @@
Root class that sets up only the dataplane
"""
+ priority = -1
+
def setUp(self):
self.clean_shutdown = True
self.config = basic_config
@@ -184,8 +184,6 @@
# self.dataplane.show()
# Would like an assert that checks the data plane
-test_prio["DataPlaneOnly"] = -1
-
class Echo(SimpleProtocol):
"""
Test echo response with no data
@@ -277,6 +275,9 @@
Send a packet to each dataplane port and verify that a packet
in message is received from the controller for each
"""
+
+ priority = -1
+
def runTest(self):
rc = delete_all_flows(self.controller)
self.assertEqual(rc, 0, "Failed to delete all flows")
@@ -302,9 +303,6 @@
'Packet in message received on port ' +
str(of_port))
-test_prio["PacketInDefaultDrop"] = -1
-
-
class PacketInBroadcastCheck(SimpleDataPlane):
"""
Check if bcast pkts leak when no flows are present
@@ -313,6 +311,9 @@
Send in a broadcast pkt
Look for the packet on other dataplane ports.
"""
+
+ priority = -1
+
def runTest(self):
# Need at least two ports
self.assertTrue(len(basic_port_map) > 1, "Too few ports for test")
@@ -332,8 +333,6 @@
self.assertTrue(pkt_in is None,
'BCast packet received on port ' + str(of_port))
-test_prio["PacketInBroadcastCheck"] = -1
-
class PacketOut(SimpleDataPlane):
"""
Test packet out function
@@ -437,6 +436,9 @@
Simply verify stats get transaction
"""
+
+ priority = -1
+
def runTest(self):
logging.info("Running StatsGet")
logging.info("Inserting trial flow")
@@ -454,8 +456,6 @@
"Did not get response for flow stats")
logging.debug(response.show())
-test_prio["FlowStatsGet"] = -1
-
class TableStatsGet(SimpleProtocol):
"""
Get table stats