Aggressively purging Accton switch

Change-Id: Ie523895ecbb0a84b155b621f6b7cb8677a2edc83
diff --git a/src/python/oftest/base_tests.py b/src/python/oftest/base_tests.py
old mode 100644
new mode 100755
index a2b25ac..ec9b351
--- a/src/python/oftest/base_tests.py
+++ b/src/python/oftest/base_tests.py
@@ -14,17 +14,24 @@
 import oftest.controller as controller
 import oftest.dataplane as dataplane
 import ofp
+from ofdpa_utils import *
 
 class BaseTest(unittest.TestCase):
     def __str__(self):
         return self.id().replace('.runTest', '')
 
     def setUp(self):
+        if config["force_ofdpa_restart"]:
+            logging.info("Restarting OFDPA")
+            forceOfdpaRestart( config["force_ofdpa_restart"]);
         oftest.open_logfile(str(self))
         logging.info("** START TEST CASE " + str(self))
 
     def tearDown(self):
         logging.info("** END TEST CASE " + str(self))
+        if config["force_ofdpa_restart"]:
+            forceOfdpaStop( config["force_ofdpa_restart"]);
+
 
 class SimpleProtocol(BaseTest):
     """
@@ -33,7 +40,6 @@
 
     def setUp(self):
         BaseTest.setUp(self)
-
         self.controller = controller.Controller(
             switch=config["switch_ip"],
             host=config["controller_host"],
@@ -47,7 +53,6 @@
 
             # By default, respond to echo requests
             self.controller.keep_alive = True
-
             if not self.controller.active:
                 raise Exception("Controller startup failed")
             if self.controller.switch_addr is None: