update my forked branch
diff --git a/TestON/tests/ScaleOutTemplate/README b/TestON/tests/ScaleOutTemplate/README
new file mode 100644
index 0000000..2d5ae1c
--- /dev/null
+++ b/TestON/tests/ScaleOutTemplate/README
@@ -0,0 +1,22 @@
+-------------------
+----Setup Guide----
+-------------------
+
+CASE 1: init case; cleans and sets up enviornment, starts up node 1
+
+CASE 2: Increments scale case; starts up additional nodes, determined by 'SCALE' in params
+ Ex: cluster size = 1 and scale = 2 ==> call CASE2 ==> cluster size = 3
+
+Params file:
+ SCALE = cluster scale step size
+ availableNodes = number of nodes you have provided data for in .topo file
+
+ ENV:
+ cellName = desired name of cell file to be created at runtime
+ cellFeatures = list of features desired
+ NOTE: webconsole, onos-api, onos-cli and onos-openflow are loaded automatically.
+ adjust your test and feature list accordingly
+ TEST:
+ skipCleanInstall = set yes if you want to skip for the sake of test debugging, otherwise set no
+
+
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.params b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.params
index 4dacc99..d4fa651 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.params
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.params
@@ -1,12 +1,18 @@
<PARAMS>
- <testcases>1,2</testcases>
+ <testcases>1,2,1,2,1,2,1,2</testcases>
+ <SCALE>1,3,5,7</SCALE>
+ <availableNodes>7</availableNodes>
+
<ENV>
- <cellName>cam_cells</cellName>
+ <cellName>defaultCell</cellName>
+ <cellApps></cellApps>
</ENV>
- <SCALE>2</SCALE>
+ <TEST>
+ <skipCleanInstall>yes</skipCleanInstall>
+ </TEST>
<GIT>
<autopull>on</autopull>
@@ -15,16 +21,32 @@
<CTRL>
<USER>admin</USER>
+
<ip1>10.128.5.51</ip1>
<port1>6633</port1>
+
<ip2>10.128.5.52</ip2>
<port2>6633</port2>
+
<ip3>10.128.5.53</ip3>
<port3>6633</port3>
+
+ <ip4>10.128.5.54</ip4>
+ <port4>6633</port4>
+
+ <ip5>10.128.5.65</ip5>
+ <port5>6633</port5>
+
+ <ip6>10.128.5.66</ip6>
+ <port6>6633</port6>
+
+ <ip7>10.128.5.67</ip7>
+ <port7>6633</port7>
+
</CTRL>
<MN>
- <ip1>10.128.5.59</ip1>
+ <ip1>10.128.5.55</ip1>
</MN>
<BENCH>
@@ -32,9 +54,6 @@
<ip1>10.128.5.55</ip1>
</BENCH>
- <TEST>
- </TEST>
-
<JSON>
</JSON>
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
index a75d694..4400262 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
@@ -4,133 +4,122 @@
#
# cameron@onlab.us
-import sys
-import os
+import sys
+import os.path
class ScaleOutTemplate:
- def __init__(self):
+
+ def __init__( self ):
self.default = ''
-
- def CASE1(self, main):
-
- global cluster_count
- cluster_count = 1
- checkout_branch = main.params['GIT']['checkout']
- git_pull = main.params['GIT']['autopull']
- cell_name = main.params['ENV']['cellName']
- BENCH_ip = main.params['BENCH']['ip1']
- BENCH_user = main.params['BENCH']['user']
- ONOS1_ip = main.params['CTRL']['ip1']
- ONOS2_ip = main.params['CTRL']['ip2']
- ONOS3_ip = main.params['CTRL']['ip3']
- MN1_ip = main.params['MN']['ip1']
+ def CASE1( self, main ):
+
+ import time
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Apps = main.params[ 'ENV' ][ 'cellApps' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+ BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ maxNodes = int(main.params[ 'availableNodes' ])
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
- main.log.step("Cleaning Enviornment...")
- main.ONOSbench.onos_uninstall(ONOS1_ip)
- main.ONOSbench.onos_uninstall(ONOS2_ip)
- main.ONOSbench.onos_uninstall(ONOS3_ip)
-
- main.step("Git checkout and pull "+checkout_branch)
- if git_pull == 'on':
- checkout_result = main.ONOSbench.git_checkout(checkout_branch)
- pull_result = main.ONOSbench.git_pull()
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
+ global scale
- else:
- checkout_result = main.TRUE
- pull_result = main.TRUE
- main.log.info("Skipped git checkout and pull")
+ clusterCount = 0
+ ONOSIp = [ 0 ]
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
- mvn_result = main.ONOSbench.clean_install()
-
- main.step("Set cell for ONOS cli env")
- main.ONOS1cli.set_cell(cell_name)
- main.ONOS2cli.set_cell(cell_name)
- main.ONOS3cli.set_cell(cell_name)
+ #Populate ONOSIp with ips from params
+ for i in range(1, maxNodes + 1):
+ ipString = 'ip' + str(i)
+ ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
- main.step("Creating ONOS package")
- package_result = main.ONOSbench.onos_package() #no file or directory
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
- main.step("Installing ONOS package")
- install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
-
- cell_name = main.params['ENV']['cellName']
- main.step("Applying cell file to environment")
- cell_apply_result = main.ONOSbench.set_cell(cell_name)
- main.step("verify cells")
- verify_cell_result = main.ONOSbench.verify_cell()
-
- main.step("Set cell for ONOS cli env")
- main.ONOS1cli.set_cell(cell_name)
- cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ # -- END OF INIT SECTION --#
+
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
+ main.log.step("Safety check, killing all ONOS processes")
+ main.log.step("before initiating enviornment setup")
+ for node in range(1, maxNodes + 1):
+ main.ONOSbench.onosDie(ONOSIp[node])
+
+ #Uninstall everywhere
+ main.log.step( "Cleaning Enviornment..." )
+ for i in range(1, maxNodes + 1):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( ONOSIp[i] )
+ #construct the cell file
+ main.log.info("Creating cell file")
+ cellIp = []
+ for node in range (1, clusterCount + 1):
+ cellIp.append(ONOSIp[node])
- def CASE2(self, main):
+ main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
- '''
- Increase number of nodes and initiate CLI
- '''
- import time
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
- global cluster_count
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+ for node in range(1, clusterCount + 1):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+
+ for node in range(1, clusterCount + 1):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+ main.log.info("Startup sequence complete")
+
+ def CASE2( self, main ):
+
+ print ("clusterCount: " + str(clusterCount))
+ print ("scale: " + str(scale))
+ print ("ONOSIp: " + str(ONOSIp))
+ print ("INIT: " + str(init))
- ONOS1_ip = main.params['CTRL']['ip1']
- ONOS2_ip = main.params['CTRL']['ip2']
- ONOS3_ip = main.params['CTRL']['ip3']
- #ONOS4_ip = main.params['CTRL']['ip4']
- #ONOS5_ip = main.params['CTRL']['ip5']
- #ONOS6_ip = main.params['CTRL']['ip6']
- #ONOS7_ip = main.params['CTRL']['ip7']
- cell_name = main.params['ENV']['cellName']
- scale = int(main.params['SCALE'])
-
- #Cluster size increased everytime the case is defined
- cluster_count += scale
-
- main.log.report("Increasing cluster size to "+
- str(cluster_count))
- install_result = main.FALSE
-
- if scale == 2:
- if cluster_count == 3:
- main.log.info("Installing nodes 2 and 3")
- install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
- install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
- cli2 = main.ONOS1cli.start_onos_cli(ONOS2_ip)
- cli3 = main.ONOS1cli.start_onos_cli(ONOS3_ip)
-
- '''
- elif cluster_count == 5:
-
- main.log.info("Installing nodes 4 and 5")
- node4_result = main.ONOSbench.onos_install(node=ONOS4_ip)
- node5_result = main.ONOSbench.onos_install(node=ONOS5_ip)
- install_result = node4_result and node5_result
- time.sleep(5)
-
- main.ONOS4cli.start_onos_cli(ONOS4_ip)
- main.ONOS5cli.start_onos_cli(ONOS5_ip)
-
- elif cluster_count == 7:
-
- main.log.info("Installing nodes 4 and 5")
- node6_result = main.ONOSbench.onos_install(node=ONOS6_ip)
- node7_result = main.ONOSbench.onos_install(node=ONOS7_ip)
- install_result = node6_result and node7_result
- time.sleep(5)
-
- main.ONOS6cli.start_onos_cli(ONOS6_ip)
- main.ONOS7cli.start_onos_cli(ONOS7_ip)
- '''
- if scale == 1:
- if cluster_count == 2:
- main.log.info("Installing node 2")
- install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
- cli2 = main.ONOS1cli.start_onos_cli(ONOS2_ip)
-
- if cluster_count == 3:
- main.log.info("Installing node 3")
- install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
- cli3 = main.ONOS1cli.start_onos_cli(ONOS3_ip)
-
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.topo b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.topo
index 88c4d35..0802eca 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.topo
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.topo
@@ -37,13 +37,13 @@
<connect_order>4</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS3cli>
-
+
<ONOS1>
<host>10.128.5.51</host>
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
- <connect_order>5</connect_order>
+ <connect_order>9</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS1>
@@ -52,7 +52,7 @@
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
- <connect_order>6</connect_order>
+ <connect_order>10</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS2>
@@ -61,16 +61,16 @@
<user>sdn</user>
<password>rocks</password>
<type>OnosDriver</type>
- <connect_order>7</connect_order>
+ <connect_order>11</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOS3>
<Mininet1>
- <host>10.128.5.59</host>
+ <host>10.128.5.55</host>
<user>admin</user>
<password>onos_test</password>
<type>MininetCliDriver</type>
- <connect_order>8</connect_order>
+ <connect_order>16</connect_order>
<COMPONENTS>
<arg1> --custom ~/mininet/custom/topo-2sw-2host.py </arg1>
<arg2> --arp --mac --topo mytopo</arg2>