[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/core/teston.py b/TestON/core/teston.py
index 3030f3f..0f45e04 100644
--- a/TestON/core/teston.py
+++ b/TestON/core/teston.py
@@ -754,6 +754,17 @@
os.system( "stty sane" ) # fix format if necessary
sys.exit()
+ def cleanAndExit( self ):
+ """
+ It will set the testcase result to be FAILED and update it
+ before cleaning up and exitting the test.
+ :return:
+ """
+ if self.CurrentTestCaseNumber:
+ self.testCaseResult[ str( self.CurrentTestCaseNumber ) ] = self.FALSE
+ self.logger.updateCaseResults( self )
+ self.cleanup()
+ self.exit()
def stop( self, email=False ):
"""
diff --git a/TestON/core/utilities.py b/TestON/core/utilities.py
index be15bc1..ed37ae3 100644
--- a/TestON/core/utilities.py
+++ b/TestON/core/utilities.py
@@ -336,12 +336,10 @@
return ret
except AssertionError:
main.log.exception( "Invalid arguements for retry: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
except Exception:
main.log.exception( "Uncaught exception in retry: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if __name__ != "__main__":
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" )
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 0de4a84..bbed3ec 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -62,7 +62,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
@@ -100,8 +100,7 @@
if not main.onoscell :
main.log.error("Please provide onoscell option at TestON CLI to run CHO tests")
main.log.error("Example: ~/TestON/bin/cli.py run CHOTestMonkey onoscell <cellName>")
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
setupResult = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
newCell=False, cellName=main.onoscell )
@@ -304,8 +303,7 @@
if not caseResult:
main.log.info( "Topology does not match, exiting test..." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE3( self, main ):
"""
@@ -346,8 +344,7 @@
onfail="Host discovery FAIL" )
if not stepResult:
main.log.debug( hosts )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Disable Reactive forwarding" )
appResult = main.controllers[ 0 ].CLI.deactivateApp( "org.onosproject.fwd" )
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
index a401bb2..f89e57d 100644
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
@@ -65,7 +65,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
main.cellName = main.params['ENV']['cellName']
@@ -90,8 +90,7 @@
onfail="Something is wrong with app Ids" )
if cliResults == main.FALSE:
main.log.error( "Failed to start ONOS,stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE2( self, main ):
"""
@@ -110,8 +109,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
bgplsConfig = BgpLs()
Ne_id = bgplsConfig.Constants()
@@ -209,8 +207,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
bgplsConfig = BgpLs()
Ne_id = bgplsConfig.Constants()
@@ -303,8 +300,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
bgplsConfig = BgpLs()
app = bgplsConfig.apps()
@@ -375,8 +371,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
bgplsConfig = BgpLs()
app = bgplsConfig.apps()
@@ -448,8 +443,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
bgplsConfig = BgpLs()
app = bgplsConfig.apps()
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index 0b02465..9b504ba 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -31,7 +31,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "SetUp not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -72,7 +72,7 @@
except ImportError as e:
print e
main.log.error("CheckingFlow not found exiting the test")
- main.exit()
+ main.cleanAndExit()
copyResult = main.ONOSbench.scp( main.Mininet1,
main.dependencyPath + main.topology,
main.Mininet1.home + '/custom/',
@@ -117,7 +117,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -619,8 +619,7 @@
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -1028,8 +1027,7 @@
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py b/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
index 0269f7e..4209947 100644
--- a/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
+++ b/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
@@ -22,8 +22,7 @@
stepResult = main.FALSE
except ValueError:
main.log.error( "Problem getting Flows state from REST API. Exiting test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
diff --git a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
index 3e59ab7..de50155 100644
--- a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
+++ b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
@@ -41,7 +41,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -125,7 +125,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
index b143fdb..7b8ded6 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
+++ b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
@@ -48,5 +48,4 @@
return None
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.py b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
index 9de5740..2b85fc2 100644
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
@@ -45,7 +45,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -123,7 +123,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -387,7 +387,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -417,8 +417,7 @@
mininetResult = main.Utils.mininetCleanup( main.Mininet1 )
# Exit if topology did not load properly
if not ( mininetResult and scapyResult ):
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE19( self, main ):
"""
@@ -428,7 +427,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index 7418965..6299ac2 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -1936,7 +1936,7 @@
from tests.dependencies.topology import Topology
except Exception:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except Exception:
@@ -2279,8 +2279,8 @@
return main.FALSE
except Exception:
main.log.exception( "checkLeaderChange: Uncaught exception!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+
main.log.info( "Checking Intent Paritions for Change in Leadership" )
mismatch = False
for dict1 in leaders1:
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index 03ab601..0f3fcf9 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -48,12 +48,13 @@
- Install ONOS package
- Build ONOS package
"""
+ main.cleanAndExit()
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -121,7 +122,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -401,7 +402,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -432,8 +433,7 @@
mininetResult = main.Utils.mininetCleanup( main.Mininet1 )
# Exit if topology did not load properly
if not ( mininetResult and scapyResult ):
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE19( self, main ):
"""
@@ -443,7 +443,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
index 5f29037..f4743ee 100644
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -1514,7 +1514,7 @@
from tests.dependencies.topology import Topology
except Exception:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -1697,8 +1697,7 @@
return main.FALSE
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "Checking Intent Paritions for Change in Leadership" )
mismatch = False
for dict1 in leaders1:
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
index 1f4d05d..912db21 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -44,7 +44,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
# Test variables
@@ -112,8 +112,8 @@
onpass="ONOS summary command succeded",
onfail="ONOS summary command failed" )
if not ready:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+ main.cleanAndExit()
main.step( "setup the ipv6NeighbourDiscovery" )
cfgResult1 = main.Cluster.active( 0 ).CLI.setCfg( "org.onosproject.incubator.net.neighbour.impl.NeighbourResolutionManager", "ndpEnabled", "true" )
@@ -148,8 +148,8 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+ main.cleanAndExit()
def CASE12( self, main ):
"""
@@ -177,8 +177,8 @@
ip=tempONOSip,
port='6633' )
if not assignResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+ main.cleanAndExit()
for i in range( 1, ( main.numSwitch + 1 ) ):
response = main.Mininet1.getSwController( "s" + str( i ) )
@@ -231,7 +231,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -240,8 +240,8 @@
topoResult = main.Utils.mininetCleanup( main.Mininet1 )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+ main.cleanAndExit()
def CASE1000( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
index 6bd4c6c..d4594aa 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
@@ -2008,8 +2008,8 @@
return main.FALSE
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
+
main.log.info( "Checking Intent Paritions for Change in Leadership" )
mismatch = False
for dict1 in leaders1:
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index 2b44494..ef5eb99 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
@@ -42,7 +42,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -95,7 +95,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -136,8 +136,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE11( self, main ):
"""
@@ -163,8 +162,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
tempONOSip = main.Cluster.getIps()
@@ -173,8 +171,7 @@
ip=tempONOSip,
port='6653' )
if not assignResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
assignResult = main.TRUE
for sw in swList:
@@ -201,7 +198,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -210,8 +207,7 @@
topoResult = main.Utils.mininetCleanup( main.Mininet1 )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE20( self, main ):
"""
@@ -236,8 +232,7 @@
s1Json = json.load( s1Jsondata )
except IOError:
main.log.exception( "s1Json File not found." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s1Json:" + str( s1Json ) )
main.s1Json = s1Json
@@ -281,8 +276,7 @@
s3Json = json.load( s3Jsondata )
except IOError:
main.log.exception( "s3Json File not found" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s3Json:" + str( s3Json ) )
main.s3Json = s3Json
@@ -329,8 +323,7 @@
assert main.s1Json, "s1Json not defined"
except AssertionError:
main.log.exception( "Case Prerequisites not set: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.case( "Check Devices After they initially connect to ONOS" )
main.netCfg.compareCfg( main )
@@ -395,8 +388,7 @@
s2Json = json.load( s2Jsondata )
except IOError:
main.log.exception( "s2Json File not found" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s2Json:" + str( s2Json ) )
main.s2Json = s2Json
setS2Allow = main.Cluster.active( 1 ).REST.setNetCfg( s2Json,
@@ -436,8 +428,7 @@
s4Json = json.load( s4Jsondata )
except IOError:
main.log.exception( "s4Json File not found" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s4Json:" + str( s4Json ) )
main.s4Json = s4Json
setS4Disallow = main.Cluster.active( 2 ).REST.setNetCfg( s4Json,
@@ -485,8 +476,7 @@
assert main.s2Json, "s2Json not defined"
except AssertionError:
main.log.exception( "Case Prerequisites not set: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.case( "Check Devices after all configurations are set" )
main.netCfg.compareCfg( main )
@@ -535,8 +525,7 @@
assert main.s4Json, "s4Json not defined"
except AssertionError:
main.log.exception( "Case Prerequisites not set: " )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.case( "Testing removal of configurations" )
main.step( "Remove 'allowed' configuration from all devices" )
@@ -684,8 +673,7 @@
main.s5Json = json.load( s5Jsondata )
except IOError:
main.log.exception( "s5Json File not found" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s5Json:" + str( main.s5Json ) )
try:
@@ -693,8 +681,7 @@
main.s6Json = json.load( s6Jsondata )
except IOError:
main.log.exception( "s6Json File not found" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "s6Json:" + str( main.s6Json ) )
s5Json = main.s5Json
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index 798c800..d518c5a 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -45,7 +45,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -117,7 +117,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
index bed1670..ce8620a 100644
--- a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
@@ -64,9 +64,7 @@
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()
def createConfig( main ):
"""
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index 12b3c8c..00d5cab 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -45,7 +45,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
# Test variables
@@ -101,8 +101,7 @@
fileName="TopoDDriver.json")
#Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.caseExplanation = "Start opticalTest.py topology included with ONOS"
main.step( "Starting mininet and LINC-OE" )
@@ -127,7 +126,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -136,8 +135,7 @@
topoResult = main.Utils.mininetCleanup( main.LincOE, timeout=180 )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE16( self, main ):
"""
@@ -186,7 +184,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -241,7 +239,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
index f16adb8..ad55a9a 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
@@ -63,7 +63,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -85,8 +85,7 @@
if cliResults == main.FALSE:
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "App Ids check" )
appCheck = main.Cluster.active( 0 ).CLI.appToIDCheck()
@@ -426,8 +425,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "Configure Network Subnet Port Start" )
main.case( "Configure Network Subnet Port" )
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
index 7893972..5d471ad 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
@@ -74,7 +74,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -92,8 +92,7 @@
cellName=cellName, removeLog=True )
if cliResults == main.FALSE:
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "App Ids check" )
appCheck = main.Cluster.active( 0 ).CLI.appToIDCheck()
@@ -123,8 +122,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Network Post test Start" )
main.case( "Virtual Network NBI Test - Network" )
@@ -196,8 +194,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Network Update test Start" )
main.case( "Virtual Network NBI Test - Network" )
@@ -282,8 +279,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Network Delete test Start" )
main.case( "Virtual Network NBI Test - Network" )
@@ -342,8 +338,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Subnet Post test Start" )
main.case( "Virtual Network NBI Test - Subnet" )
@@ -430,8 +425,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Subnet Update test Start" )
main.case( "Virtual Network NBI Test - Subnet" )
@@ -535,8 +529,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Subnet Delete test Start" )
main.case( "Virtual Network NBI Test - Subnet" )
@@ -611,8 +604,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Port Post test Start" )
main.case( "Virtual Network NBI Test - Port" )
@@ -718,8 +710,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Port Update test Start" )
main.case( "Virtual Network NBI Test - Port" )
@@ -840,8 +831,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Port Delete test Start" )
main.case( "Virtual Network NBI Test - Port" )
@@ -938,8 +928,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Post Error Json Create Network test Start" )
main.case( "Virtual Network NBI Test - Network" )
@@ -984,8 +973,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Post Error Json Create Subnet test Start" )
main.case( "Virtual Network NBI Test - Subnet" )
@@ -1043,8 +1031,7 @@
except ImportError:
main.log.exception( "Something wrong with import file or code error." )
main.log.info( "Import Error, please check!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "ONOS Post Error Json Create Subnet test Start" )
main.case( "Virtual Network NBI Test - Port" )
diff --git a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
index da20e97..08e437b 100644
--- a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
@@ -80,7 +80,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -174,8 +174,7 @@
onpass="ONOS summary command succeded",
onfail="ONOS summary command failed" )
if not ready:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
# Grab the time of restart so we chan check how long the gossip
# protocol has had time to work
diff --git a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
index 1f9f32d..026be2d 100644
--- a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
+++ b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
@@ -82,7 +82,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -189,8 +189,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.killCount += 1
diff --git a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
index 475759f..c3a2038 100644
--- a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
@@ -82,7 +82,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -176,12 +176,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:
for j in range( 0, n ):
if j not in main.partition:
@@ -196,12 +194,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.Cluster.runningNodes[ i ].active = False
iCtrl.Bench.exitFromSsh( this, iCtrl.ipAddress )
# NOTE: When dynamic clustering is finished, we need to start checking
@@ -247,8 +243,7 @@
"List of active nodes has duplicates, this likely indicates something was run out of order"
except AssertionError:
main.log.exception( "" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
'''
main.step( "Checking ONOS nodes" )
@@ -268,8 +263,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE7( self, main ):
"""
diff --git a/TestON/tests/HA/HAkillNodes/HAkillNodes.py b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
index e81dda9..63e34cb 100644
--- a/TestON/tests/HA/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
@@ -77,7 +77,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -177,8 +177,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE62( self, main ):
"""
diff --git a/TestON/tests/HA/HAsanity/HAsanity.py b/TestON/tests/HA/HAsanity/HAsanity.py
index 8332a2b..82eeac5 100644
--- a/TestON/tests/HA/HAsanity/HAsanity.py
+++ b/TestON/tests/HA/HAsanity/HAsanity.py
@@ -76,7 +76,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
diff --git a/TestON/tests/HA/HAscaling/HAscaling.py b/TestON/tests/HA/HAscaling/HAscaling.py
index 6a0abd4..cecd09e 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.py
+++ b/TestON/tests/HA/HAscaling/HAscaling.py
@@ -80,7 +80,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
@@ -184,8 +184,7 @@
onfail="Failled to generate new metadata file" )
time.sleep( 5 ) # Give time for nodes to read new file
except IndexError:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
activeNodes = [ i for i in range( 0, main.Cluster.numCtrls ) ]
newNodes = [ x for x in activeNodes if x not in prevNodes ]
@@ -226,8 +225,7 @@
onpass="ONOS summary command succeded",
onfail="ONOS summary command failed" )
if not ready:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
# Rerun for election on new nodes
runResults = main.TRUE
diff --git a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index f8d5a49..13a4913 100644
--- a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -85,7 +85,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -779,8 +779,7 @@
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE9( self, main ):
"""
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index 8e6bd6f..2c4f059 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -77,7 +77,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -174,8 +174,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE62( self, main ):
"""
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 923f67c..2de9f87 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -80,7 +80,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
from tests.HA.dependencies.HA import HA
@@ -219,8 +219,7 @@
onpass="ONOS summary command succeded",
onfail="ONOS summary command failed" )
if not ready:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
# Rerun for election on new nodes
runResults = main.TRUE
diff --git a/TestON/tests/HA/dependencies/HA.py b/TestON/tests/HA/dependencies/HA.py
index 11bc039..4a22dc4 100644
--- a/TestON/tests/HA/dependencies/HA.py
+++ b/TestON/tests/HA/dependencies/HA.py
@@ -52,8 +52,7 @@
except ( pexpect.TIMEOUT, pexpect.EOF ):
main.log.exception( "ONOSbench: pexpect exception found:" +
main.ONOSbench.handle.before )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def startingMininet( self ):
main.step( "Starting Mininet" )
@@ -214,8 +213,7 @@
return ( onosCounters, consistent )
except Exception:
main.log.exception( "" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def counterCheck( self, counterName, counterValue ):
"""
@@ -248,8 +246,7 @@
return consistent and correctResults
except Exception:
main.log.exception( "" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def consistentLeaderboards( self, nodes ):
TOPIC = 'org.onosproject.election'
@@ -359,8 +356,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Activate apps defined in the params file" )
# get data from the params
@@ -640,8 +636,7 @@
main.log.info( "Time for pingall: %2f seconds" %
( time2 - time1 ) )
if not pingResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
# timeout for fwd flows
time.sleep( 11 )
# uninstall onos-app-fwd
@@ -1063,8 +1058,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -2770,8 +2764,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
self.commonChecks()
@@ -2838,8 +2831,7 @@
"ONOSMastership[0] or mastershipState" )
main.log.debug( "ONOSMastership[0]: " + repr( ONOSMastership[ 0 ] ) )
main.log.debug( "mastershipState" + repr( mastershipState ) )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
mastershipCheck = main.TRUE
for i in range( 1, 29 ):
switchDPID = str(
@@ -3042,8 +3034,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -3388,8 +3379,7 @@
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def linkDown( self, main, fromS="s3", toS="s28" ):
"""
diff --git a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
index da99bd2..c27bd47 100644
--- a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
+++ b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
@@ -45,7 +45,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -272,8 +272,7 @@
tLastPostEnd = time.time()
if main.postFailed:
main.log.error( "Flow batch posting failed, exit test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check to ensure all flows are in added state." )
#pprint( main.addedBatchList )
diff --git a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
index f61c305..a64ad3a 100755
--- a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
@@ -106,12 +106,10 @@
onfail = "docker is not running")
if stepResult == main.FALSE:
main.log.warn("docker is not running - exiting test")
- main.exit()
- main.cleanup()
+ main.cleanAndExit()
if imageTagCounter > len( imageTagList ):
main.log.info("All images have been tested")
- main.exit()
- main.cleanup()
+ main.cleanAndExit()
def CASE5(self, main):
"""
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
index 79c1c18..7da7e54 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
@@ -39,7 +39,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -56,7 +56,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -103,7 +103,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -173,8 +173,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Assign switches to controllers.")
assignResult = main.TRUE
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
index a276634..553fa8e 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
@@ -39,7 +39,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -58,7 +58,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -103,7 +103,7 @@
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.testSetUp
except ( NameError, AttributeError ):
@@ -176,8 +176,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Assign switches to controllers.")
assignResult = main.TRUE
diff --git a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
index d87bc7e..0bafefb 100644
--- a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
@@ -35,7 +35,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
diff --git a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
index bfc0301..4244d79 100644
--- a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
+++ b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
@@ -41,7 +41,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error("ONOSSetup not found. exiting the test")
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
#Load values from params file
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
index fb6dec8..4298c3d 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
@@ -44,7 +44,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -167,7 +167,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index a781698..97f6039 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -50,7 +50,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index f58e715..78a2b34 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -49,7 +49,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index df3bfc7..285e12d 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -57,7 +57,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index f5edd3e..0c18564 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -48,7 +48,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -118,7 +118,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index 71758f6..0ecee0b 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -44,7 +44,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -137,7 +137,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
@@ -197,7 +197,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
@@ -280,8 +280,7 @@
main.log.info( "Finished this iteration, continue to scale next topology." )
else:
main.log.info( "Clean up and exit TestON. Finished this test." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE100( self, main ):
'''
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
index 6f2647d..ae30723 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
@@ -247,7 +247,7 @@
from tests.dependencies.topology import Topology
except ImportError:
main.log.error( "Topology not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.topoRelated
except ( NameError, AttributeError ):
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 6eb1c00..9ee512c 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -47,7 +47,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -284,7 +284,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
index 66aa0bf..66b3dc0 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
@@ -51,7 +51,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -105,7 +105,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Utils
except ( NameError, AttributeError ):
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index b81a674..cde275e 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -139,8 +139,7 @@
# if there are too many wrongs in this test, then exit
if main.wrong['totalWrong'] > main.maxWrong:
main.log.error( "The total wrong number exceeds %d, test terminated" % main.maxWrong )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def captureOfPack( main, deviceName, ofPack, switchStatus, resultDict, warmup ):
'''
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 9c73c0c..d83585a 100755
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -47,7 +47,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -146,8 +146,7 @@
main.pingChart = json.load( chart )
if not ready:
main.log.error( "ONOS startup failed!" )
- main.cleanup( )
- main.exit( )
+ main.cleanAndExit()
for ctrl in main.Cluster.active():
ctrl.CLI.logSet( "DEBUG", "org.onosproject.segmentrouting" )
@@ -169,8 +168,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup( )
- main.exit( )
+ main.cleanAndExit()
@staticmethod
def config( main, cfgName ):
@@ -213,8 +211,7 @@
else :
main.log.error( "Configuration failed!" )
- main.cleanup( )
- main.exit( )
+ main.cleanAndExit()
@staticmethod
def checkFlows( main, minFlowCount, dumpflows=True ):
@@ -396,7 +393,7 @@
from tests.dependencies.utils import Utils
except ImportError:
main.log.error( "Utils not found exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.utils
except ( NameError, AttributeError ):
@@ -444,8 +441,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to kill ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
topology = utilities.retry( main.Cluster.active( 0 ).checkStatus,
main.FALSE,
@@ -502,8 +498,7 @@
ctrl.name,
ctrl.CLI.sendline( "scr:list | grep -v ACTIVE" ) ) )
main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
topology = utilities.retry( main.Cluster.active( 0 ).CLI.checkStatus,
main.FALSE,
@@ -526,8 +521,7 @@
onfail="ONOS summary command failed" )
if not ready:
main.log.error( "ONOS startup failed!" )
- main.cleanup( )
- main.exit( )
+ main.cleanAndExit()
@staticmethod
def addHostCfg( main ):
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index 48b0a66..93f0735 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -45,8 +45,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Connect switches to controller" )
# connect all switches to controller
@@ -60,8 +59,7 @@
onpass="Successfully connect all switches to ONOS",
onfail="Failed to connect all switches to ONOS" )
if not swResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Set up tunnel from Mininet node to onos node" )
forwarding1 = '%s:2000:%s:2000' % ( '1.1.1.2', main.Cluster.active( 0 ).ipAddress )
@@ -76,8 +74,7 @@
onpass="Created tunnel succeeded",
onfail="Create tunnel failed" )
if ("PasswordAuthentication" not in tunnelResult) :
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE101( self, main ):
"""
@@ -95,7 +92,7 @@
from tests.USECASE.dependencies.sdnipBaseFunction import SdnBase
except ImportError:
main.log.error( "sdnBase not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.sdnBase
except ( NameError, AttributeError ):
@@ -121,8 +118,7 @@
time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
listResult = main.Cluster.active( 0 ).CLI.links( jsonFormat=False )
main.log.info( listResult )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Activate sdn-ip application" )
activeSDNIPresult = main.Cluster.active( 0 ).CLI.activateApp( "org.onosproject.sdnip" )
@@ -132,8 +128,7 @@
onfail="Activate SDN-IP failed" )
if not activeSDNIPresult:
main.log.info( "Activate SDN-IP failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.log.info( "Wait SDN-IP to finish installing connectivity intents \
@@ -260,8 +255,7 @@
main.Functions.checkP2PintentNum( main, 36 ) #6 intents from sw to speakers x 6 intents to sw x 2 intents between them
else:
main.log.error( "Stopping switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check ping between hosts behind BGP peers" )
result1 = main.Mininet.pingHost( src="h64514", target="h64515" )
@@ -275,8 +269,7 @@
onfail="Ping test result is wrong" )
if pingResult1 == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check ping between BGP peers and speakers" )
result4 = main.Mininet.pingHost( src="spk1", target="p64514" )
@@ -290,8 +283,7 @@
onfail="Speaker1 ping peers NOT successful" )
if pingResult2 == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -334,8 +326,7 @@
main.Functions.checkP2PintentNum( main, 42 )
else:
main.log.error( "Starting switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -386,8 +377,7 @@
main.Functions.checkP2PintentNum( main, 42 )
else:
main.log.error( "Stopping switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -442,8 +432,7 @@
main.log.debug( main.Mininet.checkFlows( "sw7" ) )
else:
main.log.error( "Starting switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
index 85b732d..a284213 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
@@ -121,12 +121,10 @@
"""
if len( speakers ) == 0:
main.log.error( "Parameter speakers can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if len( peers ) == 0:
main.log.error( "Parameter speakers can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if expectAllSuccess:
main.step( "BGP speakers ping peers, expect all tests to succeed" )
@@ -151,8 +149,7 @@
onfail = "Ping test results are Not expected" )
if result == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def pingHostToHost( main,
@@ -169,8 +166,7 @@
str( expectAllSuccess ) )
if len( hosts ) == 0:
main.log.error( "Parameter hosts can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
result = True
if expectAllSuccess:
@@ -194,7 +190,6 @@
'''
if result == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
'''
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 63940cb..d058a85 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -45,8 +45,7 @@
onfail="Failed to load topology" )
# Exit if topology did not load properly
if not topoResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Connect switches to controllers" )
# connect all switches to controllers
@@ -60,8 +59,7 @@
onpass="Successfully connect all switches to ONOS",
onfail="Failed to connect all switches to ONOS" )
if not swResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE101( self, main ):
@@ -89,7 +87,7 @@
from tests.USECASE.dependencies.sdnipBaseFunction import SdnBase
except ImportError:
main.log.error( "sdnBase not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.sdnBase
except ( NameError, AttributeError ):
@@ -117,8 +115,7 @@
onpass="ONOS correctly discovered all links",
onfail="ONOS Failed to discover all links" )
if linkNum < 100:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Activate sdn-ip application" )
activeSDNIPresult = main.Cluster.active( 0 ).CLI.activateApp( "org.onosproject.sdnip" )
@@ -128,8 +125,7 @@
onfail="Activate SDN-IP failed" )
if not activeSDNIPresult:
main.log.info( "Activate SDN-IP failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def CASE102( self, main ):
'''
@@ -259,8 +255,7 @@
main.Functions.checkP2PintentNum( main, 48 ) #14 * 2
else:
main.log.error( "Stopping switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check ping between hosts behind BGP peers" )
result1 = main.Mininet.pingHost( src="h64514", target="h64515" )
@@ -274,8 +269,7 @@
onfail="Ping test result is wrong" )
if pingResult1 == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check ping between BGP peers and spk1" )
result4 = main.Mininet.pingHost( src="spk1", target="p64514" )
@@ -289,8 +283,7 @@
onfail="Speaker1 ping peers NOT successful" )
if pingResult2 == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check ping between BGP peers and spk2" )
# TODO
@@ -305,8 +298,7 @@
onfail="Speaker2 ping peers NOT successful" )
if pingResult3 == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -345,8 +337,7 @@
main.Functions.checkP2PintentNum( main, 30 * 2 ) # 18*2
else:
main.log.error( "Starting switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -400,8 +391,7 @@
main.Functions.checkP2PintentNum( main, 30 * 2 ) #18 * 2
else:
main.log.error( "Stopping switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -458,8 +448,7 @@
main.log.debug( main.Mininet.checkFlows( "sw7" ) )
else:
main.log.error( "Starting switch failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
@@ -532,8 +521,7 @@
onfail="Kill spk1 failed" )
if ( "4" not in result3 ) :
main.log.info( result3 )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 7 )
@@ -588,8 +576,7 @@
onpass="Uninstall ONOS leader succeeded",
onfail="Uninstall ONOS leader failed" )
if uninstallResult != main.TRUE:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
if leaderIP == main.Cluster.active( 0 ).ipAddress:
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
index 3a042a5..36f1eb4 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
@@ -115,12 +115,10 @@
"""
if len( speakers ) == 0:
main.log.error( "Parameter speakers can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if len( peers ) == 0:
main.log.error( "Parameter speakers can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
if expectAllSuccess:
main.step( "BGP speakers ping peers, expect all tests to succeed" )
@@ -145,8 +143,7 @@
onfail = "Ping test results are Not expected" )
if result == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def pingHostToHost( main, hosts = ["h64514", "h64515", "h64516"],
@@ -162,8 +159,7 @@
str( expectAllSuccess ) )
if len( hosts ) == 0:
main.log.error( "Parameter hosts can not be empty." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
result = True
if expectAllSuccess:
@@ -187,8 +183,7 @@
'''
if result == False:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
'''
@@ -211,6 +206,5 @@
onpass = "Created tunnel succeeded",
onfail = "Create tunnel failed" )
if ( "PasswordAuthentication" not in tunnelResult ) :
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
diff --git a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
index 0b8c85d..d0f4ed7 100644
--- a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
+++ b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
@@ -56,7 +56,7 @@
main.testSetUp = ONOSSetup()
except ImportError:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
diff --git a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
index e51318c..1d913cc 100644
--- a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
+++ b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
@@ -11,7 +11,7 @@
main.testSetUp = ONOSSetup()
except Exception:
main.log.error( "ONOSSetup not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
main.testSetUp.envSetupDescription()
main.testSetUp.envSetup()
main.apps = main.params[ 'ENV' ][ 'appString' ]
@@ -41,8 +41,7 @@
if not ready:
main.log.error( "ONOS startup failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def pToPIntentTest( self, intentExpectedNum ):
'''
@@ -155,8 +154,7 @@
main.Functions.checkM2SintentNum( main, link1IntentNum )
else:
main.log.error( "Bring " + upOrDown + " link failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Bring " + upOrDown + " the link between sw8 and " + link2Peer )
linkResult2 = main.Mininet.link( END1="sw8", END2=link2Peer,
@@ -171,8 +169,7 @@
main.Functions.checkM2SintentNum( main, link2IntentNum )
else:
main.log.error( "Bring " + upOrDown + " link failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Bring " + upOrDown + " the link between sw28 and "+ link3Peer )
linkResult3 = main.Mininet.link( END1="sw28", END2=link3Peer,
@@ -187,8 +184,7 @@
main.Functions.checkM2SintentNum( main, link3IntentNum )
else:
main.log.error( "Bring " + upOrDown + " link failed!" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
diff --git a/TestON/tests/dependencies/Cluster.py b/TestON/tests/dependencies/Cluster.py
index 6b18b8b..36811ba 100644
--- a/TestON/tests/dependencies/Cluster.py
+++ b/TestON/tests/dependencies/Cluster.py
@@ -405,8 +405,7 @@
getattr( ctrl, drivers[ specificDriver ] ) ), function )
except AttributeError:
main.log.error( "Function " + function + " not found. Exiting the Test." )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
t = main.Thread( target=f,
name=function + "-" + ctrl.name,
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index ddf0570..81a1b25 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -38,7 +38,7 @@
from tests.dependencies.Cluster import Cluster
except ImportError:
main.log.error( "Cluster not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Cluster
except ( NameError, AttributeError ):
@@ -60,7 +60,7 @@
actual=stepResult,
onpass="Successfully checkout onos branch.",
onfail="Failed to checkout onos branch. Exiting test..." )
- if not stepResult: main.exit()
+ if not stepResult: main.cleanAndExit()
main.step( "Git Pull on ONOS branch:" + gitBranch )
stepResult = main.ONOSbench.gitPull()
@@ -68,7 +68,7 @@
actual=stepResult,
onpass="Successfully pull onos. ",
onfail="Failed to pull onos. Exiting test ..." )
- if not stepResult: main.exit()
+ if not stepResult: main.cleanAndExit()
else:
main.log.info( "Skipped git checkout and pull as they are disabled in params file" )
@@ -89,7 +89,7 @@
from tests.dependencies.Cluster import Cluster
except ImportError:
main.log.error( "Cluster not found. exiting the test" )
- main.exit()
+ main.cleanAndExit()
try:
main.Cluster
except ( NameError, AttributeError ):
@@ -107,8 +107,7 @@
* includeGitPull - exceeption code e.
"""
main.log.exception( e )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
def evnSetupConclusion( self, stepResult ):
"""
@@ -242,8 +241,7 @@
onpass="Successfully installed ONOS package",
onfail="Failed to install ONOS package" )
if not onosInstallResult:
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
return onosInstallResult
def setupSsh( self, cluster ):
@@ -295,8 +293,7 @@
startCliResult = cluster.startCLIs()
if not startCliResult:
main.log.info( "ONOS CLI did not start up properly" )
- main.cleanup()
- main.exit()
+ main.cleanAndExit()
else:
main.log.info( "Successful CLI startup" )
utilities.assert_equals( expect=main.TRUE,