Changes to tests and test names, updates tmplate
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
index b5a1e2e..abdc78c 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
@@ -13,26 +13,47 @@
def __init__( self ):
self.default = ''
- def CASE1( self, main ):
-
- global clusterCount
+ def CASE1( self, main ): #This is the initialization case
+ #this case will clean up all nodes
+ #but only node 1 is started in this case
+
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
clusterCount = 1
+ ONOSIp = [ 0 ]
+ #Load values from params file
checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
gitPull = main.params[ 'GIT' ][ 'autopull' ]
cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Features= main.params[ 'ENV' ][ 'cellFeatures' ]
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ maxNodes = int(main.params[ 'availableNodes' ])
+ Features = main.params[ 'ENV' ][ 'cellFeatures' ]
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ #Populate ONOSIp with ips from params
+ for i in range(1, maxNodes + 1):
+ ipString = 'ip' + str(i)
+ ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
+
+ #construct the cell file
+ main.log.info("Creating cell file")
+ exec "a = main.ONOSbench.createCellFile"
+ cellIp = []
+ for node in range (1, maxNodes + 1):
+ cellIp.append(ONOSIp[node])
+ a(BENCHIp,cellName,MN1Ip,str(Features), *cellIp)
+
+ #Uninstall everywhere
main.log.step( "Cleaning Enviornment..." )
- main.ONOSbench.onosUninstall( ONOS1Ip )
- main.ONOSbench.onosUninstall( ONOS2Ip )
- main.ONOSbench.onosUninstall( ONOS3Ip )
+ for i in range(1, maxNodes + 1):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( ONOSIp[i] )
+ #git
main.step( "Git checkout and pull " + checkoutBranch )
if gitPull == 'on':
checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
@@ -42,19 +63,19 @@
checkoutResult = main.TRUE
pullResult = main.TRUE
main.log.info( "Skipped git checkout and pull" )
-
- #mvnResult = main.ONOSbench.cleanInstall()
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
main.step( "Set cell for ONOS cli env" )
main.ONOS1cli.setCell( cellName )
- main.ONOS2cli.setCell( cellName )
- main.ONOS3cli.setCell( cellName )
-
+
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
main.step( "Installing ONOS package" )
- install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
+ install1Result = main.ONOSbench.onosInstall( node=ONOSIp[1] )
cellName = main.params[ 'ENV' ][ 'cellName' ]
main.step( "Applying cell file to environment" )
@@ -63,73 +84,29 @@
verifyCellResult = main.ONOSbench.verifyCell()
main.step( "Set cell for ONOS cli env" )
- main.ONOS1cli.setCell()
- cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
+ cli1 = main.ONOS1cli.startOnosCli( ONOSIp[1] )
def CASE2( self, main ):
- ''
+ # This case increases the cluster size by whatever scale is
+ # Note: 'scale' is the size of the step
+ # if scaling is not a part of your test, simply run this case
+ # once after CASE1 to set up your enviornment for your desired
+ # cluster size. If scaling is a part of you test call this case each time
+ # you want to increase cluster size
+
+ ''
'Increase number of nodes and initiate CLI'
''
import time
-
global clusterCount
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- #ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ]
- #ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
- #ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
- #ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
scale = int( main.params[ 'SCALE' ] )
-
- # Cluster size increased everytime the case is defined
clusterCount += scale
- main.log.report( "Increasing cluster size to " +
- str( clusterCount ) )
- installResult = main.FALSE
-
- if scale == 2:
- if clusterCount == 3:
- main.log.info( "Installing nodes 2 and 3" )
- install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
- install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
- cli2 = main.ONOS1cli.startOnosCli(ONOS1_ip)
- cli3 = main.ONOS1cli.startOnosCli(ONOS2_ip)
-
-
- #elif clusterCount == 5:
-
- # main.log.info( "Installing nodes 4 and 5" )
- # node4Result = main.ONOSbench.onosInstall( node=ONOS4Ip )
- # node5Result = main.ONOSbench.onosInstall( node=ONOS5Ip )
- # installResult = node4Result and node5Result
- # time.sleep( 5 )
-
- # main.ONOS4cli.startOnosCli( ONOS4Ip )
- # main.ONOS5cli.startOnosCli( ONOS5Ip )
-
- #elif clusterCount == 7:
-
- # main.log.info( "Installing nodes 4 and 5" )
- # node6Result = main.ONOSbench.onosInstall( node=ONOS6Ip )
- # node7Result = main.ONOSbench.onosInstall( node=ONOS7Ip )
- # installResult = node6Result and node7Result
- # time.sleep( 5 )
-
- # main.ONOS6cli.startOnosCli( ONOS6Ip )
- # main.ONOS7cli.startOnosCli( ONOS7Ip )
- #
-
- if scale == 1:
- if clusterCount == 2:
- main.log.info( "Installing node 2" )
- install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
- cli2 = main.ONOS1cli.startOnosCli(ONOS2_ip)
-
- if clusterCount == 3:
- main.log.info( "Installing node 3" )
- install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
- cli3 = main.ONOS1cli.startOnosCli(ONOS3_ip)
+ main.log.report( "Increasing cluster size to " + str( clusterCount ) )
+ for node in range((clusterCount - scale) + 1, clusterCount + 1):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+ exec "a = main.ONOS%scli.startOnosCli" %str(node)
+ a(ONOSIp[node])
+