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/actions.py b/tests/actions.py
index d0dab71..068eaa8 100644
--- a/tests/actions.py
+++ b/tests/actions.py
@@ -11,6 +11,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -24,25 +25,6 @@
 from time import sleep
 from FuncUtils import *
 
-ac_port_map = None
-ac_config = None
-of_ports = None
-
-def test_set_init(config):
-    basic.test_set_init(config)
-    
-    global ac_port_map
-    global ac_config
-    global of_ports
-
-    ac_port_map = config["port_map"]
-    ac_config = config
-    
-    of_ports = ac_port_map.keys()
-    of_ports.sort()
-
-   
-
 class NoAction(basic.SimpleDataPlane):
 
     """NoActionDrop : no action added to flow , drops the packet."""
@@ -51,7 +33,7 @@
         
         logging.info("Running No_Action test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -150,7 +132,7 @@
 
         logging.info("Running Forward_All test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -192,7 +174,7 @@
         #Verifying packets recieved on expected dataplane ports
         yes_ports = set(of_ports).difference([ingress_port])
         receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
-                      self, ac_config)
+                      self, config)
 
 
 class ForwardController(basic.SimpleDataPlane):
@@ -204,7 +186,7 @@
         
         logging.info("Running Forward_Controller test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -259,7 +241,7 @@
 
         logging.info("Running Forward_Local test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -310,7 +292,7 @@
     def runTest(self):
 
         logging.info("Running Forward_Flood test")
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -352,7 +334,7 @@
         #Verifying packets recieved on expected dataplane ports
         yes_ports = set(of_ports).difference([ingress_port])
         receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
-                      self, ac_config)
+                      self, config)
 
 class ForwardInport(basic.SimpleDataPlane):
     
@@ -363,7 +345,7 @@
 
         logging.info("Running Forward_Inport test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -404,7 +386,7 @@
 
         #Verfying packet recieved on expected dataplane ports
         receive_pkt_check(self.dataplane, pkt, yes_ports,set(of_ports).difference([ingress_port]),
-                            self, ac_config)      
+                          self, config)
 
 class ForwardTable(basic.SimpleDataPlane):
    
@@ -416,7 +398,7 @@
 
         logging.info("Running Forward_Table test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -455,7 +437,7 @@
 
         logging.info("Running Add_vlan_tag test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -484,7 +466,7 @@
         vid_act.vlan_vid = new_vid
 
         #Insert flow with action -- set vid , Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, 
                         exp_pkt=exp_pkt, action_list=[vid_act])
 
 class ModifyVlanTag(basic.SimpleDataPlane):
@@ -495,7 +477,7 @@
 
         logging.info("Running Modify_Vlan_Tag test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -522,7 +504,7 @@
         vid_act.vlan_vid = new_vid
         
         #Insert flow with action -- set vid , Send packet matching the flow.Verify recieved packet is expected packet.
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
         
 class VlanPrio1(basic.SimpleDataPlane):
@@ -533,7 +515,7 @@
 
         logging.info("Running vlan_Prio_1 test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -560,7 +542,7 @@
         act.vlan_pcp = vlan_pcp
 
         #Insert flow with action -- set vLAN priority, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                                 action_list=[act])
 
 
@@ -572,7 +554,7 @@
         
         logging.info("Running Vlan_Prio_2 test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -600,7 +582,7 @@
         vid_act.vlan_pcp = new_vlan_pcp
 
         #Insert flow with action -- set vLAN priority, Send tagged packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
 
 
@@ -612,7 +594,7 @@
 
         logging.info("Running Modify_L2_Src test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -635,7 +617,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set src address, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 
@@ -647,7 +629,7 @@
 
         logging.info("Running Modify_L2_Dst test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -670,7 +652,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set dst address, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL3Src(basic.SimpleDataPlane):
@@ -681,7 +663,7 @@
 
         logging.info("Running Modify_L3_Src test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -704,7 +686,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set nw src address, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL3Dst(basic.SimpleDataPlane):
@@ -715,7 +697,7 @@
 
         logging.info("Running Modify_L3_Dst test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -738,7 +720,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set nw dst address, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 
@@ -750,7 +732,7 @@
 
         logging.info("Running Modify_L4_Src test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -773,7 +755,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set tcp src port, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL4Dst(basic.SimpleDataPlane):
@@ -784,7 +766,7 @@
 
         logging.info("Running Modify_L4_Dst test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -807,7 +789,7 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set tcp dst port, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyTos(basic.SimpleDataPlane):
@@ -818,7 +800,7 @@
 
         logging.info("Running Modify_Tos test")
 
-        of_ports = ac_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -841,5 +823,5 @@
                                                 check_test_params=True)
         
         #Insert flow with action -- set TOS, Send packet matching the flow, Verify recieved packet is expected packet
-        flow_match_test(self, ac_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
diff --git a/tests/basic.py b/tests/basic.py
index a96adc8..db05320 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -7,11 +7,8 @@
 
 Current Assumptions:
 
-  The function test_set_init is called with a complete configuration
-dictionary prior to the invocation of any tests from this file.
-
   The switch is actively attempting to contact the controller at the address
-indicated oin oft_config
+indicated in oftest.config.
 
 """
 
@@ -22,6 +19,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -32,27 +30,8 @@
 
 from oftest.testutils import *
 
-#@var basic_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-basic_port_map = None
-#@var basic_config Local copy of global configuration data
-basic_config = None
-
 TEST_VID_DEFAULT = 2
 
-def test_set_init(config):
-    """
-    Set up function for basic test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    global basic_port_map
-    global basic_config
-
-    basic_port_map = config["port_map"]
-    basic_config = config
-
 class SimpleProtocol(unittest.TestCase):
     """
     Root class for setting up the controller
@@ -61,11 +40,10 @@
     priority = 1
 
     def setUp(self):
-        self.config = basic_config
         logging.info("** START TEST CASE " + str(self))
         self.controller = controller.Controller(
-            host=basic_config["controller_host"],
-            port=basic_config["controller_port"])
+            host=config["controller_host"],
+            port=config["controller_port"])
         # clean_shutdown should be set to False to force quit app
         self.clean_shutdown = True
         self.controller.start()
@@ -103,7 +81,6 @@
         the state after the sub_test is run must be taken into account
         by subsequent operations.
         """
-        self.config = parent.config
         logging.info("** Setup " + str(self) + " inheriting from "
                           + str(parent))
         self.controller = parent.controller
@@ -133,8 +110,8 @@
     """
     def setUp(self):
         SimpleProtocol.setUp(self)
-        self.dataplane = dataplane.DataPlane(self.config)
-        for of_port, ifname in basic_port_map.items():
+        self.dataplane = dataplane.DataPlane(config)
+        for of_port, ifname in config["port_map"].items():
             self.dataplane.port_add(ifname, of_port)
 
     def inheritSetup(self, parent):
@@ -168,10 +145,9 @@
 
     def setUp(self):
         self.clean_shutdown = True
-        self.config = basic_config
         logging.info("** START DataPlaneOnly CASE " + str(self))
-        self.dataplane = dataplane.DataPlane(self.config)
-        for of_port, ifname in basic_port_map.items():
+        self.dataplane = dataplane.DataPlane(config)
+        for of_port, ifname in config["port_map"].items():
             self.dataplane.port_add(ifname, of_port)
 
     def tearDown(self):
@@ -232,9 +208,9 @@
         self.assertEqual(rc, 0, "Failed to delete all flows")
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
 
-        for of_port in basic_port_map.keys():
+        for of_port in config["port_map"].keys():
             for pkt, pt in [
                (simple_tcp_packet(), "simple TCP packet"),
                (simple_tcp_packet(dl_vlan_enable=True,dl_vlan=vid,pktlen=108), 
@@ -252,7 +228,7 @@
                        break
                    if dataplane.match_exp_pkt(pkt, response.data): # Got match
                        break
-                   if not basic_config["relax"]:  # Only one attempt to match
+                   if not config["relax"]:  # Only one attempt to match
                        break
                    count += 1
                    if count > 10:   # Too many tries
@@ -283,7 +259,7 @@
         self.assertEqual(rc, 0, "Failed to delete all flows")
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        for of_port in basic_port_map.keys():
+        for of_port in config["port_map"].keys():
             pkt = simple_tcp_packet()
             self.dataplane.send(of_port, str(pkt))
             count = 0
@@ -293,7 +269,7 @@
                     break
                 if dataplane.match_exp_pkt(pkt, response.data): # Got match
                     break
-                if not basic_config["relax"]:  # Only one attempt to match
+                if not config["relax"]:  # Only one attempt to match
                     break
                 count += 1
                 if count > 10:   # Too many tries
@@ -316,13 +292,13 @@
 
     def runTest(self):
         # Need at least two ports
-        self.assertTrue(len(basic_port_map) > 1, "Too few ports for test")
+        self.assertTrue(len(config["port_map"]) > 1, "Too few ports for test")
 
         rc = delete_all_flows(self.controller)
         self.assertEqual(rc, 0, "Failed to delete all flows")
         self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
-        of_ports = basic_port_map.keys()
+        of_ports = config["port_map"].keys()
         d_port = of_ports[0]
         pkt = simple_eth_packet(dl_dst='ff:ff:ff:ff:ff:ff')
 
@@ -349,7 +325,7 @@
         self.assertEqual(rc, 0, "Failed to delete all flows")
 
         # These will get put into function
-        of_ports = basic_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         for dp_port in of_ports:
             for outpkt, opt in [
@@ -370,7 +346,7 @@
 
                exp_pkt_arg = None
                exp_port = None
-               if basic_config["relax"]:
+               if config["relax"]:
                    exp_pkt_arg = outpkt
                    exp_port = dp_port
                (of_port, pkt, pkt_time) = self.dataplane.poll(port_number=exp_port,
@@ -403,7 +379,7 @@
         self.assertEqual(rc, 0, "Failed to delete all flows")
 
         # These will get put into function
-        of_ports = basic_port_map.keys()
+        of_ports = config["port_map"].keys()
         random.shuffle(of_ports)
         for num_ports in range(1,len(of_ports)+1):
             for outpkt, opt in [
@@ -428,7 +404,7 @@
 
                receive_pkt_check(self.dataplane, outpkt, dp_ports,
                                  set(of_ports).difference(dp_ports),
-                                 self, basic_config)
+                                 self, config)
 
 class FlowStatsGet(SimpleProtocol):
     """
@@ -442,7 +418,7 @@
     def runTest(self):
         logging.info("Running StatsGet")
         logging.info("Inserting trial flow")
-        request = flow_mod_gen(basic_port_map, True)
+        request = flow_mod_gen(config["port_map"], True)
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Failed to insert test flow")
         
@@ -465,7 +441,7 @@
     def runTest(self):
         logging.info("Running TableStatsGet")
         logging.info("Inserting trial flow")
-        request = flow_mod_gen(basic_port_map, True)
+        request = flow_mod_gen(config["port_map"], True)
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Failed to insert test flow")
         
@@ -501,7 +477,7 @@
 
     def runTest(self):
         logging.info("Running " + str(self))
-        request = flow_mod_gen(basic_port_map, True)
+        request = flow_mod_gen(config["port_map"], True)
         rv = self.controller.message_send(request)
         self.assertTrue(rv != -1, "Error installing flow mod")
 
@@ -516,31 +492,31 @@
 
     def runTest(self):
         logging.info("Running " + str(self))
-        for of_port, ifname in basic_port_map.items(): # Grab first port
+        for of_port, ifname in config["port_map"].items(): # Grab first port
             break
 
-        (hw_addr, config, advert) = \
+        (hw_addr, port_config, advert) = \
             port_config_get(self.controller, of_port)
-        self.assertTrue(config is not None, "Did not get port config")
+        self.assertTrue(port_config is not None, "Did not get port config")
 
         logging.debug("No flood bit port " + str(of_port) + " is now " + 
-                           str(config & ofp.OFPPC_NO_FLOOD))
+                           str(port_config & ofp.OFPPC_NO_FLOOD))
 
         rv = port_config_set(self.controller, of_port,
-                             config ^ ofp.OFPPC_NO_FLOOD, ofp.OFPPC_NO_FLOOD)
+                             port_config ^ ofp.OFPPC_NO_FLOOD, ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
 
         # Verify change took place with same feature request
-        (hw_addr, config2, advert) = \
+        (hw_addr, port_config2, advert) = \
             port_config_get(self.controller, of_port)
         logging.debug("No flood bit port " + str(of_port) + " is now " + 
-                           str(config2 & ofp.OFPPC_NO_FLOOD))
-        self.assertTrue(config2 is not None, "Did not get port config2")
-        self.assertTrue(config2 & ofp.OFPPC_NO_FLOOD !=
-                        config & ofp.OFPPC_NO_FLOOD,
+                           str(port_config2 & ofp.OFPPC_NO_FLOOD))
+        self.assertTrue(port_config2 is not None, "Did not get port config2")
+        self.assertTrue(port_config2 & ofp.OFPPC_NO_FLOOD !=
+                        port_config & ofp.OFPPC_NO_FLOOD,
                         "Bit change did not take")
         # Set it back
-        rv = port_config_set(self.controller, of_port, config, 
+        rv = port_config_set(self.controller, of_port, port_config,
                              ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
 
@@ -556,7 +532,7 @@
         # pick a random bad port number
         bad_port = random.randint(1, ofp.OFPP_MAX)
         count = 0
-        while (count < 50) and (bad_port in basic_port_map.keys()):
+        while (count < 50) and (bad_port in config["port_map"].keys()):
             bad_port = random.randint(1, ofp.OFPP_MAX)
             count = count + 1
         self.assertTrue(count < 50, "Error selecting bad port")
@@ -574,7 +550,7 @@
             if response.code == ofp.OFPPMFC_BAD_PORT:
                 logging.info("Received error message with OFPPMFC_BAD_PORT code")
                 break
-            if not basic_config["relax"]:  # Only one attempt to match
+            if not config["relax"]:  # Only one attempt to match
                 break
             count += 1
             if count > 10:   # Too many tries
diff --git a/tests/bsn_ipmask.py b/tests/bsn_ipmask.py
index c3688ba..ce785c9 100644
--- a/tests/bsn_ipmask.py
+++ b/tests/bsn_ipmask.py
@@ -4,6 +4,7 @@
 
 import logging
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -11,21 +12,6 @@
 
 from oftest.testutils import *
 
-#@var port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-im_port_map = None
-#@var im_config Local copy of global configuration data
-im_config = None
-
-def test_set_init(config):
-    basic.test_set_init(config)
-
-    global im_port_map
-    global im_config
-
-    im_port_map = config["port_map"]
-    im_config = config
-
 def normal_ip_mask(index):
     """
     Return the IP mask for the given wildcard index 0 - 63 per the OF 1.0 spec
@@ -125,7 +111,7 @@
                 self.check_ip_mask(False, index, mask)
 
     def check_ip_mask(self, source, index, mask):
-        ports = im_port_map.keys()
+        ports = config["port_map"].keys()
 
         # For each mask we install two flow entries, one which matches
         # on IP source or dest addr all-0s (modulo the mask) and
diff --git a/tests/caps.py b/tests/caps.py
index 449fce6..ae218f0 100644
--- a/tests/caps.py
+++ b/tests/caps.py
@@ -7,6 +7,7 @@
 
 import unittest
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -17,28 +18,6 @@
 
 from oftest.testutils import *
 
-#@var caps_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-caps_port_map = None
-#@var caps_config Local copy of global configuration data
-caps_config = None
-
-def test_set_init(config):
-    """
-    Set up function for caps test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global caps_port_map
-    global caps_config
-
-    caps_port_map = config["port_map"]
-    caps_config = config
-
-
 def flow_caps_common(obj, is_exact=True):
     """
     The common function for 
@@ -47,8 +26,7 @@
     @param is_exact If True, checking exact match; else wildcard
     """
 
-    global caps_port_map
-    of_ports = caps_port_map.keys()
+    of_ports = config["port_map"].keys()
     of_ports.sort()
 
     rv = delete_all_flows(obj.controller)
@@ -74,7 +52,7 @@
 
     tstats = message.table_stats_request()
     try:  # Determine the table index to check (or "all")
-        table_idx = caps_config["caps_table_idx"]
+        table_idx = config["caps_table_idx"]
     except:
         table_idx = -1  # Accumulate all table counts
 
diff --git a/tests/cxn.py b/tests/cxn.py
index 7127a91..eeea564 100644
--- a/tests/cxn.py
+++ b/tests/cxn.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
@@ -18,25 +19,6 @@
 
 from oftest.testutils import *
 
-#@var cxn_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-cxn_port_map = None
-#@var cxn_config Local copy of global configuration data
-cxn_config = None
-
-def test_set_init(config):
-    """
-    Set up function for connection test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    global cxn_port_map
-    global cxn_config
-
-    cxn_port_map = config["port_map"]
-    cxn_config = config
-
 class BaseHandshake(unittest.TestCase):
     """
     Base handshake case to set up controller, but do not send hello.
@@ -62,10 +44,9 @@
                         "Controller startup failed, no switch addr")
 
     def setUp(self):
-        self.config = cxn_config
         logging.info("** START TEST CASE " + str(self))
 
-        self.test_timeout = test_param_get(cxn_config,
+        self.test_timeout = test_param_get(config,
                                            'handshake_timeout') or 60
 
     def inheritSetup(self, parent):
@@ -83,7 +64,6 @@
         the state after the sub_test is run must be taken into account
         by subsequent operations.
         """
-        self.config = parent.config
         logging.info("** Setup " + str(self) + 
                                     " inheriting from " + str(parent))
         self.controller = parent.controller
@@ -109,8 +89,8 @@
     and wait for disconnect.
     """
     def runTest(self):
-        self.controllerSetup(cxn_config["controller_host"],
-                             cxn_config["controller_port"])
+        self.controllerSetup(config["controller_host"],
+                             config["controller_port"])
 
         logging.info("TCP Connected " + 
                         str(self.controller.switch_addr))
@@ -130,8 +110,8 @@
     and wait for disconnect.
     """
     def runTest(self):
-        self.controllerSetup(cxn_config["controller_host"],
-                             cxn_config["controller_port"])
+        self.controllerSetup(config["controller_host"],
+                             config["controller_port"])
 
         logging.info("TCP Connected " + 
                                     str(self.controller.switch_addr))
@@ -157,8 +137,8 @@
     priority = -1
 
     def runTest(self):
-        self.controllerSetup(cxn_config["controller_host"],
-                             cxn_config["controller_port"])
+        self.controllerSetup(config["controller_host"],
+                             config["controller_port"])
 
         logging.info("TCP Connected " + 
                                     str(self.controller.switch_addr))
diff --git a/tests/detailed_contr_sw_messages.py b/tests/detailed_contr_sw_messages.py
index b13659d..c99b9b7 100644
--- a/tests/detailed_contr_sw_messages.py
+++ b/tests/detailed_contr_sw_messages.py
@@ -9,6 +9,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -21,21 +22,6 @@
 from time import sleep
 from FuncUtils import *
 
-cs_port_map = None
-cs_config = None
-
-def test_set_init(config):
-   
-
-    basic.test_set_init(config)
-
-    global cs_port_map
-    global cs_config
-
-    cs_port_map = config["port_map"]
-    cs_config = config
-
-
 class OverlapChecking(basic.SimpleDataPlane):
     
     """Verify that if overlap check flag is set in the flow entry and an overlapping flow is inserted then an error 
@@ -45,7 +31,7 @@
         
         logging.info("Running Overlap_Checking test")
        
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -105,7 +91,7 @@
      
         logging.info("Running No_Overlap_Checking test")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -137,7 +123,7 @@
         
         logging.info("Running Identical_Flows test ")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -178,7 +164,7 @@
 
         logging.info("Running Emergency_Flow_Timeout test")
         
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -230,7 +216,7 @@
         
         logging.info("Running Missing_Modify_Add test")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -270,7 +256,7 @@
         
         logging.info("Running Modify_Action test ")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -308,7 +294,7 @@
         
         logging.info("Running Strict_Modify_Action test")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -352,7 +338,7 @@
         
         logging.info("Delete_NonExisting_Flow test begins")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -388,7 +374,7 @@
 
         logging.info("Running Send_Flow_Rem test ")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -448,7 +434,7 @@
 
         logging.info("Running Delete_Emer_Flow")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         
         #Clear switch state        
@@ -491,7 +477,7 @@
         
         logging.info("Strict_Vs_Nonstrict test begins")
         
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -578,7 +564,7 @@
         
         logging.info("Outport1 test begins")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -636,7 +622,7 @@
         
         logging.info("Running Idle_Timeout test ")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
@@ -680,7 +666,7 @@
         
         logging.info("Running Outport2 test ")
 
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -720,7 +706,7 @@
 
         logging.info("Running Hard_Timeout test ")
         
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -767,7 +753,7 @@
 
         logging.info("Running Flow_Timeout test ")
         
-        of_ports = cs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
diff --git a/tests/flow_expire.py b/tests/flow_expire.py
index 20d8efc..63c0853 100644
--- a/tests/flow_expire.py
+++ b/tests/flow_expire.py
@@ -9,6 +9,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -20,27 +21,6 @@
 from oftest.testutils import *
 from time import sleep
 
-#@var port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-fe_port_map = None
-#@var fe_config Local copy of global configuration data
-fe_config = None
-
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global fe_port_map
-    global fe_config
-
-    fe_port_map = config["port_map"]
-    fe_config = config
-
 class FlowExpire(basic.SimpleDataPlane):
     """
     Verify flow expire messages are properly generated.
@@ -50,12 +30,10 @@
     Verify the flow expiration message is received
     """
     def runTest(self):
-        global fe_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fe_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -69,7 +47,7 @@
                         "Could not generate flow match from pkt")
         act = action.action_output()
 
-        of_ports = fe_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
diff --git a/tests/flow_query.py b/tests/flow_query.py
index cd607dd..b6a0000 100644
--- a/tests/flow_query.py
+++ b/tests/flow_query.py
@@ -64,6 +64,7 @@
 import random
 import time
 
+from oftest import config
 import oftest.controller  as controller
 import oftest.cstruct     as ofp
 import oftest.message     as message
@@ -77,28 +78,6 @@
 from oftest.testutils import *
 from time import sleep
 
-#@var port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-fq_port_map = None
-#@var fq_config Local copy of global configuration data
-fq_config = None
-
-
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global fq_port_map
-    global fq_config
-
-    fq_port_map = config["port_map"]
-    fq_config = config
-
 
 def flip_coin():
     return random.randint(1, 100) <= 50
@@ -168,8 +147,8 @@
             self.dl_addrs.append(rand_dl_addr())
             i = i + 1
     
-        if test_param_get(fq_config, "vlans", []) != []:
-           self.vlans = test_param_get(fq_config, "vlans", [])
+        if test_param_get(config, "vlans", []) != []:
+           self.vlans = test_param_get(config, "vlans", [])
 
            logging.info("Overriding VLAN ids to:")
            logging.info(self.vlans)
@@ -415,7 +394,7 @@
         return True
 
     def actions_equal(self, x):
-        if test_param_get(fq_config, "conservative_ordered_actions", True):
+        if test_param_get(config, "conservative_ordered_actions", True):
             # Compare actions lists as unordered
             
             aa = copy.deepcopy(x.actions.actions)
@@ -519,7 +498,7 @@
         # Action lists are ordered, so pick an ordered random subset of
         # supported actions
 
-        actions_force = test_param_get(fq_config, "actions_force", 0)
+        actions_force = test_param_get(config, "actions_force", 0)
         if actions_force != 0:
             logging.info("Forced actions:")
             logging.info(actions_bmap_to_str(actions_force))
@@ -628,11 +607,11 @@
 
         # By default, test with conservative ordering conventions
         # This should probably be indicated in a profile
-        if test_param_get(fq_config, "conservative_ordered_actions", True):
+        if test_param_get(config, "conservative_ordered_actions", True):
             self.rand_actions_ordered(fi, valid_actions, valid_ports, valid_queues)
             return self
 
-        actions_force = test_param_get(fq_config, "actions_force", 0)
+        actions_force = test_param_get(config, "actions_force", 0)
         if actions_force != 0:
             logging.info("Forced actions:")
             logging.info(actions_bmap_to_str(actions_force))
@@ -1259,7 +1238,7 @@
         self.valid_ports = map(lambda x: x.port_no, self.sw_features.ports)
         logging.info("Ports reported by switch:")
         logging.info(self.valid_ports)
-        ports_override = test_param_get(fq_config, "ports", [])
+        ports_override = test_param_get(config, "ports", [])
         if ports_override != []:
             logging.info("Overriding ports to:")
             logging.info(ports_override)
@@ -1284,7 +1263,7 @@
                           actions_bmap_to_str(self.sw_features.actions) \
                           ) \
                        )
-        actions_override = test_param_get(fq_config, "actions", -1)
+        actions_override = test_param_get(config, "actions", -1)
         if actions_override != -1:
             logging.info("Overriding supported actions to:")
             logging.info(actions_bmap_to_str(actions_override))
@@ -1308,7 +1287,7 @@
                               wildcards_to_str(ts.wildcards) \
                               ) \
                            )
-            wildcards_override = test_param_get(fq_config, "wildcards", -1)
+            wildcards_override = test_param_get(config, "wildcards", -1)
             if wildcards_override != -1:
                 logging.info("Overriding supported wildcards for table %d to:"
                                % (i)
@@ -1332,7 +1311,7 @@
                                 )
         logging.info("(Port, queue) pairs reported by switch:")
         logging.info(self.valid_queues)
-        queues_override = test_param_get(fq_config, "queues", [])
+        queues_override = test_param_get(config, "queues", [])
         if queues_override != []:
             logging.info("Overriding (port, queue) pairs to:")
             logging.info(queues_override)
@@ -1599,7 +1578,7 @@
     def runTest(self):
         logging.info("Flow_Add_5 TEST BEGIN")
 
-        num_flows = test_param_get(fq_config, "num_flows", 100)
+        num_flows = test_param_get(config, "num_flows", 100)
 
         # Clear all flows from switch
 
@@ -1702,7 +1681,7 @@
     def runTest(self):
         logging.info("Flow_Add_5_1 TEST BEGIN")
 
-        num_flows = test_param_get(fq_config, "num_flows", 100)
+        num_flows = test_param_get(config, "num_flows", 100)
         
         # Clear all flows from switch
 
@@ -2326,7 +2305,7 @@
     def runTest(self):
         logging.info("Flow_Mod_2 TEST BEGIN")
 
-        num_flows = test_param_get(fq_config, "num_flows", 100)
+        num_flows = test_param_get(config, "num_flows", 100)
 
         # Clear all flows from switch
 
@@ -2810,7 +2789,7 @@
     def runTest(self):
         logging.info("Flow_Del_2 TEST BEGIN")
 
-        num_flows = test_param_get(fq_config, "num_flows", 100)
+        num_flows = test_param_get(config, "num_flows", 100)
 
         # Clear all flows from switch
 
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index ecc8157..4b3c8e1 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -9,6 +9,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -20,12 +21,6 @@
 from oftest.testutils import *
 from time import sleep
 
-#@var fs_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-fs_port_map = None
-#@var fs_config Local copy of global configuration data
-fs_config = None
-
 # TODO: ovs has problems with VLAN id?
 WILDCARD_VALUES = [ofp.OFPFW_IN_PORT,
                    # (ofp.OFPFW_DL_VLAN | ofp.OFPFW_DL_VLAN_PCP),
@@ -42,21 +37,6 @@
                    ofp.OFPFW_DL_VLAN_PCP,
                    ofp.OFPFW_NW_TOS]
 
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global fs_port_map
-    global fs_config
-
-    fs_port_map = config["port_map"]
-    fs_config = config
-
 def sendPacket(obj, pkt, ingress_port, egress_port, test_timeout):
 
     logging.info("Sending packet to dp port " + str(ingress_port) +
@@ -65,7 +45,7 @@
 
     exp_pkt_arg = None
     exp_port = None
-    if fs_config["relax"]:
+    if config["relax"]:
         exp_pkt_arg = pkt
         exp_port = egress_port
 
@@ -126,12 +106,10 @@
                         "Packet count does not match number sent")
 
     def runTest(self):
-        global fs_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -265,12 +243,10 @@
                         " does not match number sent " + str(packet_count))
 
     def runTest(self):
-        global fs_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) >= 3, "Not enough ports for test")
         ingress_port = of_ports[0];
@@ -381,12 +357,10 @@
                         "Packet count does not match number sent")
 
     def runTest(self):
-        global fs_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) >= 3, "Not enough ports for test")
         ingress_port = of_ports[0];
diff --git a/tests/load.py b/tests/load.py
index fa993dc..a44b555 100644
--- a/tests/load.py
+++ b/tests/load.py
@@ -5,11 +5,8 @@
 namespace as different groups of tests will likely define 
 similar identifiers.
 
-  The function test_set_init is called with a complete configuration
-dictionary prior to the invocation of any tests from this file.
-
-  The switch is actively attempting to contact the controller at the address
-indicated in oft_config
+The switch is actively attempting to contact the controller at the address
+indicated in config.
 
 In general these test cases make some assumption about the external
 configuration of the switch under test.  For now, the assumption is
@@ -22,6 +19,7 @@
 
 import unittest
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -33,26 +31,6 @@
 
 from oftest.testutils import *
 
-#@var load_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-load_port_map = None
-#@var load_config Local copy of global configuration data
-load_config = None
-
-
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    global load_port_map
-    global load_config
-
-    load_port_map = config["port_map"]
-    load_config = config
-
 class LoadBarrier(basic.SimpleProtocol):
     """
     Test barrier under load with loopback
@@ -72,8 +50,8 @@
     def runTest(self):
         # Set up flow to send from port 1 to port 2 and copy to CPU
         # Test parameter gives LB port base (assumes consecutive)
-        lb_port = test_param_get(self.config, 'lb_port', default=1)
-        barrier_count = test_param_get(self.config, 'barrier_count', 
+        lb_port = test_param_get(config, 'lb_port', default=1)
+        barrier_count = test_param_get(config, 'barrier_count', 
                                        default=10)
 
         # Set controller to filter packet ins
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]
 
diff --git a/tests/pktact.py b/tests/pktact.py
index d22690c..5c1d702 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -7,11 +7,8 @@
 namespace as different groups of tests will likely define 
 similar identifiers.
 
-  The function test_set_init is called with a complete configuration
-dictionary prior to the invocation of any tests from this file.
-
-  The switch is actively attempting to contact the controller at the address
-indicated oin oft_config
+The switch is actively attempting to contact the controller at the address
+indicated in config.
 
 """
 
@@ -21,6 +18,7 @@
 
 import unittest
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -32,12 +30,6 @@
 
 from oftest.testutils import *
 
-#@var port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-pa_port_map = None
-#@var pa_config Local copy of global configuration data
-pa_config = None
-
 WILDCARD_VALUES = [ofp.OFPFW_IN_PORT,
                    ofp.OFPFW_DL_VLAN | ofp.OFPFW_DL_VLAN_PCP,
                    ofp.OFPFW_DL_SRC,
@@ -84,21 +76,6 @@
 
 TEST_VID_DEFAULT = 2
 
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global pa_port_map
-    global pa_config
-
-    pa_port_map = config["port_map"]
-    pa_config = config
-
 class DirectPacket(basic.SimpleDataPlane):
     """
     Send packet to single egress port
@@ -113,7 +90,7 @@
         self.handleFlow()
 
     def handleFlow(self, pkttype='TCP'):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -156,7 +133,7 @@
 
             exp_pkt_arg = None
             exp_port = None
-            if pa_config["relax"]:
+            if config["relax"]:
                 exp_pkt_arg = pkt
                 exp_port = egress_port
 
@@ -183,7 +160,7 @@
         self.handleFlow()
 
     def handleFlow(self, pkttype='TCP'):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 0, "Not enough ports for test")
 
@@ -254,7 +231,7 @@
         return result
 
     def handleFlow(self, pkttype='TCP'):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -319,7 +296,7 @@
                 
                 exp_pkt_arg = None
                 exp_port = None
-                if pa_config["relax"]:
+                if config["relax"]:
                     exp_pkt_arg = pkt
                     exp_port = egress_port
                     
@@ -378,7 +355,7 @@
         return result
 
     def handleFlow(self, pkttype='TCP'):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -454,7 +431,7 @@
                         break
                     if dataplane.match_exp_pkt(pkt, response.data): # Got match
                         break
-                    if not basic_config["relax"]:  # Only one attempt to match
+                    if not config["relax"]:  # Only one attempt to match
                         break
                     count += 1
                     if count > 10:   # Too many tries
@@ -516,7 +493,7 @@
     Verify the packet is received at the two egress ports
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
@@ -561,7 +538,7 @@
             no_ports = set(of_ports).difference(yes_ports)
 
             receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports,
-                              self, pa_config)
+                              self, config)
 
 class DirectMCNonIngress(basic.SimpleDataPlane):
     """
@@ -576,7 +553,7 @@
     Does not use the flood action
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
@@ -615,7 +592,7 @@
             self.dataplane.send(ingress_port, str(pkt))
             yes_ports = set(of_ports).difference([ingress_port])
             receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
-                              self, pa_config)
+                              self, config)
 
 
 class DirectMC(basic.SimpleDataPlane):
@@ -631,7 +608,7 @@
     Does not use the flood action
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
@@ -668,7 +645,7 @@
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
-            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
 
 class Flood(basic.SimpleDataPlane):
     """
@@ -681,7 +658,7 @@
     Verify the packet is received at all other ports
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -716,7 +693,7 @@
             self.dataplane.send(ingress_port, str(pkt))
             yes_ports = set(of_ports).difference([ingress_port])
             receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
-                              self, pa_config)
+                              self, config)
 
 class FloodPlusIngress(basic.SimpleDataPlane):
     """
@@ -730,7 +707,7 @@
     Verify the packet is received at all other ports
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -766,7 +743,7 @@
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
-            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
 
 class All(basic.SimpleDataPlane):
     """
@@ -779,7 +756,7 @@
     Verify the packet is received at all other ports
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -814,7 +791,7 @@
             self.dataplane.send(ingress_port, str(pkt))
             yes_ports = set(of_ports).difference([ingress_port])
             receive_pkt_check(self.dataplane, pkt, yes_ports, [ingress_port],
-                              self, pa_config)
+                              self, config)
 
 class AllPlusIngress(basic.SimpleDataPlane):
     """
@@ -828,7 +805,7 @@
     Verify the packet is received at all other ports
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -864,7 +841,7 @@
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
-            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, pa_config)
+            receive_pkt_check(self.dataplane, pkt, of_ports, [], self, config)
             
 class FloodMinusPort(basic.SimpleDataPlane):
     """
@@ -879,7 +856,7 @@
     the ingress port and the no_flood port
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 2, "Not enough ports for test")
 
@@ -921,7 +898,7 @@
             self.dataplane.send(ingress_port, str(pkt))
             no_ports = set([ingress_port, no_flood_port])
             yes_ports = set(of_ports).difference(no_ports)
-            receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports, self, pa_config)
+            receive_pkt_check(self.dataplane, pkt, yes_ports, no_ports, self, config)
 
             # Turn no flood off again
             rv = port_config_set(self.controller, no_flood_port,
@@ -952,7 +929,7 @@
     """
 
     def runTest(self):
-        flow_match_test(self, pa_port_map)
+        flow_match_test(self, config["port_map"])
 
 class ExactMatchTagged(BaseMatchCase):
     """
@@ -960,8 +937,8 @@
     """
 
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
-        flow_match_test(self, pa_port_map, dl_vlan=vid)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
+        flow_match_test(self, config["port_map"], dl_vlan=vid)
 
 class ExactMatchTaggedMany(BaseMatchCase):
     """
@@ -972,10 +949,10 @@
 
     def runTest(self):
         for vid in range(2,100,10):
-            flow_match_test(self, pa_port_map, dl_vlan=vid, max_test=5)
+            flow_match_test(self, config["port_map"], dl_vlan=vid, max_test=5)
         for vid in range(100,4000,389):
-            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)
+            flow_match_test(self, config["port_map"], dl_vlan=vid, max_test=5)
+        flow_match_test(self, config["port_map"], dl_vlan=4094, max_test=5)
 
 class SingleWildcardMatchPriority(BaseMatchCase):
     """
@@ -994,7 +971,7 @@
     def runTest(self):
         
         self._Init()
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
 
         # Delete the initial flow table
@@ -1089,7 +1066,7 @@
 
         self._Init()
 
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
 
         # Install an entry from 0 -> 1 @ prio 1000
@@ -1121,7 +1098,7 @@
         
         self._Init()
 
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
 
         self._ClearTable()
@@ -1156,7 +1133,7 @@
         
         self._Init()
 
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
 
         self._ClearTable()
@@ -1191,7 +1168,7 @@
     Verify flow_expiration message is correct when command option is set
     """
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
         for wc in WILDCARD_VALUES:
             wc |= required_wildcards(self)
             if wc & ofp.OFPFW_DL_VLAN:
@@ -1199,7 +1176,7 @@
                 dl_vlan = vid
             else:
                 dl_vlan = -1
-            flow_match_test(self, pa_port_map, wildcards=wc, 
+            flow_match_test(self, config["port_map"], wildcards=wc, 
                             dl_vlan=dl_vlan, max_test=10)
 
 class SingleWildcardMatchTagged(BaseMatchCase):
@@ -1207,10 +1184,10 @@
     SingleWildcardMatch with tagged packets
     """
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
         for wc in WILDCARD_VALUES:
             wc |= required_wildcards(self)
-            flow_match_test(self, pa_port_map, wildcards=wc, dl_vlan=vid,
+            flow_match_test(self, config["port_map"], wildcards=wc, dl_vlan=vid,
                             max_test=10)
 
 class AllExceptOneWildcardMatch(BaseMatchCase):
@@ -1225,7 +1202,7 @@
     Verify flow_expiration message is correct when command option is set
     """
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
         for all_exp_one_wildcard in NO_WILDCARD_VALUES:
             all_exp_one_wildcard |= required_wildcards(self)
             if all_exp_one_wildcard & ofp.OFPFW_DL_VLAN:
@@ -1233,7 +1210,7 @@
                 dl_vlan = vid
             else:
                 dl_vlan = -1
-            flow_match_test(self, pa_port_map, wildcards=all_exp_one_wildcard,
+            flow_match_test(self, config["port_map"], wildcards=all_exp_one_wildcard,
                             dl_vlan=dl_vlan)
 
 class AllExceptOneWildcardMatchTagged(BaseMatchCase):
@@ -1241,10 +1218,10 @@
     Match one field with tagged packets
     """
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
         for all_exp_one_wildcard in NO_WILDCARD_VALUES:
             all_exp_one_wildcard |= required_wildcards(self)
-            flow_match_test(self, pa_port_map, wildcards=all_exp_one_wildcard,
+            flow_match_test(self, config["port_map"], wildcards=all_exp_one_wildcard,
                             dl_vlan=vid)
 
 class AllWildcardMatch(BaseMatchCase):
@@ -1259,15 +1236,15 @@
     Verify flow_expiration message is correct when command option is set
     """
     def runTest(self):
-        flow_match_test(self, pa_port_map, wildcards=ofp.OFPFW_ALL)
+        flow_match_test(self, config["port_map"], wildcards=ofp.OFPFW_ALL)
 
 class AllWildcardMatchTagged(BaseMatchCase):
     """
     AllWildcardMatch with tagged packets
     """
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
-        flow_match_test(self, pa_port_map, wildcards=ofp.OFPFW_ALL, 
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
+        flow_match_test(self, config["port_map"], wildcards=ofp.OFPFW_ALL, 
                         dl_vlan=vid)
 
     
@@ -1290,7 +1267,7 @@
         vid_act = action.action_set_vlan_vid()
         vid_act.vlan_vid = new_vid
 
-        flow_match_test(self, pa_port_map, pkt=pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, 
                         exp_pkt=exp_pkt, action_list=[vid_act])
 
 class PacketOnly(basic.DataPlaneOnly):
@@ -1302,7 +1279,7 @@
 
     def runTest(self):
         pkt = simple_tcp_packet()
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         ing_port = of_ports[0]
         logging.info("Sending packet to " + str(ing_port))
@@ -1317,9 +1294,9 @@
     priority = -1
 
     def runTest(self):
-        vid = test_param_get(self.config, 'vid', default=TEST_VID_DEFAULT)
+        vid = test_param_get(config, 'vid', default=TEST_VID_DEFAULT)
         pkt = simple_tcp_packet(dl_vlan_enable=True, dl_vlan=vid)
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         ing_port = of_ports[0]
         logging.info("Sending packet to " + str(ing_port))
@@ -1347,7 +1324,7 @@
         vid_act = action.action_set_vlan_vid()
         vid_act.vlan_vid = new_vid
 
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act], ing_port=self.ing_port)
 
 class ModifyVIDToIngress(ModifyVID):
@@ -1372,7 +1349,7 @@
             skip_message_emit(self, "ModifyVIDWithTagWildcarded test")
             return
 
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         ing_port = of_ports[0]
         egr_ports = of_ports[1]
@@ -1424,7 +1401,7 @@
         vid_act = action.action_set_vlan_pcp()
         vid_act.vlan_pcp = new_vlan_pcp
 
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
 
 class StripVLANTag(BaseMatchCase):
@@ -1445,7 +1422,7 @@
         exp_pkt = simple_tcp_packet(pktlen=len)
         vid_act = action.action_strip_vlan()
 
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt,
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
 
 class StripVLANTagWithTagMatchWildcarded(BaseMatchCase):
@@ -1469,7 +1446,7 @@
                      ofp.OFPFW_DL_VLAN_PCP)
         vid_act = action.action_strip_vlan()
 
-        flow_match_test(self, pa_port_map, 
+        flow_match_test(self, config["port_map"], 
                         wildcards=wildcards,
                         pkt=pkt, exp_pkt=exp_pkt,
                         action_list=[vid_act])
@@ -1483,9 +1460,9 @@
 
     dl_vlan_enable=False
     dl_vlan=-1
-    if pa_config["test-params"]["vid"]:
+    if config["test-params"]["vid"]:
         dl_vlan_enable=True
-        dl_vlan = pa_config["test-params"]["vid"]
+        dl_vlan = config["test-params"]["vid"]
 
 # Unpack operator is ** on a dictionary
 
@@ -1503,7 +1480,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL2Dst(BaseMatchCase):
@@ -1518,7 +1495,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL3Src(BaseMatchCase):
@@ -1533,7 +1510,7 @@
 
         (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_src'],
                                                 check_test_params=True)
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL3Dst(BaseMatchCase):
@@ -1548,7 +1525,7 @@
 
         (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['ip_dst'],
                                                 check_test_params=True)
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL4Src(BaseMatchCase):
@@ -1563,7 +1540,7 @@
 
         (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_sport'],
                                                 check_test_params=True)
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyL4Dst(BaseMatchCase):
@@ -1578,7 +1555,7 @@
 
         (pkt, exp_pkt, acts) = pkt_action_setup(self, mod_fields=['tcp_dport'],
                                                 check_test_params=True)
-        flow_match_test(self, pa_port_map, pkt=pkt, exp_pkt=exp_pkt, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2)
 
 class ModifyTOS(BaseMatchCase):
@@ -1593,7 +1570,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
 
 class ModifyL2DstMC(BaseMatchCase):
@@ -1608,7 +1585,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
 
 class ModifyL2DstIngress(BaseMatchCase):
@@ -1623,7 +1600,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=0,
                         ing_port=True)
 
@@ -1639,7 +1616,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1,
                         ing_port=True)
 
@@ -1655,7 +1632,7 @@
 
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
 
 class ModifyL2SrcDstMC(BaseMatchCase):
@@ -1672,7 +1649,7 @@
         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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
 
 class ModifyL2DstVIDMC(BaseMatchCase):
@@ -1690,7 +1667,7 @@
         (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, 
+        flow_match_test(self, config["port_map"], pkt=pkt, exp_pkt=exp_pkt, 
                         action_list=acts, max_test=2, egr_count=-1)
 
 class FlowToggle(BaseMatchCase):
@@ -1705,8 +1682,8 @@
     (add, modify, delete +/- strict).
     """
     def runTest(self):
-        flow_count = test_param_get(self.config, 'ft_flow_count', default=20)
-        iter_count = test_param_get(self.config, 'ft_iter_count', default=10)
+        flow_count = test_param_get(config, 'ft_flow_count', default=20)
+        iter_count = test_param_get(config, 'ft_iter_count', default=10)
 
         logging.info("Running flow toggle with %d flows, %d iterations" %
                        (flow_count, iter_count))
@@ -1714,7 +1691,7 @@
         acts.append(action.action_output())
         acts.append(action.action_output())
     
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         if len(of_ports) < 3:
             self.assertTrue(False, "Too few ports for test")
     
@@ -1813,7 +1790,7 @@
     priority = -1
 
     def runTest(self):
-        count = test_param_get(self.config, 'iter_count', default=10)
+        count = test_param_get(config, 'iter_count', default=10)
         tests_done = 0
         logging.info("Running iteration test " + str(count) + " times")
         start = time.time()
@@ -1882,7 +1859,7 @@
     TODO test UDP, ARP, ICMP, etc.
     """
     def runTest(self):
-        of_ports = pa_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -1930,7 +1907,7 @@
 
             exp_pkt_arg = None
             exp_port = None
-            if pa_config["relax"]:
+            if config["relax"]:
                 exp_pkt_arg = pkt
                 exp_port = egress_port
 
diff --git a/tests/port_stats.py b/tests/port_stats.py
index 5cfb1bb..0de8de5 100644
--- a/tests/port_stats.py
+++ b/tests/port_stats.py
@@ -9,6 +9,7 @@
 import unittest
 import random
 
+from oftest import config
 import oftest.controller as controller
 import oftest.cstruct as ofp
 import oftest.message as message
@@ -20,12 +21,6 @@
 from oftest.testutils import *
 from time import sleep
 
-#@var fs_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-fs_port_map = None
-#@var fs_config Local copy of global configuration data
-fs_config = None
-
 # TODO: ovs has problems with VLAN id?
 WILDCARD_VALUES = [ofp.OFPFW_IN_PORT,
                    # (ofp.OFPFW_DL_VLAN | ofp.OFPFW_DL_VLAN_PCP),
@@ -42,21 +37,6 @@
                    ofp.OFPFW_DL_VLAN_PCP,
                    ofp.OFPFW_NW_TOS]
 
-def test_set_init(config):
-    """
-    Set up function for packet action test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    basic.test_set_init(config)
-
-    global fs_port_map
-    global fs_config
-
-    fs_port_map = config["port_map"]
-    fs_config = config
-
 def sendPacket(obj, pkt, ingress_port, egress_port, test_timeout):
 
     logging.info("Sending packet to dp port " + str(ingress_port) +
@@ -65,7 +45,7 @@
 
     exp_pkt_arg = None
     exp_port = None
-    if fs_config["relax"]:
+    if config["relax"]:
         exp_pkt_arg = pkt
         exp_port = egress_port
 
@@ -146,12 +126,10 @@
     """
 
     def runTest(self):
-        global fs_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
@@ -235,12 +213,10 @@
         return flow_mod_msg
 
     def runTest(self):
-        global fs_port_map
-
         # TODO: set from command-line parameter
         test_timeout = 60
 
-        of_ports = fs_port_map.keys()
+        of_ports = config["port_map"].keys()
         of_ports.sort()
         self.assertTrue(len(of_ports) >= 3, "Not enough ports for test")
         ingress_port = of_ports[0];
diff --git a/tests/serial_failover.py b/tests/serial_failover.py
index 97df2f8..7baeae0 100644
--- a/tests/serial_failover.py
+++ b/tests/serial_failover.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
@@ -18,25 +19,6 @@
 
 from oftest.testutils import *
 
-#@var serial_failover_port_map Local copy of the configuration map from OF port
-# numbers to OS interfaces
-serial_failover_port_map = None
-#@var serial_failover_config Local copy of global configuration data
-serial_failover_config = None
-
-def test_set_init(config):
-    """
-    Set up function for serial failover test classes
-
-    @param config The configuration dictionary; see oft
-    """
-
-    global serial_failover_port_map
-    global serial_failover_config
-
-    serial_failover_port_map = config["port_map"]
-    serial_failover_config = config
-
 class SerialFailover(unittest.TestCase):
     """
     Opens a connection that the switch should use as its only controller,
@@ -106,11 +88,11 @@
 
     def buildControllerList(self):
         # controller_list is list of ip/port tuples
-        partial_list = test_param_get(serial_failover_config,
+        partial_list = test_param_get(config,
                                       'controller_list')
         logging.debug("ctrl list: " + str(partial_list))
-        self.controller_list = [(serial_failover_config["controller_host"],
-                                 serial_failover_config["controller_port"])]
+        self.controller_list = [(config["controller_host"],
+                                 config["controller_port"])]
         if partial_list is not None:
             for controller in partial_list:
                 ip,portstr = controller.split(':')
@@ -130,12 +112,11 @@
         return self.controller_list[self.controller_idx]
 
     def setUp(self):
-        self.config = serial_failover_config
         logging.info("** START TEST CASE " + str(self))
 
-        self.test_timeout = test_param_get(serial_failover_config,
+        self.test_timeout = test_param_get(config,
                                            'failover_timeout') or 60
-        self.test_iterations = test_param_get(serial_failover_config,
+        self.test_iterations = test_param_get(config,
                                               'failover_iterations') or 4
 
         self.buildControllerList()
@@ -158,7 +139,6 @@
         the state after the sub_test is run must be taken into account
         by subsequent operations.
         """
-        self.config = parent.config
         logging.info("** Setup " + str(self) + 
                                     " inheriting from " + str(parent))
         self.controller = parent.controller