Fix a small issus for Scale topo test.
- Clean up mn when clean up onos
Change-Id: I6b417f01c3fe86159850ae40a859d34287150f0b
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index 96ac405..71c7d3a 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -118,6 +118,13 @@
- Install ONOS cluster
- Connect to cli
"""
+ main.log.info( "Checking if mininet is already running" )
+ if len( main.topoScale ) < main.topoScaleSize:
+ main.log.info( "Mininet is already running. Stopping mininet." )
+ main.Mininet1.stopNet()
+ time.sleep(main.MNSleep)
+ else:
+ main.log.info( "Mininet was not running" )
main.case( "Starting up " + str( main.numCtrls ) +
" node(s) ONOS cluster" )
@@ -211,6 +218,7 @@
main.step( "Start ONOS cli" )
cliResult = main.TRUE
+ main.activeNodes = []
for i in range( main.numCtrls ):
cliResult = cliResult and \
main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
@@ -220,7 +228,7 @@
actual=stepResult,
onpass="Successfully start ONOS cli",
onfail="Failed to start ONOS cli" )
-
+ time.sleep( main.startUpSleep )
def CASE10( self, main ):
"""
@@ -231,27 +239,9 @@
main.case( "Starting up Mininet and verifying topology" )
main.caseExplanation = "Starting Mininet with a scalling topology and " +\
"comparing topology elements between Mininet and ONOS"
-
- main.log.info( "Checking if mininet is already running" )
- if len( main.topoScale ) < main.topoScaleSize:
- main.log.info( "Mininet is already running. Stopping mininet." )
- main.Mininet1.stopNet()
- time.sleep(main.MNSleep)
- else:
- main.log.info( "Mininet was not running" )
-
if main.topoScale:
main.currScale = main.topoScale.pop(0)
else: main.log.error( "topology scale is empty" )
-
- # remove device before setup topology
- devices = main.topo.getAllDevices( main )
- if( devices[0] != '[]' ): # because devices is a list witch contain 3 string, not contain list!
- temp = json.loads( devices[0] )
- devicesIdList = []
- for d in temp:
- main.CLIs[0].deviceRemove( d.get('id').encode() )
-
main.step( "Starting up TORUS %sx%s topology" % (main.currScale, main.currScale) )
main.log.info( "Constructing Mininet command" )