[ONOS-6901] Fix how the systemTest does not return any result when it forced to quit the test

Change-Id: If93c48d46e8dc2494046b42de21f732775d7f520
diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index 2af59d6..95039b0 100755
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -129,8 +129,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def intents( self, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -167,8 +166,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def intent( self, intentId, appId="org.onosproject.cli",
                 ip="DEFAULT", port="DEFAULT" ):
@@ -213,8 +211,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def apps( self, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -250,8 +247,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def activateApp( self, appName, ip="DEFAULT", port="DEFAULT", check=True ):
         """
@@ -307,8 +303,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def deactivateApp( self, appName, ip="DEFAULT", port="DEFAULT",
                        check=True ):
@@ -364,8 +359,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getApp( self, appName, project="org.onosproject.", ip="DEFAULT",
                 port="DEFAULT" ):
@@ -404,8 +398,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addHostIntent( self, hostIdOne, hostIdTwo, appId='org.onosproject.cli',
                        ip="DEFAULT", port="DEFAULT", vlanId="" ):
@@ -461,8 +454,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addPointIntent( self,
                         ingressDevice,
@@ -621,8 +613,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addSinglepointToMultipointIntent(self,
                        ingressDevice,
@@ -786,8 +777,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeIntent( self, intentId, appId='org.onosproject.cli',
                        ip="DEFAULT", port="DEFAULT" ):
@@ -820,8 +810,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getIntentsId( self ):
         """
@@ -845,8 +834,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeAllIntents( self, intentIdList ='ALL',appId='org.onosproject.cli',
                           ip="DEFAULT", port="DEFAULT", delay=5 ):
@@ -894,8 +882,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def hosts( self, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -932,8 +919,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getHost( self, mac, vlan="-1", ip="DEFAULT", port="DEFAULT" ):
         """
@@ -980,8 +966,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def topology( self, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -1016,8 +1001,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def devices( self, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -1054,8 +1038,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getIntentState( self, intentsId, intentsJson=None,
                         ip="DEFAULT", port="DEFAULT" ):
@@ -1111,8 +1094,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkIntentState( self, intentsId="ALL", expectedState='INSTALLED',
                           ip="DEFAULT", port="DEFAULT"):
@@ -1177,8 +1159,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def flows( self, ip="DEFAULT", port="DEFAULT", subjectClass=None, subjectKey=None ):
         """
@@ -1223,8 +1204,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getFlows( self, deviceId, flowId=None, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -1266,8 +1246,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def sendFlow( self, deviceId, flowJson, ip="DEFAULT", port="DEFAULT", debug=False ):
         """
@@ -1316,8 +1295,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addFlow( self,
                  deviceId,
@@ -1446,8 +1424,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeFlow( self, deviceId, flowId,
                        ip="DEFAULT", port="DEFAULT" ):
@@ -1486,8 +1463,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkFlowsState( self , ip="DEFAULT", port="DEFAULT" ):
         """
@@ -1514,8 +1490,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getNetCfg( self, ip="DEFAULT", port="DEFAULT",
                    subjectClass=None, subjectKey=None, configKey=None ):
@@ -1563,8 +1538,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setNetCfg( self, cfgJson, ip="DEFAULT", port="DEFAULT",
                    subjectClass=None, subjectKey=None, configKey=None ):
@@ -1609,8 +1583,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeNetCfg( self, ip="DEFAULT", port="DEFAULT",
                       subjectClass=None, subjectKey=None, configKey=None ):
@@ -1654,8 +1627,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createFlowBatch( self,
                       numSw = 1,
@@ -1861,8 +1833,7 @@
             return None, None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeFlowBatch( self, batch={},
                        ip="DEFAULT", port="DEFAULT" ):
@@ -1901,8 +1872,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getTopology( self, topologyOutput ):
         """
@@ -1920,12 +1890,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkStatus(
             self,
@@ -1984,12 +1952,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addGroup( self, deviceId, groupType, bucketList, appCookie, groupId, ip="DEFAULT", port="DEFAULT", debug=False ):
         """
@@ -2022,8 +1988,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def sendGroup( self, deviceId, groupJson, ip="DEFAULT", port="DEFAULT", debug=False ):
         """
@@ -2070,8 +2035,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getGroups( self, deviceId=None, appCookie=None, ip="DEFAULT", port="DEFAULT" ):
         """
@@ -2120,8 +2084,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeGroup( self, deviceId, appCookie,
                        ip="DEFAULT", port="DEFAULT" ):
@@ -2164,6 +2127,5 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
diff --git a/TestON/drivers/common/api/dockerapidriver.py b/TestON/drivers/common/api/dockerapidriver.py
index 3092bcd..3fac610 100644
--- a/TestON/drivers/common/api/dockerapidriver.py
+++ b/TestON/drivers/common/api/dockerapidriver.py
@@ -100,8 +100,7 @@
                 return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dockerCreateCT( self, onosImage="onosproject/onos:latest", onosNode="onos1" ):
         """
@@ -123,8 +122,7 @@
                 return ( main.FALSE, null)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dockerStartCT( self, ctID ):
         """
@@ -142,8 +140,7 @@
                 return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dockerStopCT( self, ctName ):
         """
@@ -164,8 +161,7 @@
             return main.TRUE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            #main.cleanup()
-            #main.exit()
+            #main.cleanAndExit()
 
     def dockerRestartCT( self, ctName ):
         """
@@ -183,8 +179,7 @@
                 return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dockerCheckCTName( self, ctName):
         """
@@ -206,8 +201,7 @@
             return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception! Continue tests..." )
-            #main.cleanup()
-            #main.exit()
+            #main.cleanAndExit()
 
     def dockerRemoveCT( self, ctName ):
         """
@@ -229,8 +223,7 @@
             return main.TRUE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception! Continuing..." )
-            #main.cleanup()
-            #main.exit()
+            #main.cleanAndExit()
 
     def dockerRemoveImage( self, imageRepoTag=None ):
         """
@@ -260,8 +253,7 @@
                 except Exception:
                     main.log.exception( self.name + ": Uncaught exception! Continuing..." )
                     rmResult = rmResult and main.FALSE
-                    #main.cleanup()
-                    #main.exit()
+                    #main.cleanAndExit()
         return rmResult
 
     def fetchLatestClusterFile( self, branch="master" ):
@@ -277,8 +269,7 @@
             return main.TRUE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosFormCluster( self, onosIPs, cmdPath, user="karaf", passwd="karaf" ):
         """
@@ -298,8 +289,7 @@
                 return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dockerIP( self, ctName ):
         """
@@ -313,6 +303,5 @@
 
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
diff --git a/TestON/drivers/common/cli/emulator/lincoedriver.py b/TestON/drivers/common/cli/emulator/lincoedriver.py
index ab6a7bc..d5e114a 100644
--- a/TestON/drivers/common/cli/emulator/lincoedriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoedriver.py
@@ -135,12 +135,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setInterfaceUp( self, intfs ):
         """
@@ -159,12 +157,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startSwitch( self, swId ):
         """
@@ -179,12 +175,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopSwitch( self, swId ):
         """
@@ -199,12 +193,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getDatapathId( self, swId ):
         """
@@ -220,12 +212,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def attachLincOESession( self ):
         """
@@ -260,12 +250,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def portUp( self, swId, ptId ):
         """
@@ -281,12 +269,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def portDown( self, swId, ptId ):
         """
@@ -302,12 +288,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopLincOEConsole( self ):
         """
@@ -351,12 +335,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 if __name__ != "__main__":
     import sys
diff --git a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
index 2b3b721..bfa466f 100644
--- a/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/lincoemininetdriver.py
@@ -86,7 +86,7 @@
             return main.FALSE
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
+            main.cleanAndExit()
             return main.FALSE
 
     def pingHostOptical( self, **pingParams ):
@@ -118,12 +118,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         main.log.info( self.name + ": Ping Response: " + response )
         if re.search( ',\s0\%\spacket\sloss', response ):
             main.log.info( self.name + ": no packets lost, host is reachable" )
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 7645921..531e5ca 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -116,12 +116,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startNet( self, topoFile='', args='', mnCmd='', timeout=120 ):
         """
@@ -248,12 +246,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def numSwitchesNlinks( self, topoType, depth, fanout ):
         try:
@@ -293,8 +289,7 @@
             return topoDict
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def calculateSwAndLinks( self ):
         """
@@ -310,8 +305,7 @@
             return topoDict
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingall( self, protocol="IPv4", timeout=300, shortCircuit=False, acceptableFailed=0 ):
         """
@@ -374,8 +368,7 @@
                                         ": EOF exception found" )
                         main.log.error( self.name + ":     " +
                                         self.handle.before )
-                        main.cleanup()
-                        main.exit()
+                        main.cleanAndExit()
                     elif i == 3:
                         response += self.handle.before
                         main.log.error( self.name +
@@ -402,8 +395,7 @@
                     return main.FALSE
             else:
                 main.log.error( self.name + ": Connection failed to the host" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except pexpect.TIMEOUT:
             if response:
                 main.log.info( "Pingall output: " + str( response ) )
@@ -412,8 +404,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def fpingHost( self, **pingParams ):
         """
@@ -439,8 +430,7 @@
             return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
     def pingallHosts( self, hostList, wait=1 ):
@@ -494,12 +484,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingIpv6Hosts( self, hostList, prefix='1000::', wait=1 ):
         """
@@ -548,12 +536,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingHost( self, **pingParams ):
         """
@@ -593,12 +579,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def ping6pair( self, **pingParams ):
         """
@@ -642,12 +626,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingHostSetAlternative( self, dstIPList, wait=1, IPv6=False ):
         """
@@ -681,8 +663,7 @@
                         isReachable = main.FALSE
                 elif i == 1:
                     main.log.error( self.name + ": function should be called from host CLI instead of Mininet CLI" )
-                    main.cleanup()
-                    main.exit()
+                    main.cleanAndExit()
                 elif i == 2:
                     main.log.error( self.name + ": timeout when waiting for response" )
                     isReachable = main.FALSE
@@ -695,12 +676,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return isReachable
 
     def checkIP( self, host ):
@@ -717,8 +696,7 @@
                 except pexpect.EOF:
                     main.log.error( self.name + ": EOF exception found" )
                     main.log.error( self.name + ":     " + self.handle.before )
-                    main.cleanup()
-                    main.exit()
+                    main.cleanAndExit()
 
                 pattern = "inet\s(addr|Mask):([0-1]{1}[0-9]{1,2}|" +\
                     "2[0-4][0-9]|25[0-5]|[0-9]{1,2}).([0-1]{1}" +\
@@ -737,8 +715,7 @@
                 main.log.error( self.name + ": Connection failed to the host" )
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def verifySSH( self, **connectargs ):
         # FIXME: Who uses this and what is the purpose? seems very specific
@@ -760,8 +737,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         import time
         time.sleep( 20 )
         if self.flag == 0:
@@ -862,8 +838,7 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
@@ -977,8 +952,7 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
@@ -1008,16 +982,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
                 return main.FALSE
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def changeDefaultGateway( self, host, newGW ):
         """
@@ -1039,16 +1011,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
                 return main.FALSE
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def addStaticMACAddress( self, host, GW, macaddr ):
         """
@@ -1070,16 +1040,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
                 return main.FALSE
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def verifyStaticGWandMAC( self, host ):
         """
@@ -1096,16 +1064,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
                 return main.FALSE
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def getMacAddress( self, host ):
         """
@@ -1120,12 +1086,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
             pattern = r'HWaddr\s([0-9A-F]{2}[:-]){5}([0-9A-F]{2})'
             macAddressSearch = re.search( pattern, response, re.I )
@@ -1150,12 +1114,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
             pattern = r'HWaddr\s([0-9A-F]{2}[:-]){5}([0-9A-F]{2})'
             macAddressSearch = re.search( pattern, response, re.I )
@@ -1187,12 +1149,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
             pattern = ''
             if proto == 'IPV4':
@@ -1223,12 +1183,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             pattern = r'^(?P<dpid>\w)+'
             result = re.search( pattern, response, re.MULTILINE )
             if result is None:
@@ -1256,17 +1214,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def getInterfaces( self, node ):
         """
@@ -1283,12 +1238,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             return response
         else:
             main.log.error( "Connection failed to the node" )
@@ -1303,12 +1256,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return response
 
     def intfs( self ):
@@ -1321,12 +1272,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return response
 
     def net( self ):
@@ -1336,12 +1285,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return response
 
     def links( self, timeout=20 ):
@@ -1352,12 +1299,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return response
 
     def iperftcpAll(self, hosts, timeout=6):
@@ -1376,8 +1321,7 @@
                             main.log.error(self.name + ": iperftcp test failed for " + host1 + " and " + host2)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def iperftcp(self, host1="h1", host2="h2", timeout=6):
         '''
@@ -1434,12 +1378,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def iperftcpipv6(self, host1="h1", host2="h2", timeout=50):
         main.log.info( self.name + ": Simple iperf TCP test between two hosts" )
@@ -1471,12 +1413,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ": " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def iperfudpAll(self, hosts, bandwidth="10M"):
         '''
@@ -1497,8 +1437,7 @@
             return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def iperfudp( self, bandwidth="10M", host1="h1", host2="h2"):
 
@@ -1550,17 +1489,14 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def nodes( self ):
         main.log.info( self.name + ": List all nodes." )
@@ -1572,12 +1508,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return response
 
     def pingpair( self ):
@@ -1590,12 +1524,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
         if re.search( ',\s0\%\spacket\sloss', response ):
             main.log.info( self.name + ": Ping between two hosts SUCCESSFUL" )
@@ -1627,12 +1559,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def switch( self, **switchargs ):
         """
@@ -1649,13 +1579,11 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return main.TRUE
 
     def node( self, nodeName, commandStr ):
@@ -1680,8 +1608,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         main.log.info( " response is :" )
         main.log.info( response )
         return response
@@ -1702,12 +1629,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return main.TRUE
 
     def plug( self, **plugargs ):
@@ -1726,12 +1651,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return main.TRUE
 
     def dpctl( self, **dpctlargs ):
@@ -1750,12 +1673,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return main.TRUE
 
     def getVersion( self ):
@@ -1772,8 +1693,7 @@
             return version
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getSwController( self, sw ):
         """
@@ -1795,12 +1715,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def assignSwController( self, sw, ip, port="6653", ptcp="" ):
         """
@@ -1926,18 +1844,15 @@
                 except pexpect.EOF:
                     main.log.error( self.name + ": EOF exception found" )
                     main.log.error( self.name + ":     " + self.handle.before )
-                    main.cleanup()
-                    main.exit()
+                    main.cleanAndExit()
             return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def deleteSwController( self, sw ):
         """
@@ -1951,12 +1866,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             main.log.info( response )
 
@@ -1993,12 +1906,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delSwitch( self, sw ):
         """
@@ -2028,12 +1939,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getSwitchRandom( self, timeout=60, nonCut=True ):
         """
@@ -2131,12 +2040,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delLink( self, node1, node2 ):
         """
@@ -2168,12 +2075,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getLinkRandom( self, timeout=60, nonCut=True ):
         """
@@ -2280,12 +2185,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delHost( self, hostname ):
         """
@@ -2316,12 +2219,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         """
@@ -2348,12 +2249,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopNet( self, fileName="", timeout=5 ):
         """
@@ -2402,17 +2301,14 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         else:
             main.log.error( self.name + ": Connection failed to the host" )
             response = main.FALSE
@@ -2455,12 +2351,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def decToHex( self, num ):
         return hex( num ).split( 'x' )[ 1 ]
@@ -2478,12 +2372,10 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + "     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception( self.name + ": Uncaught exception!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             pattern = "flow_count=(\d+)"
             result = re.search( pattern, response, re.MULTILINE )
             if result is None:
@@ -2510,12 +2402,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def flowTableComp( self, flowTable1, flowTable2 ):
         # This function compares the selctors and treatments of each flow
@@ -2549,8 +2439,7 @@
             return main.FALSE
         except Exception:
             main.log.exception( "Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def parseFlowTable( self, flowTable, version="", debug=True ):
         '''
@@ -2638,12 +2527,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getFlowTable( self, sw, version="", debug=False):
         '''
@@ -2690,12 +2577,10 @@
 
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkFlowId( self, sw, flowId, version="1.3", debug=True ):
         '''
@@ -2746,12 +2631,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
     def startTcpdump( self, filename, intf="eth0", port="port 6653" ):
@@ -2804,12 +2687,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopTcpdump( self ):
         """
@@ -2822,17 +2703,14 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getPorts( self, nodeName, verbose=False ):
         """
@@ -2882,12 +2760,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getOVSPorts( self, nodeName ):
         """
@@ -2924,12 +2800,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getSwitches( self, verbose=False ):
         """
@@ -2979,12 +2853,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getHosts( self, verbose=False ):
         """
@@ -3050,12 +2922,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getLinks( self, timeout=20 ):
         """
@@ -3099,12 +2969,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def compareSwitches( self, switches, switchesJson, portsJson ):
         """
@@ -3223,12 +3091,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def compareLinks( self, switches, links, linksJson ):
         """
@@ -3346,12 +3212,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def compareHosts( self, hosts, hostsJson ):
         """
@@ -3406,12 +3270,10 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getHostsOld( self ):
         """
@@ -3441,17 +3303,14 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getSwitch( self ):
         """
@@ -3497,17 +3356,14 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getGraphDict( self, timeout=60, useId=True, includeHost=False ):
         """
@@ -3602,8 +3458,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception" )
             return None
@@ -3629,17 +3484,14 @@
         except pexpect.TIMEOUT:
             main.log.error(self.name + ": TIMEOUT exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def assignVLAN( self, host, intf, vlan ):
         """
@@ -3693,8 +3545,7 @@
             except pexpect.TIMEOUT:
                 main.log.error(self.name + ": TIMEOUT exception found")
                 main.log.error(self.name + ":     " + self.handle.before)
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
@@ -3725,18 +3576,15 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             # namespace is not clear!
             main.log.error( name + " component already exists!" )
             # FIXME: Should we exit here?
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeHostComponent( self, name ):
         """
@@ -3760,12 +3608,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startHostCli( self, host=None ):
         """
@@ -3788,12 +3634,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def changeInterfaceStatus( self, devicename, intf, status ):
         '''
@@ -3817,16 +3661,13 @@
                 return main.FALSE
             except pexpect.EOF:
                 main.log.exception(self.name + ": connection closed.")
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except TypeError:
                 main.log.exception(self.name + ": TypeError")
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             except Exception:
                 main.log.exception(self.name + ": Uncaught exception!")
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         else:
             main.log.warn("Interface status should be up or down!")
             return main.FALSE
diff --git a/TestON/drivers/common/cli/emulator/remotemininetdriver.py b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
index 7566a85..71de94c 100644
--- a/TestON/drivers/common/cli/emulator/remotemininetdriver.py
+++ b/TestON/drivers/common/cli/emulator/remotemininetdriver.py
@@ -92,8 +92,7 @@
                 return main.FALSE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkForLoss( self, pingList ):
         """
@@ -126,12 +125,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingLong( self, **pingParams ):
         """
@@ -164,12 +161,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
     def pingstatus( self, **pingParams ):
@@ -206,12 +201,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingKill( self, testONUser, testONIP ):
         """
@@ -245,17 +238,14 @@
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found in pingKill" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingLongKill( self ):
         try:
@@ -274,12 +264,10 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":    " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pingHostOptical( self, **pingParams ):
         """
@@ -310,8 +298,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         main.log.info( self.name + ": Ping Response: " + response )
         if re.search( ',\s0\%\spacket\sloss', response ):
             main.log.info( self.name + ": no packets lost, host is reachable" )
@@ -351,12 +338,10 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":    " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checknum( self, num ):
         """
@@ -392,12 +377,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startTcpdump(
             self,
@@ -446,12 +429,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopTcpdump( self ):
         """
@@ -463,12 +444,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def runOpticalMnScript( self, name='onos', ctrllerIP=None ):
         import time
@@ -571,12 +550,10 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":    " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception(self.name + ": Uncaught exception!")
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setIpTablesOUTPUT( self, dstIp, dstPort, action='add',
                            packetType='tcp', rule='DROP' ):
@@ -718,8 +695,7 @@
                     except Exception:
                         main.log.exception( self.name +
                                             ": Uncaught exception!" )
-                        main.cleanup()
-                        main.exit()
+                        main.cleanAndExit()
                 else:
                     main.log.error(
                         "Given rule already exists, but attempted to add it" )
@@ -762,8 +738,7 @@
                     except Exception:
                         main.log.exception( self.name +
                                             ": Uncaught exception!" )
-                        main.cleanup()
-                        main.exit()
+                        main.cleanAndExit()
                 else:
                     main.log.error(
                         "Given rule does not exist,\
@@ -772,8 +747,7 @@
                 # NOTE: If a bad usage of this function occurs, exit the entire
                 # test
                 main.log.error( "Bad rule given for iptables. Exiting..." )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
 
 if __name__ != "__main__":
diff --git a/TestON/drivers/common/cli/emulator/scapyclidriver.py b/TestON/drivers/common/cli/emulator/scapyclidriver.py
index 59f5a48..74905f8 100644
--- a/TestON/drivers/common/cli/emulator/scapyclidriver.py
+++ b/TestON/drivers/common/cli/emulator/scapyclidriver.py
@@ -104,12 +104,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         """
@@ -179,8 +177,7 @@
             except pexpect.EOF:
                 main.log.error( self.name + ": EOF exception found" )
                 main.log.error( self.name + ":     " + self.handle.before )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         else:
             main.log.error( self.name + ": Connection failed to the host" )
             response = main.FALSE
@@ -207,13 +204,11 @@
             main.componentInit( name )
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             # namespace is not clear!
             main.log.error( name + " component already exists!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeHostComponent( self, name ):
         """
@@ -237,8 +232,7 @@
             return main.TRUE
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startHostCli( self, host=None ):
         """
@@ -261,12 +255,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startScapy( self, mplsPath="" ):
         """
@@ -300,12 +292,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def stopScapy( self ):
         """
@@ -320,12 +310,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildEther( self, **kwargs ):
         """
@@ -370,12 +358,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildIP( self, **kwargs ):
         """
@@ -430,12 +416,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildIPv6( self, **kwargs ):
         """
@@ -485,12 +469,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildTCP( self, ipVersion=4, **kwargs ):
         """
@@ -556,12 +538,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildUDP( self, ipVersion=4, **kwargs ):
         """
@@ -620,12 +600,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buildSCTP( self, ipVersion=4, **kwargs ):
         """
@@ -684,12 +662,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
 
     def buildARP( self, **kwargs ):
         """
@@ -745,12 +721,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
 
     def buildICMP( self, ipVersion=4, **kwargs ):
         """
@@ -816,12 +790,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup( )
-            main.exit( )
+            main.cleanAndExit()
 
     def sendPacket( self, iface=None, packet=None, timeout=1 ):
         """
@@ -864,12 +836,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startFilter( self, ifaceName=None, sniffCount=1, pktFilter="ip" ):
         """
@@ -902,12 +872,10 @@
             return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkFilter( self, timeout=10 ):
         """
@@ -921,12 +889,10 @@
                 return main.FALSE
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def killFilter( self ):
         """
@@ -941,12 +907,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def readPackets( self ):
         """
@@ -961,12 +925,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         return self.handle.before
 
     def updateSelf( self, IPv6=False ):
@@ -1000,12 +962,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getIp( self, ifaceName=None, IPv6=False ):
         """
@@ -1076,12 +1036,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getIfList( self ):
         """
@@ -1099,12 +1057,10 @@
             return None
         except pexpect.EOF:
             main.log.exception( self.name + ": connection closed." )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 if __name__ != "__main__":
     sys.modules[ __name__ ] = ScapyCliDriver()
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index ac33201..9636aa4 100755
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -126,12 +126,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         """
@@ -205,15 +203,13 @@
         except pexpect.EOF:
             main.log.error( self.name + ": eof exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except ValueError:
             main.log.error( self.name +
                             "ValueError exception in logout method" )
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setCell( self, cellname ):
         """
@@ -224,8 +220,7 @@
         try:
             if not cellname:
                 main.log.error( "Must define cellname" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             else:
                 self.handle.sendline( "cell " + str( cellname ) )
                 # Expect the cellname in the ONOSCELL variable.
@@ -250,12 +245,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": eof exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startOnosCli( self, ONOSIp, karafTimeout="",
                       commandlineTimeout=10, onosStartTimeout=60, waitForStart=False ):
@@ -335,12 +328,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def startCellCli( self, karafTimeout="",
                       commandlineTimeout=10, onosStartTimeout=60 ):
@@ -416,12 +407,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def log( self, cmdStr, level="", noExit=False ):
         """
@@ -452,8 +441,7 @@
                 main.cleanup()
                 return None
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
@@ -461,16 +449,14 @@
                 main.cleanup()
                 return None
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             if noExit:
                 main.cleanup()
                 return None
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def sendline( self, cmdStr, showResponse=False, debug=False, timeout=10, noExit=False, dollarSign=False ):
         """
@@ -502,11 +488,9 @@
                         if noExit:
                             return None
                         else:
-                            main.cleanup()
-                            main.exit()
+                            main.cleanAndExit()
                 else:
-                    main.cleanup()
-                    main.exit()
+                    main.cleanAndExit()
             if i == 2:
                 main.log.warn( "Timeout when testing cli responsiveness" )
                 main.log.debug( self.handle.before )
@@ -578,15 +562,13 @@
             if noExit:
                 return None
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             if noExit:
                 return None
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     # IMPORTANT NOTE:
     # For all cli commands, naming convention should match
@@ -626,12 +608,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeNode( self, nodeId ):
         """
@@ -661,12 +641,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def nodes( self, jsonFormat=True):
         """
@@ -692,12 +670,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def topology( self ):
         """
@@ -722,12 +698,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def deviceRemove( self, deviceId ):
         """
@@ -755,12 +729,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def devices( self, jsonFormat=True ):
         """
@@ -785,12 +757,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def balanceMasters( self ):
         """
@@ -818,12 +788,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkMasters( self, jsonFormat=True  ):
         """
@@ -848,12 +816,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkBalanceMasters( self, jsonFormat=True ):
         """
@@ -893,12 +859,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def links( self, jsonFormat=True, timeout=30 ):
         """
@@ -923,12 +887,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def ports( self, jsonFormat=True ):
         """
@@ -953,12 +915,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def roles( self, jsonFormat=True ):
         """
@@ -983,12 +943,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getRole( self, deviceId ):
         """
@@ -1019,12 +977,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def rolesNotNull( self ):
         """
@@ -1048,12 +1004,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def paths( self, srcId, dstId ):
         """
@@ -1081,12 +1035,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def hosts( self, jsonFormat=True ):
         """
@@ -1117,12 +1069,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getHost( self, mac ):
         """
@@ -1154,12 +1104,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getHostsId( self, hostList ):
         """
@@ -1196,12 +1144,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addHostIntent( self, hostIdOne, hostIdTwo, vlanId="", setVlan="", encap="", bandwidth="" ):
         """
@@ -1256,12 +1202,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addOpticalIntent( self, ingressDevice, egressDevice ):
         """
@@ -1304,12 +1248,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addPointIntent(
             self,
@@ -1446,12 +1388,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addMultipointToSinglepointIntent(
             self,
@@ -1606,12 +1546,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addSinglepointToMultipointIntent(
             self,
@@ -1767,12 +1705,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addMplsIntent(
             self,
@@ -1902,12 +1838,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeIntent( self, intentId, app='org.onosproject.cli',
                       purge=False, sync=False ):
@@ -1947,12 +1881,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeAllIntents( self, purge=False, sync=False, app='org.onosproject.cli', timeout=30 ):
         """
@@ -1990,12 +1922,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def purgeWithdrawnIntents( self ):
         """
@@ -2020,12 +1950,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def routes( self, jsonFormat=False ):
         """
@@ -2053,12 +1981,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def ipv4RouteNumber( self ):
         """
@@ -2083,12 +2009,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     #=============Function to check Bandwidth allocation========
     def allocations( self, jsonFormat = True, dollarSign = True ):
@@ -2113,12 +2037,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def intents( self, jsonFormat = True, summary = False, **intentargs):
         """
@@ -2163,12 +2085,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getIntentState(self, intentsId, intentsJson=None):
         """
@@ -2224,12 +2144,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkIntentState( self, intentsId, expectedState='INSTALLED' ):
         """
@@ -2299,12 +2217,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def compareBandwidthAllocations( self, expectedAllocations ):
         """
@@ -2352,12 +2268,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def compareIntent( self, intentDict ):
         """
@@ -2407,12 +2321,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkIntentSummary( self, timeout=60, noExit=True ):
         """
@@ -2452,8 +2364,7 @@
             if noExit:
                 return main.FALSE
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": ONOS timeout" )
             return None
@@ -2462,8 +2373,7 @@
             if noExit:
                 return main.FALSE
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def flows( self, state="", jsonFormat=True, timeout=60, noExit=False, noCore=False ):
         """
@@ -2499,12 +2409,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkFlowCount(self, min=0, timeout=60 ):
         count = self.getTotalFlowsNum( timeout=timeout )
@@ -2566,12 +2474,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pushTestIntents( self, ingress, egress, batchSize, offset="",
                          options="", timeout=10, background = False, noExit=False, getResponse=False ):
@@ -2625,15 +2531,13 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except TypeError:
             main.log.exception( self.name + ": Object not as expected" )
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getTotalFlowsNum( self, timeout=60, noExit=False ):
         """
@@ -2665,8 +2569,7 @@
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
             if not noExit:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             return None
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": ONOS timeout" )
@@ -2674,8 +2577,7 @@
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             if not noExit:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             return None
 
     def getTotalIntentsNum( self, timeout=60, noExit = False ):
@@ -2703,15 +2605,13 @@
             if noExit:
                 return -1
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             if noExit:
                 return -1
             else:
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
 
     def intentsEventsMetrics( self, jsonFormat=True ):
         """
@@ -2736,12 +2636,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def topologyEventsMetrics( self, jsonFormat=True ):
         """
@@ -2772,12 +2670,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     # Wrapper functions ****************
     # Wrapper functions use existing driver
@@ -2808,12 +2704,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def flowAddedCount( self, deviceId, core=False ):
         """
@@ -2839,12 +2733,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getAllDevicesId( self ):
         """
@@ -2885,12 +2777,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getAllNodesId( self ):
         """
@@ -2917,12 +2807,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getDevice( self, dpid=None ):
         """
@@ -2948,12 +2836,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getTopology( self, topologyOutput ):
         """
@@ -2974,12 +2860,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def checkStatus(self, numoswitch, numolink, numoctrl = -1, logLevel="info"):
         """
@@ -3046,12 +2930,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def deviceRole( self, deviceId, onosNode, role="master" ):
         """
@@ -3094,12 +2976,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def clusters( self, jsonFormat=True ):
         """
@@ -3124,12 +3004,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def electionTestLeader( self ):
         """
@@ -3175,12 +3053,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def electionTestRun( self ):
         """
@@ -3216,12 +3092,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def electionTestWithdraw( self ):
         """
@@ -3257,12 +3131,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getDevicePortsEnabledCount( self, dpid ):
         """
@@ -3287,12 +3159,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getDeviceLinksActiveCount( self, dpid ):
         """
@@ -3317,12 +3187,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getAllIntentIds( self ):
         """
@@ -3346,12 +3214,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def intentSummary( self ):
         """
@@ -3371,12 +3237,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def leaders( self, jsonFormat=True ):
         """
@@ -3401,12 +3265,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def leaderCandidates( self, jsonFormat=True ):
         """
@@ -3431,12 +3293,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def specificLeaderCandidate( self, topic ):
         """
@@ -3468,12 +3328,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def pendingMap( self, jsonFormat=True ):
         """
@@ -3496,12 +3354,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def partitions( self, candidates=False, jsonFormat=True ):
         """
@@ -3537,12 +3393,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def apps( self, summary=False, active=False, jsonFormat=True ):
         """
@@ -3577,12 +3431,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def appStatus( self, appName ):
         """
@@ -3619,12 +3471,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def app( self, appName, option ):
         """
@@ -3690,12 +3540,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def activateApp( self, appName, check=True ):
         """
@@ -3743,12 +3591,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def deactivateApp( self, appName, check=True ):
         """
@@ -3795,12 +3641,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def uninstallApp( self, appName, check=True ):
         """
@@ -3858,12 +3702,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def appIDs( self, jsonFormat=True ):
         """
@@ -3888,12 +3730,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def appToIDCheck( self ):
         """
@@ -3975,12 +3815,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getCfg( self, component=None, propName=None, short=False,
                 jsonFormat=True ):
@@ -4026,12 +3864,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setCfg( self, component, propName, value=None, check=True ):
         """
@@ -4083,12 +3919,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def distPrimitivesSend( self, cmd ):
         """
@@ -4134,12 +3968,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setTestAdd( self, setName, values ):
         """
@@ -4174,8 +4006,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setTestRemove( self, setName, values, clear=False, retain=False ):
         """
@@ -4238,8 +4069,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setTestGet( self, setName, values="" ):
         """
@@ -4319,8 +4149,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setTestSize( self, setName ):
         """
@@ -4366,8 +4195,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def counters( self, jsonFormat=True ):
         """
@@ -4397,12 +4225,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def counterTestAddAndGet( self, counter, delta=1 ):
         """
@@ -4438,8 +4264,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def counterTestGetAndAdd( self, counter, delta=1 ):
         """
@@ -4475,8 +4300,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def valueTestGet( self, valueName ):
         """
@@ -4509,8 +4333,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def valueTestSet( self, valueName, newValue ):
         """
@@ -4539,8 +4362,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def valueTestCompareAndSet( self, valueName, oldValue, newValue ):
         """
@@ -4583,8 +4405,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def valueTestGetAndSet( self, valueName, newValue ):
         """
@@ -4620,8 +4441,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def valueTestDestroy( self, valueName ):
         """
@@ -4647,8 +4467,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def summary( self, jsonFormat=True, timeout=30 ):
         """
@@ -4679,12 +4498,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def transactionalMapGet( self, keyName ):
         """
@@ -4721,8 +4538,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def transactionalMapPut( self, numKeys, value ):
         """
@@ -4773,8 +4589,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def maps( self, jsonFormat=True ):
         """
@@ -4799,12 +4614,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getSwController( self, uri, jsonFormat=True ):
         """
@@ -4827,12 +4640,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setSwController( self, uri, ip, proto="tcp", port="6653", jsonFormat=True ):
         """
@@ -4893,12 +4704,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeDevice( self, device ):
         '''
@@ -4936,12 +4745,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def removeHost( self, host ):
         '''
@@ -4977,12 +4784,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def link( self, begin, end, state, timeout=30, showResponse=True ):
         '''
@@ -5013,12 +4818,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def portstate( self, dpid, port, state ):
         '''
@@ -5053,12 +4856,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def logSet( self, level="INFO", app="org.onosproject" ):
         """
@@ -5079,17 +4880,14 @@
             return main.TRUE
         except pexpect.TIMEOUT:
             main.log.exception( self.name + ": TIMEOUT exception found" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getGraphDict( self, timeout=60, includeHost=False ):
         """
@@ -5258,17 +5056,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsShow( self, jsonFormat=True ):
         """
@@ -5297,15 +5092,13 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except NotImplementedError:
             main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def parseVplsShow( self ):
         """
@@ -5334,8 +5127,7 @@
             return output
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsList( self, jsonFormat=True ):
         """
@@ -5362,15 +5154,13 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except NotImplementedError:
             main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsCreate( self, network ):
         """
@@ -5399,12 +5189,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsDelete( self, network ):
         """
@@ -5434,12 +5222,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsAddIface( self, network, iface ):
         """
@@ -5472,12 +5258,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsRemIface( self, network, iface ):
         """
@@ -5508,12 +5292,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsClean( self ):
         """
@@ -5536,12 +5318,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def vplsSetEncap( self, network, encapType ):
         """
@@ -5575,12 +5355,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def interfaces( self, jsonFormat=True ):
         """
@@ -5608,15 +5386,13 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except NotImplementedError:
             main.log.exception( self.name + ": Json output not supported")
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getTimeStampFromLog( self, mode, searchTerm, splitTerm_before, splitTerm_after, startLine='', logNum=1 ):
         '''
@@ -5685,8 +5461,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueAddMultiple( self, queueName, value1, value2 ):
         """
@@ -5721,8 +5496,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueTakeAndComplete( self, queueName, number=1 ):
         """
@@ -5755,8 +5529,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueDestroy( self, queueName ):
         """
@@ -5786,8 +5559,7 @@
             return main.ERROR
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueTotalPending( self, queueName ):
         """
@@ -5820,8 +5592,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueTotalCompleted( self, queueName ):
         """
@@ -5854,8 +5625,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def workQueueTotalInProgress( self, queueName ):
         """
@@ -5888,5 +5658,4 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
diff --git a/TestON/drivers/common/cli/onosclusterdriver.py b/TestON/drivers/common/cli/onosclusterdriver.py
index 4be6191..63bee60 100755
--- a/TestON/drivers/common/cli/onosclusterdriver.py
+++ b/TestON/drivers/common/cli/onosclusterdriver.py
@@ -214,12 +214,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         """
@@ -274,17 +272,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             # namespace is not clear!
             main.log.error( name + " component already exists!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setRestOptions( self, name, host ):
         """
@@ -322,17 +317,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             # namespace is not clear!
             main.log.error( name + " component already exists!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setBenchOptions( self, name ):
         """
@@ -364,17 +356,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         else:
             # namespace is not clear!
             main.log.error( name + " component already exists!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createComponents( self, prefix='' ):
         """
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index f0ce0ce..eed4057 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -140,12 +140,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         """
@@ -187,8 +185,7 @@
             return epochMs
         except Exception:
             main.log.exception( 'Uncaught exception getting epoch time' )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosPackage( self, opTimeout=180 ):
         """
@@ -238,12 +235,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( "Failed to package ONOS" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosBuild( self ):
         """
@@ -273,8 +268,7 @@
             main.log.error( self.name + ":    " + self.handle.before )
         except Exception:
             main.log.exception( "Failed to build ONOS" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def cleanInstall( self, skipTest=False, mciTimeout=600 ):
         """
@@ -318,13 +312,13 @@
                     main.log.error( self.name + ":There is insufficient memory \
                             for the Java Runtime Environment to continue." )
                     # return main.FALSE
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
                 if i == 1:
                     main.log.error( self.name + ": Build failure!" )
                     # return main.FALSE
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
                 elif i == 2:
                     main.log.info( self.name + ": Build success!" )
                 elif i == 3 or i == 4:
@@ -341,23 +335,21 @@
                         self.name +
                         ": mvn clean install TIMEOUT!" )
                     # return main.FALSE
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
                 else:
                     main.log.error( self.name + ": unexpected response from " +
                                     "mvn clean install" )
                     # return main.FALSE
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def buckBuild( self, timeout=180 ):
         """
@@ -397,12 +389,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( "Failed to build and package ONOS" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def gitPull( self, comp1="", fastForward=True ):
         """
@@ -498,8 +488,8 @@
                 #       also don't know if we actually want to make the commit
                 main.log.error( "Git pull resulted in a merge commit message" +
                                 ". Exiting test!" )
-                main.cleanup()
-                main.exit()
+
+                main.cleanAndExit()
             elif i == 9:  # Merge commit message but swap file exists
                 main.log.error( "Git pull resulted in a merge commit message" +
                                 " but a swap file exists." )
@@ -509,8 +499,8 @@
                     return main.ERROR
                 except Exception:
                     main.log.exception( "Couldn't exit editor prompt!")
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
             elif i == 10:  # In the middle of a merge commit
                 main.log.error( "Git branch is in the middle of a merge. " )
                 main.log.warn( self.handle.before + self.handle.after )
@@ -529,12 +519,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def gitCheckout( self, branch="master" ):
         """
@@ -649,12 +637,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getBranchName( self ):
         import re
@@ -675,17 +661,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getVersion( self, report=False ):
         """
@@ -728,17 +711,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createCellFile( self, benchIp, fileName, mnIpAddrs,
                         appString, onosIpAddrs, onosUser="sdn", useSSH=True ):
@@ -832,12 +812,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setCell( self, cellname ):
         """
@@ -847,8 +825,8 @@
         try:
             if not cellname:
                 main.log.error( "Must define cellname" )
-                main.cleanup()
-                main.exit()
+
+                main.cleanAndExit()
             else:
                 self.handle.sendline( "cell " + str( cellname ) )
                 # Expect the cellname in the ONOSCELL variable.
@@ -867,18 +845,16 @@
                 if( re.search( "No such cell", cell_result ) ):
                     main.log.error( "Cell call returned: " + handleBefore +
                                handleAfter + handleMore )
-                    main.cleanup()
-                    main.exit()
+
+                    main.cleanAndExit()
                 return main.TRUE
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def verifyCell( self ):
         """
@@ -900,12 +876,10 @@
         except pexpect.ExceptionPexpect as e:
             main.log.exception( self.name + ": Pexpect exception found: " )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosCfgSet( self, ONOSIp, configName, configParam ):
         """
@@ -942,12 +916,10 @@
         except pexpect.ExceptionPexpect as e:
             main.log.exception( self.name + ": Pexpect exception found: " )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosCli( self, ONOSIp, cmdstr ):
         """
@@ -990,12 +962,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosSecureSSH( self, userName="onos", userPWD="rocks", node=""):
         """
@@ -1032,12 +1002,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
     def onosInstall( self, options="-f", node="" ):
@@ -1105,12 +1073,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosStart( self, nodeIp ):
         """
@@ -1142,17 +1108,15 @@
             else:
                 self.handle.expect( self.prompt )
                 main.log.error( "ONOS service failed to start" )
-                main.cleanup()
-                main.exit()
+
+                main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosStop( self, nodeIp ):
         """
@@ -1192,12 +1156,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosUninstall( self, nodeIp="" ):
         """
@@ -1219,12 +1181,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosDie( self, nodeIp ):
         """
@@ -1254,12 +1214,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosKill( self, nodeIp ):
         """
@@ -1298,12 +1256,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosRemoveRaftLogs( self ):
         """
@@ -1330,12 +1286,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosStartNetwork( self, mntopo ):
         """
@@ -1367,12 +1321,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def isup( self, node="", timeout=240 ):
         """
@@ -1399,12 +1351,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def preventAutoRespawn( self ):
         """
@@ -1421,12 +1371,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
     def pushTestIntentsShell(
@@ -1484,12 +1432,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def tsharkPcap( self, interface, dirFile ):
         """
@@ -1516,12 +1462,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosTopoCfg( self, onosIp, jsonFile ):
         """
@@ -1551,12 +1495,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def tsharkGrep( self, grep, directory, interface='eth0', grepOptions='' ):
         """
@@ -1597,12 +1539,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def tsharkStop( self ):
         """
@@ -1619,12 +1559,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def ptpd( self, args ):
         """
@@ -1657,12 +1595,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dumpONOSCmd(self, ONOSIp, CMD, destDir, filename, options=""):
         """
@@ -1765,8 +1701,7 @@
             main.log.error( self.name + ":    " + self.handle.before )
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def onosStatus( self, node="" ):
         """
@@ -1792,17 +1727,15 @@
             elif i == 2 or i == 3:
                 main.log.info( "ONOS is stopped" )
                 main.log.error( "ONOS service failed to check the status" )
-                main.cleanup()
-                main.exit()
+
+                main.cleanAndExit()
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setIpTables( self, ip, port='', action='add', packet_type='',
                      direction='INPUT', rule='DROP', states=True ):
@@ -1902,12 +1835,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def detailed_status(self, log_filename):
         """
@@ -1948,12 +1879,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createLinkGraphFile( self, benchIp, ONOSIpList, deviceCount):
         '''
@@ -2079,8 +2008,7 @@
             return None
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
 
         ONOSIp = [0]
@@ -2113,8 +2041,7 @@
             main.log.error("Incorrect Config settings: " + verification)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def configNullLink( self,fileName="/opt/onos/apache-karaf-3.0.3/etc/linkGraph.cfg", eventRate=0):
         '''
@@ -2143,16 +2070,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except AssertionError:
             main.log.info("Settings did not post to ONOS")
             main.log.error(varification)
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
             main.log.error(varification)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getOnosIps( self ):
         """
@@ -2178,17 +2103,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def logReport( self, nodeIp, searchTerms, outputMode="s", startStr=None, endStr=None ):
         """
@@ -2258,17 +2180,14 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def copyMininetFile( self, fileName, localPath, userName, ip,
                          mnPath='~/mininet/custom/', timeout = 60 ):
@@ -2318,13 +2237,11 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def jvmSet(self, memory=8):
 
@@ -2522,9 +2439,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":    " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
diff --git a/TestON/drivers/common/cli/ovsdbdriver.py b/TestON/drivers/common/cli/ovsdbdriver.py
index 18ccb2e..636a7b2 100644
--- a/TestON/drivers/common/cli/ovsdbdriver.py
+++ b/TestON/drivers/common/cli/ovsdbdriver.py
@@ -75,12 +75,10 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
         except Exception:
             main.log.exception( self.name + ": Uncaught exception!" )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def disconnect( self ):
         try:
@@ -111,8 +109,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delManager( self, delaytime="5" ):
         command= "sudo ovs-vsctl del-manager"
@@ -133,8 +130,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getManager( self ):
         command= "sudo ovs-vsctl get-manager"
@@ -146,8 +142,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def listBr( self ):
         """
@@ -169,8 +164,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def listPorts( self, sw ):
         """
@@ -192,8 +186,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def getController( self, sw ):
         """
@@ -214,8 +207,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def show( self ):
         """
@@ -236,8 +228,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def dumpFlows( self, sw, protocols=None ):
         """
@@ -262,8 +253,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createHost( self, hostname ):
         command = "sudo ip netns add " + str( hostname )
@@ -281,8 +271,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def createHostport(self, hostname="host1", hostport="host1-eth0", ovsport="port1", hostportmac="000000000001" ):
         command = "sudo ip link add " + str(hostport) +" type veth peer name " + str(ovsport)
@@ -304,8 +293,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def addPortToOvs(self, ifaceId, attachedMac, vmuuid, port="port1", ovsname="br-int" ):
         command = "sudo ovs-vsctl add-port " + str(ovsname) +" " + str(port)
@@ -329,8 +317,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def setHostportIp(self, ip, hostname="host1", hostport1="host1-eth0" ):
         command = "sudo ip netns exec " + str(hostname) +" ifconfig " + str(hostport1) + " " + str(ip)
@@ -348,8 +335,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def hostPing(self, src, target, hostname="host1" ):
         if src:
@@ -373,8 +359,7 @@
         except pexpect.EOF:
             main.log.error(self.name + ": EOF exception found")
             main.log.error(self.name + ":     " + self.handle.before)
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delBr( self, sw ):
         """
@@ -395,8 +380,7 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
 
     def delHost( self, hostname ):
         """
@@ -417,5 +401,4 @@
         except pexpect.EOF:
             main.log.error( self.name + ": EOF exception found" )
             main.log.error( self.name + ":     " + self.handle.before )
-            main.cleanup()
-            main.exit()
+            main.cleanAndExit()
diff --git a/TestON/drivers/common/clidriver.py b/TestON/drivers/common/clidriver.py
index aa8a12e..6f26cfc 100644
--- a/TestON/drivers/common/clidriver.py
+++ b/TestON/drivers/common/clidriver.py
@@ -330,8 +330,7 @@
                return returnVal
             elif i == 7:  # EOF
                 main.log.error( "Pexpect.EOF found!!!" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             elif i == 8:  # timeout
                 main.log.error(
                     "No route to the Host " +
@@ -410,27 +409,23 @@
                                      120 )
                 if j != 0:
                     main.log.error( "Incorrect Password" )
-                    main.cleanup()
-                    main.exit()
+                    main.cleanAndExit()
             elif i == 2:
                 main.log.error( "Connection timeout" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             elif i == 3:  # timeout
                 main.log.error(
                     "No route to the Host " +
                     uName +
                     "@" +
                     ipAddress )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             elif i == 4:
                 main.log.error(
                     "ssh: connect to host " +
                     ipAddress +
                     " port 22: Connection refused" )
-                main.cleanup()
-                main.exit()
+                main.cleanAndExit()
             elif i == 6:
                 main.log.info( "Password not required logged in" )