add a global config dictionary
There was no need for each test module to keep a copy for itself. This means we
can also get rid of test_set_init.
diff --git a/tests/openflow_protocol_messages.py b/tests/openflow_protocol_messages.py
index 5f29da5..785ab14 100644
--- a/tests/openflow_protocol_messages.py
+++ b/tests/openflow_protocol_messages.py
@@ -10,6 +10,7 @@
import unittest
import random
+from oftest import config
import oftest.controller as controller
import oftest.cstruct as ofp
import oftest.message as message
@@ -22,22 +23,6 @@
from time import sleep
from FuncUtils import *
-
-of_port_map = None
-of_config = None
-
-def test_set_init(config):
-
-
- basic.test_set_init(config)
-
- global of_port_map
- global of_config
-
- of_port_map = config["port_map"]
- of_config = config
-
-
class FeaturesRequest(basic.SimpleProtocol):
"""Verify Features_Request-Reply is implemented
@@ -47,7 +32,7 @@
def runTest(self):
logging.info("Running Features_Request test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -77,7 +62,7 @@
logging.info("Running Configuration_Request test ")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -106,7 +91,7 @@
logging.info("Running Modify_State_Add test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -135,7 +120,7 @@
logging.info("Running Modify_State_Delete test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -170,7 +155,7 @@
logging.info("Running Modify_State_Modify test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -201,7 +186,7 @@
logging.info("Running Read_State test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear switch state
@@ -227,7 +212,7 @@
logging.info("Running Packet_Out test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
#Clear Switch state
@@ -255,7 +240,7 @@
exp_pkt_arg = None
exp_port = None
- if of_config["relax"]:
+ if config["relax"]:
exp_pkt_arg = outpkt
exp_port = dp_port
(of_port, pkt, pkt_time) = self.dataplane.poll(timeout=2,
@@ -284,7 +269,7 @@
logging.info("Running Packet_In test")
- of_ports = of_port_map.keys()
+ of_ports = config["port_map"].keys()
of_ports.sort()
ingress_port = of_ports[0]