diff --git a/tests/basic.py b/tests/basic.py
index f7db544..268d313 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -1,6 +1,10 @@
 """
 Basic test cases for the oftest OpenFlow test framework
 
+It is recommended that these definitions be kept in their own
+namespace as different groups of tests will likely define 
+similar identifiers.
+
 Current Assumptions:
 
   The oftest framework source is in ../src/python/oftest
@@ -8,6 +12,7 @@
   The switch is actively attempting to contact the controller at the address
 indicated oin oft_config
 
+
 """
 
 from scapy.all import *
@@ -16,43 +21,73 @@
 import time
 import signal
 import sys
+##@todo Use setup to place OFT modules in path
 sys.path.append("../src/python/oftest")
 from message import *
 from dataplane import *
 from controller import *
-from oft_config import *
+import logging
 
-#debug_level_default = DEBUG_VERBOSE
-dbg_lvl = debug_level_default
+basic_port_map = None
+basic_logger = None
+basic_config = None
+
+def test_set_init(config):
+    """
+    Set up function for basic test classes
+
+    @param config The configuration dictionary; see oft
+    @return TestSuite object for the class; may depend on config
+    """
+
+    global basic_port_map
+    global basic_logger
+    global basic_config
+
+    basic_logger = logging.getLogger("basic")
+    basic_logger.info("Initializing test set")
+    basic_port_map = config["port_map"]
+    basic_config = config
+    return suite()
+
+def suite():
+    suite = unittest.TestSuite()
+    suite.addTest(SimpleProtocolTestCase())
+    suite.addTest(SimpleDataPlaneTestCase())
+    suite.addTest(EchoTestCase())
+    suite.addTest(EchoWithDataTestCase())
+    suite.addTest(PacketInTestCase())
+    suite.addTest(PacketOutTestCase())
+    return suite
 
 class SimpleProtocolTestCase(unittest.TestCase):
     """
     Root class for setting up the controller
     """
 
-    def dbg(self, level, string):
-        debug_log(str(self), dbg_lvl, level, string)
-
     def sig_handler(self):
+        basic_logger.critical("Received interrupt signal; exiting")
         print "Received interrupt signal; exiting"
         self.controller.shutdown()
         sys.exit(1)
 
     def setUp(self):
         signal.signal(signal.SIGINT, self.sig_handler)
-        self.dbg(DEBUG_INFO, "Setup for " + str(self))
-        self.controller = Controller()
+        basic_logger.info("Setup for " + str(self))
+        self.controller = Controller(host=basic_config["controller_host"],
+                                     port=basic_config["controller_port"])
         self.controller.start()
         self.controller.connect(timeout=20)
-        self.dbg(DEBUG_INFO, "Connected " + str(self.controller.switch_addr))
+        basic_logger.info("Connected " + str(self.controller.switch_addr))
 
     def tearDown(self):
-        self.dbg(DEBUG_INFO, "Teardown for simple proto test")
+        basic_logger.info("Teardown for simple proto test")
         self.controller.shutdown()
         # self.controller.join()
 
     def runTest(self):
         # Just a simple sanity check as illustration
+        basic_logger.info("Running simple proto test")
         self.assertTrue(self.controller.switch_socket is not None,
                         str(self) + 'No connection to switch')
 
@@ -63,14 +98,14 @@
     def setUp(self):
         SimpleProtocolTestCase.setUp(self)
         self.dataplane = DataPlane()
-        for of_port, ifname in interface_ofport_map.items():
+        for of_port, ifname in basic_port_map.items():
             self.dataplane.port_add(ifname, of_port)
 
     def tearDown(self):
-        self.dbg(DEBUG_INFO, "Teardown for simple dataplane test")
+        basic_logger.info("Teardown for simple dataplane test")
         SimpleProtocolTestCase.tearDown(self)
-        self.dataplane.kill(join_threads=False)
-        self.dbg(DEBUG_INFO, "Teardown done")
+        self.dataplane.kill(join_threads=True)
+        basic_logger.info("Teardown done")
 
     def runTest(self):
         self.assertTrue(self.controller.switch_socket is not None,
@@ -116,8 +151,8 @@
         # Poll controller with expect message type packet in
         # For now, a random packet from scapy tutorial
 
-        for of_port in interface_ofport_map.keys():
-            self.dbg(DEBUG_INFO, "PKT IN test, port " + str(of_port))
+        for of_port in basic_port_map.keys():
+            basic_logger.info("PKT IN test, port " + str(of_port))
             pkt=Ether()/IP(dst="www.slashdot.org")/TCP()/\
                 ("GET /index.html HTTP/1.0. port" + str(of_port))
             self.dataplane.send(of_port, str(pkt))
@@ -126,8 +161,11 @@
 
             self.assertTrue(response is not None, 
                             'Packet in message not received')
-            # Data has CRC on it, so take off last 4 bytes
-            self.assertEqual(str(pkt), response.data[:-4], 
+            if str(pkt) != response.data:
+                basic_logger.debug("pkt: "+str(pkt)+"  resp: " +
+                                   str(response))
+
+            self.assertEqual(str(pkt), response.data,
                              'Response packet does not match send packet')
 
 class PacketOutTestCase(SimpleDataPlaneTestCase):
@@ -143,27 +181,30 @@
         # These will get put into function
         outpkt=Ether()/IP(dst="www.slashdot.org")/TCP()/\
             "GET /index.html HTTP/1.0 \n\n"
-        msg = packet_out()
-        msg.data = str(outpkt)
-        act = action_output()
-        dp_port = act.port = interface_ofport_map.keys()[0]
-        self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
+        of_ports = basic_port_map.keys()
+        of_ports.sort()
+        for dp_port in of_ports:
+            msg = packet_out()
+            msg.data = str(outpkt)
+            act = action_output()
+            act.port = dp_port
+            self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
 
-        self.dbg(DEBUG_INFO, "pkt out to port " + str(dp_port))
-        rv = self.controller.message_send(msg)
-        self.assertTrue(rv == 0, "Error sending out message")
+            basic_logger.info("PacketOut to: " + str(dp_port))
+            rv = self.controller.message_send(msg)
+            self.assertTrue(rv == 0, "Error sending out message")
 
-        time.sleep(1) # @todo Implement poll timeout for test cases
-        (of_port, pkt, pkt_time) = self.dataplane.poll()
+            (of_port, pkt, pkt_time) = self.dataplane.poll(timeout=1)
 
-        self.assertTrue(pkt is not None, 'Packet not received')
-        if of_port is not None:
-            self.assertEqual(of_port, dp_port, "Unexpected receive port")
-        self.assertEqual(str(outpkt), str(pkt),
-                         'Response packet does not match send packet')
-
+            self.assertTrue(pkt is not None, 'Packet not received')
+            basic_logger.info("PacketOut: got pkt from " + str(of_port))
+            if of_port is not None:
+                self.assertEqual(of_port, dp_port, "Unexpected receive port")
+            self.assertEqual(str(outpkt), str(pkt),
+                             'Response packet does not match send packet')
 
 if __name__ == "__main__":
     unittest.main()
+
 #    suite = unittest.TestLoader().loadTestsFromTestCase(PacketOutTestCase)
 #    unittest.TextTestRunner(verbosity=2).run(suite) 
diff --git a/tests/local.py b/tests/local.py
new file mode 100644
index 0000000..0a3bc04
--- /dev/null
+++ b/tests/local.py
@@ -0,0 +1,15 @@
+"""
+Platform configuration file
+platform == local
+
+Update this file to override defaults
+"""
+
+def platform_config_update(config):
+    """
+    Update configuration for the local platform
+
+    @param config The configuration dictionary to use/update
+
+    Update this routine if values other the defaults are required
+    """
diff --git a/tests/oft b/tests/oft
new file mode 100755
index 0000000..1faa8a1
--- /dev/null
+++ b/tests/oft
@@ -0,0 +1,251 @@
+#!/usr/bin/env python
+"""
+@package oft
+
+OpenFlow test framework top level script
+
+This script is the entry point for running OpenFlow tests
+using the OFT framework.
+
+The global configuration is passed around in a dictionary
+ygenerally called config.  The keys have the following
+significance.
+
+    platform          : String identifying the target platform
+    controller_host   : Host on which test controller is running (for sockets)
+    controller_port   : Port on which test controller listens for switch cxn
+    port_count        : (Optional) Number of ports in dataplane
+    base_of_port      : (Optional) Base OpenFlow port number in dataplane
+    base_if_index     : (Optional) Base OS network interface for dataplane
+    test_spec         : (TBD) Specification of test(s) to run
+    log_file          : Filename for test logging
+    debug             : String giving debug level (info, warning, error...)
+    dbg_level         : logging module value of debug level
+    port_map          : Map of dataplane OpenFlow port to OS interface names
+
+See config_defaults below for the default values.
+
+To add configuration to the system, first add an entry to config_default
+below.  If you want this to be a command line parameter, edit config_setup
+to add the option and default value to the parser.  Then edit config_get
+to make sure the option value gets copied into the configuration 
+structure (which then gets passed to everyone else).
+
+By convention, oft attempts to import the contents of a file by the 
+name of $platform.py into the local namespace.  
+
+IMPORTANT: That file should define a function platform_config_update which
+takes a configuration dictionary as an argument and updates it for the
+current run.  In particular, it should set up config["port_map"] with
+the proper map from OF port numbers to OF interface names.
+
+You can add your own platform, say gp104, by adding a file gp104.py
+that defines the function platform_config_update and then use the
+parameter --platform=gp104 on the command line.
+
+If platform_config_update does not set config["port_map"], an attempt
+is made to generate a default map via the function default_port_map_setup.
+This will use "local" and "remote" for platform names if available
+and generate a sequential map based on the values of base_of_port and
+base_if_index in the configuration structure.
+
+@todo Determine and implement conventions for test_spec.
+
+The current model for test sets is basic.py.  The current convention is
+that the test set should implement a function test_set_init which takes
+an oft configuration dictionary and returns a unittest.TestSuite object.
+Future test sets should do the same thing.
+
+"""
+
+import sys
+from optparse import OptionParser
+import logging
+import unittest
+
+# Import test files
+import basic
+
+##@var DEBUG_LEVELS
+# Map from strings to debugging levels
+DEBUG_LEVELS = {
+    'debug'              : logging.DEBUG,
+    'verbose'            : logging.DEBUG,
+    'info'               : logging.INFO,
+    'warning'            : logging.WARNING,
+    'warn'               : logging.WARNING,
+    'error'              : logging.ERROR,
+    'critical'           : logging.CRITICAL
+}
+
+_debug_default = "warning"
+_debug_level_default = DEBUG_LEVELS[_debug_default]
+
+##@var config_default
+# The default configuration dictionary for OFT
+config_default = {
+    "platform"           : "local",
+    "controller_host"    : "127.0.0.1",
+    "controller_port"    : 6633,
+    "port_count"         : 4,
+    "base_of_port"       : 1,
+    "base_if_index"      : 1,
+    "test_spec"          : "basic",
+    "log_file"           : "oft.log",
+    "debug"              : _debug_default,
+    "dbg_level"          : _debug_level_default,
+    "port_map"           : {}
+}
+
+# Map options to config structure
+def config_get(opts):
+    "Convert options class to OFT configuration dictionary"
+    cfg = config_default.copy()
+    cfg["platform"] = opts.platform
+    cfg["controller_host"] = opts.controller_host
+    cfg["controller_port"] = opts.controller_port
+    cfg["test_spec"] = opts.test_spec
+    cfg["log_file"] = opts.log_file
+    if opts.debug not in DEBUG_LEVELS.keys():
+        print "Warning:  Bad value specified for debug level; using default"
+        opts.debug = _debug_default
+    cfg["debug"] = opts.debug
+    cfg["dbg_level"] = DEBUG_LEVELS[cfg["debug"]]
+    cfg["base_of_port"] = opts.base_of_port
+    cfg["base_if_index"] = opts.base_if_index
+    cfg["port_count"] = opts.port_count
+    return cfg
+
+def config_setup(cfg_dflt):
+    """
+    Set up the configuration including parsing the arguments
+
+    @param cfg_dflt The default configuration dictionary
+    @return A pair (config, args) where config is an config
+    object and args is any additional arguments from the command line
+    """
+
+    parser = OptionParser(version="%prog 0.1")
+
+    # Set up default values
+    parser.set_defaults(platform=cfg_dflt["platform"])
+    parser.set_defaults(controller_host=cfg_dflt["controller_host"])
+    parser.set_defaults(controller_port=cfg_dflt["controller_port"])
+    parser.set_defaults(test_spec=cfg_dflt["test_spec"])
+    parser.set_defaults(log_file=cfg_dflt["log_file"])
+    parser.set_defaults(debug=cfg_dflt["debug"])
+    parser.set_defaults(base_of_port=cfg_dflt["base_of_port"])
+    parser.set_defaults(base_if_index=cfg_dflt["base_if_index"])
+    parser.set_defaults(port_count=cfg_dflt["port_count"])
+
+    plat_help = """Set the platform type.  Valid values include:
+        local:  User space virtual ethernet pair setup
+        remote:  Remote embedded Broadcom based switch
+        """
+    parser.add_option("-P", "--platform", help=plat_help)
+    parser.add_option("-H", "--host", dest="controller_host",
+                      help="The IP/name of the test controller host")
+    parser.add_option("-p", "--port", dest="controller_port",
+                      type="int", help="Port number of the test controller")
+    parser.add_option("--test-spec", "--test-list", 
+                      help="Indicate tests to run (TBD)")
+    parser.add_option("--log-file", 
+                      help="Name of log file, empty string to log to console")
+    parser.add_option("--debug",
+                      help="Debug lvl: debug, info, warning, error, critical")
+    parser.add_option("--port_count",
+                      help="Number of ports to use (optional)")
+    parser.add_option("--base_of_port",
+                      help="Base OpenFlow port number (optional)")
+    parser.add_option("--base_if_index",
+                      help="Base interface index number (optional)")
+    # Might need this if other parsers want command line
+    # parser.allow_interspersed_args = False
+    (options, args) = parser.parse_args()
+
+    config = config_get(options)
+
+    return (config, args)
+
+def logging_setup(config):
+    """
+    Set up logging based on config
+    """
+    _format = "%(asctime)s  %(name)-10s: %(levelname)-8s: %(message)s"
+    _datefmt = "%H:%M:%S"
+    if config["log_file"]:
+        logging.basicConfig(filename=config["log_file"],
+                            level=config["dbg_level"],
+                            format=_format, datefmt=_datefmt)
+    #@todo Handle "no log file"
+
+def default_port_map_setup(config):
+    """
+    Setup the OF port mapping based on config
+    @param config The OFT configuration structure
+    @return Port map dictionary
+    """
+    if (config["base_of_port"] is None) or not config["port_count"]:
+        return None
+    port_map = {}
+    if config["platform"] == "local":
+        # For local, use every other veth port
+        for idx in range(config["port_count"]):
+            port_map[config["base_of_port"] + idx] = "veth" + \
+                str(config["base_if_index"] + (2 * idx))
+    elif config["platform"] == "remote":
+        # For remote, use eth ports
+        for idx in range(config["port_count"]):
+            port_map[config["base_of_port"] + idx] = "eth" + \
+                str(config["base_if_index"] + idx)
+    else:
+        return None
+
+    logging.info("Built default port map")
+    return port_map
+
+#
+# Main script
+#
+
+# Get configuration, set up logging, import platform from file
+(config, args) = config_setup(config_default)
+logging_setup(config)
+logging.info("*** STARTING TEST RUN ***")
+
+of_os_port_map = None
+if config["platform"]:
+    _imp_string = "from " + config["platform"] + " import *"
+    logging.info("Importing: " + _imp_string)
+    try:
+        exec(_imp_string)
+    except:
+        logging.warn("Failed to import " + config["platform"] + " file")
+
+try:
+    platform_config_update(config)
+except:
+    logging.warn("Could not run platform host configuration")
+
+if not config["port_map"]:
+    # Try to set up default port mapping if not done by platform
+    config["port_map"] = default_port_map_setup(config)
+
+if not config["port_map"]:
+    logging.critical("Interface port map is not defined.  Exiting")
+    print("Interface port map is not defined.  Exiting")
+    sys.exit(1)
+
+logging.debug("Configuration: " + str(config))
+logging.info("OF port map: " + str(config["port_map"]))
+
+# Init the test sets
+#@todo Use test-spec from config to determine which tests to run
+basic_suite = basic.test_set_init(config)
+if config["dbg_level"] >= logging.WARNING: _verb = 1
+else: _verb = 2
+
+unittest.TextTestRunner(verbosity=_verb).run(basic_suite)
+
+logging.info("*** END OF TESTS ***")
+
diff --git a/tests/remote.py b/tests/remote.py
new file mode 100644
index 0000000..07779f9
--- /dev/null
+++ b/tests/remote.py
@@ -0,0 +1,22 @@
+"""
+Platform configuration file
+platform == remote
+"""
+
+remote_port_map = {
+    23 : "eth2",
+    24 : "eth3",
+    25 : "eth4",
+    26 : "eth5"
+    }
+
+def platform_config_update(config):
+    """
+    Update configuration for the remote platform
+
+    @param config The configuration dictionary to use/update
+    This routine defines the port map used for this configuration
+    """
+
+    global remote_port_map
+    config["port_map"] = remote_port_map.copy()
