pep8 test commit
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index bbcca46..2f9e752 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -144,12 +144,12 @@
# and that this driver will have to change accordingly
self.handle.expect(str(cellname))
- handle_before = self.handle.before
- handle_after = self.handle.after
+ handleBefore = self.handle.before
+ handleAfter = self.handle.after
# Get the rest of the handle
self.handle.sendline("")
self.handle.expect("\$")
- handle_more = self.handle.before
+ handleMore = self.handle.before
main.log.info( "Cell call returned: " + handleBefore +
handleAfter + handleMore )
diff --git a/TestON/tests/IntentsLoad/.IntentsLoad.py.swo b/TestON/tests/IntentsLoad/.IntentsLoad.py.swo
new file mode 100644
index 0000000..fe9088a
--- /dev/null
+++ b/TestON/tests/IntentsLoad/.IntentsLoad.py.swo
Binary files differ
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.py b/TestON/tests/IntentsLoad/IntentsLoad.py
index f13e60d..faaec26 100644
--- a/TestON/tests/IntentsLoad/IntentsLoad.py
+++ b/TestON/tests/IntentsLoad/IntentsLoad.py
@@ -4,260 +4,290 @@
#
# cameron@onlab.us
-import sys
-import os
+import sys
+import os
class IntentsLoad:
- 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 ):
- 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()
-
+ global clusterCount
+ clusterCount = 1
+
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ 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' ]
+
+ main.log.step( "Cleaning Enviornment..." )
+ main.ONOSbench.onosUninstall( ONOS1Ip )
+ main.ONOSbench.onosUninstall( ONOS2Ip )
+ main.ONOSbench.onosUninstall( ONOS3Ip )
+
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
else:
- checkout_result = main.TRUE
- pull_result = main.TRUE
- main.log.info("Skipped git checkout and pull")
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
- #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)
+ #mvnResult = main.ONOSbench.cleanInstall()
- main.step("Creating ONOS package")
- package_result = main.ONOSbench.onos_package() #no file or directory
+ main.step( "Set cell for ONOS cli env" )
+ main.ONOS1cli.setCell( cellName )
+ main.ONOS2cli.setCell( cellName )
+ main.ONOS3cli.setCell( cellName )
- main.step("Installing ONOS package")
- install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage() # no file or directory
- 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( "Installing ONOS package" )
+ install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
- main.step("Set cell for ONOS cli env")
- main.ONOS1cli.set_cell(cell_name)
-
- cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.step( "Applying cell file to environment" )
+ cellApplyResult = main.ONOSbench.setCell( cellName )
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
- def CASE2(self, main):
+ main.step( "Set cell for ONOS cli env" )
+ main.ONOS1cli.setCell( cellName )
- '''
+ cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
+
+ def CASE2( self, main ):
+ """
Increase number of nodes and initiate CLI
- '''
- import time
-
- global cluster_count
-
- 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'])
+ """
+ import time
+ global clusterCount
- #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
-
+ 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 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.ONOS2cli.start_onos_cli(ONOS2_ip)
- cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip)
- '''
- elif cluster_count == 5:
+ 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.ONOS2cli.startOnosCli( ONOS2Ip )
+ cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+ """
+ 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.ONOS2cli.startOnosCli( ONOS2Ip )
- 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)
+ if clusterCount == 3:
+ main.log.info( "Installing node 3" )
+ install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+ cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
- 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.ONOS2cli.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.ONOS3cli.start_onos_cli(ONOS3_ip)
-
-
-
- def CASE3(self,main):
- import time
- import json
- import string
-
- intents_rate = main.params['JSON']['intents_rate']
-
- default_sw_port = main.params[ 'CTRL' ][ 'port1' ]
-
- main.Mininet1.assign_sw_controller(sw="1", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="2", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="3", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="4", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="5", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="6", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="7", ip1=ONOS1_ip, port1=default_sw_port )
-
- mn_arp = main.params['TEST']['arping']
- main.Mininet1.handle.sendline(mn_arp)
-
- generate_load = main.params['TEST']['loadstart']
-
- main.ONOS1.handle.sendline(generate_load)
- main.ONOS1.handle.expect("sdn")
- print("before: ", main.ONOS1.handle.before)
- print("after: ",main.ONOS1.handle.after)
-
- load_confirm = main.ONOS1.handle.after
- if load_confirm == "{}":
- main.log.info("Load started")
-
- else:
- main.log.error("Load start failure")
- main.log.error("expected '{}', got: " + str(load_confirm))
-
- devices_json_str = main.ONOS1cli.devices()
- devices_json_obj = json.loads(devices_json_str)
-
- get_metric = main.params['TEST']['metric1']
- test_duration = main.params['TEST']['duration']
- stop = time.time() + float(test_duration)
-
-
- main.log.info("Starting test loop...")
- log_interval = main.params['TEST']['log_interval']
-
- while time.time() < stop:
- time.sleep(float(log_interval))
-
- intents_json_str_1 = main.ONOS1cli.intents_events_metrics()
- intents_json_obj_1 = json.loads(intents_json_str_1)
- main.log.info("Node 1 rate: " + str(intents_json_obj_1[intents_rate]['m1_rate']))
- last_rate_1 = intents_json_obj_1[intents_rate]['m1_rate']
-
- stop_load = main.params['TEST']['loadstop']
- main.ONOS1.handle.sendline(stop_load)
-
-
- msg = ("Final rate on node 1: " + str(last_rate_1))
- main.log.report(msg)
-
- def CASE4(self, main): #2 node scale
+ def CASE3( self, main ):
import time
import json
import string
- intents_rate = main.params['JSON']['intents_rate']
-
- default_sw_port = main.params[ 'CTRL' ][ 'port1' ]
+ intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
- main.Mininet1.assign_sw_controller(sw="1", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="2", ip1=ONOS2_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="3", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="4", ip1=ONOS2_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="5", ip1=ONOS1_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="6", ip1=ONOS2_ip, port1=default_sw_port )
- main.Mininet1.assign_sw_controller(sw="7", ip1=ONOS1_ip, port1=default_sw_port )
+ defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
- mn_arp = main.params['TEST']['arping']
- main.Mininet1.handle.sendline(mn_arp)
+ main.Mininet1.assignSwController(
+ sw="1",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="2",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="3",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="4",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="5",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="6",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="7",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
- generate_load = main.params['TEST']['loadstart']
+ mnArp = main.params[ 'TEST' ][ 'arping' ]
+ main.Mininet1.handle.sendline( mnArp )
- main.ONOS1.handle.sendline(generate_load)
- main.ONOS2.handle.sendline(generate_load)
+ generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
- devices_json_str_1 = main.ONOS1cli.devices()
- devices_json_obj_1 = json.loads(devices_json_str_1)
- devices_json_str_2 = main.ONOS2cli.devices()
- devices_json_obj_2 = json.loads(devices_json_str_2)
+ main.ONOS1.handle.sendline( generateLoad )
+ main.ONOS1.handle.expect( "sdn" )
+ print( "before: ", main.ONOS1.handle.before )
+ print( "after: ", main.ONOS1.handle.after )
- get_metric = main.params['TEST']['metric1']
- test_duration = main.params['TEST']['duration']
- stop = time.time() + float(test_duration)
+ loadConfirm = main.ONOS1.handle.after
+ if loadConfirm == "{}":
+ main.log.info( "Load started" )
+ else:
+ main.log.error( "Load start failure" )
+ main.log.error( "expected '{}', got: " + str( loadConfirm ) )
- main.log.info("Starting test loop...")
- log_interval = main.params['TEST']['log_interval']
+ devicesJsonStr = main.ONOS1cli.devices()
+ devicesJsonObj = json.loads( devicesJsonStr )
+
+ getMetric = main.params[ 'TEST' ][ 'metric1' ]
+ testDuration = main.params[ 'TEST' ][ 'duration' ]
+ stop = time.time() + float( testDuration )
+
+ main.log.info( "Starting test loop..." )
+ logInterval = main.params[ 'TEST' ][ 'log_interval' ]
while time.time() < stop:
- time.sleep(float(log_interval))
+ time.sleep( float( logInterval ) )
- intents_json_str_1 = main.ONOS1cli.intents_events_metrics()
- intents_json_obj_1 = json.loads(intents_json_str_1)
- main.log.info("Node 1 rate: " + str(intents_json_obj_1[intents_rate]['m1_rate']))
- last_rate_1 = intents_json_obj_1[intents_rate]['m1_rate']
-
- intents_json_str_2 = main.ONOS2cli.intents_events_metrics()
- intents_json_obj_2 = json.loads(intents_json_str_2)
- main.log.info("Node 2 rate: " + str(intents_json_obj_2[intents_rate]['m1_rate']))
- last_rate_2 = intents_json_obj_2[intents_rate]['m1_rate']
+ intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+ intentsJsonObj1 = json.loads( intentsJsonStr1 )
+ main.log.info( "Node 1 rate: " +
+ str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
- stop_load = main.params['TEST']['loadstop']
- main.ONOS1.handle.sendline(stop_load)
- main.ONOS2.handle.sendline(stop_load)
+ stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+ main.ONOS1.handle.sendline( stopLoad )
+ msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+ main.log.report( msg )
- msg = ("Final rate on node 1: " + str(last_rate_1))
- main.log.report(msg)
-
- msg = ("Final rate on node 2: " + str(last_rate_2))
- main.log.report(msg)
+ def CASE4( self, main ): # 2 node scale
+ import time
+ import json
+ import string
+ intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
+ defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
+ main.Mininet1.assignSwController(
+ sw="1",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="2",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="3",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="4",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="5",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="6",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="7",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+
+ mnArp = main.params[ 'TEST' ][ 'arping' ]
+ main.Mininet1.handle.sendline( mnArp )
+
+ generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
+
+ main.ONOS1.handle.sendline( generateLoad )
+ main.ONOS2.handle.sendline( generateLoad )
+
+ devicesJsonStr1 = main.ONOS1cli.devices()
+ devicesJsonObj1 = json.loads( devicesJsonStr1 )
+ devicesJsonStr2 = main.ONOS2cli.devices()
+ devicesJsonObj2 = json.loads( devicesJsonStr2 )
+
+ getMetric = main.params[ 'TEST' ][ 'metric1' ]
+ testDuration = main.params[ 'TEST' ][ 'duration' ]
+ stop = time.time() + float( testDuration )
+
+ main.log.info( "Starting test loop..." )
+ logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+ while time.time() < stop:
+ time.sleep( float( logInterval ) )
+
+ intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+ intentsJsonObj1 = json.loads( intentsJsonStr1 )
+ main.log.info( "Node 1 rate: " +
+ str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
+
+ intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics()
+ intentsJsonObj2 = json.loads( intentsJsonStr2 )
+ main.log.info( "Node 2 rate: " +
+ str( intentsJsonObj2[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate2 = intentsJsonObj2[ intentsRate ][ 'm1_rate' ]
+
+ stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+ main.ONOS1.handle.sendline( stopLoad )
+ main.ONOS2.handle.sendline( stopLoad )
+
+ msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+ main.log.report( msg )
+
+ msg = ( "Final rate on node 2: " + str( lastRate2 ) )
+ main.log.report( msg )
diff --git a/TestON/tests/IntentsLoad/IntentsLoad.py.fixed b/TestON/tests/IntentsLoad/IntentsLoad.py.fixed
new file mode 100644
index 0000000..faaec26
--- /dev/null
+++ b/TestON/tests/IntentsLoad/IntentsLoad.py.fixed
@@ -0,0 +1,293 @@
+# ScaleOutTemplate --> IntentsLoad
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os
+
+
+class IntentsLoad:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+
+ global clusterCount
+ clusterCount = 1
+
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ 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' ]
+
+ main.log.step( "Cleaning Enviornment..." )
+ main.ONOSbench.onosUninstall( ONOS1Ip )
+ main.ONOSbench.onosUninstall( ONOS2Ip )
+ main.ONOSbench.onosUninstall( ONOS3Ip )
+
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ #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() # no file or directory
+
+ main.step( "Installing ONOS package" )
+ install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
+
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.step( "Applying cell file to environment" )
+ cellApplyResult = main.ONOSbench.setCell( cellName )
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.step( "Set cell for ONOS cli env" )
+ main.ONOS1cli.setCell( cellName )
+
+ cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
+
+ def CASE2( self, main ):
+ """
+ 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.ONOS2cli.startOnosCli( ONOS2Ip )
+ cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+ """
+ 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.ONOS2cli.startOnosCli( ONOS2Ip )
+
+ if clusterCount == 3:
+ main.log.info( "Installing node 3" )
+ install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+ cli3 = main.ONOS3cli.startOnosCli( ONOS3Ip )
+
+ def CASE3( self, main ):
+ import time
+ import json
+ import string
+
+ intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
+
+ defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
+
+ main.Mininet1.assignSwController(
+ sw="1",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="2",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="3",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="4",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="5",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="6",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="7",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+
+ mnArp = main.params[ 'TEST' ][ 'arping' ]
+ main.Mininet1.handle.sendline( mnArp )
+
+ generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
+
+ main.ONOS1.handle.sendline( generateLoad )
+ main.ONOS1.handle.expect( "sdn" )
+ print( "before: ", main.ONOS1.handle.before )
+ print( "after: ", main.ONOS1.handle.after )
+
+ loadConfirm = main.ONOS1.handle.after
+ if loadConfirm == "{}":
+ main.log.info( "Load started" )
+
+ else:
+ main.log.error( "Load start failure" )
+ main.log.error( "expected '{}', got: " + str( loadConfirm ) )
+
+ devicesJsonStr = main.ONOS1cli.devices()
+ devicesJsonObj = json.loads( devicesJsonStr )
+
+ getMetric = main.params[ 'TEST' ][ 'metric1' ]
+ testDuration = main.params[ 'TEST' ][ 'duration' ]
+ stop = time.time() + float( testDuration )
+
+ main.log.info( "Starting test loop..." )
+ logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+ while time.time() < stop:
+ time.sleep( float( logInterval ) )
+
+ intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+ intentsJsonObj1 = json.loads( intentsJsonStr1 )
+ main.log.info( "Node 1 rate: " +
+ str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
+
+ stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+ main.ONOS1.handle.sendline( stopLoad )
+
+ msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+ main.log.report( msg )
+
+ def CASE4( self, main ): # 2 node scale
+ import time
+ import json
+ import string
+
+ intentsRate = main.params[ 'JSON' ][ 'intents_rate' ]
+
+ defaultSwPort = main.params[ 'CTRL' ][ 'port1' ]
+
+ main.Mininet1.assignSwController(
+ sw="1",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="2",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="3",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="4",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="5",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="6",
+ ip1=ONOS2Ip,
+ port1=defaultSwPort )
+ main.Mininet1.assignSwController(
+ sw="7",
+ ip1=ONOS1Ip,
+ port1=defaultSwPort )
+
+ mnArp = main.params[ 'TEST' ][ 'arping' ]
+ main.Mininet1.handle.sendline( mnArp )
+
+ generateLoad = main.params[ 'TEST' ][ 'loadstart' ]
+
+ main.ONOS1.handle.sendline( generateLoad )
+ main.ONOS2.handle.sendline( generateLoad )
+
+ devicesJsonStr1 = main.ONOS1cli.devices()
+ devicesJsonObj1 = json.loads( devicesJsonStr1 )
+ devicesJsonStr2 = main.ONOS2cli.devices()
+ devicesJsonObj2 = json.loads( devicesJsonStr2 )
+
+ getMetric = main.params[ 'TEST' ][ 'metric1' ]
+ testDuration = main.params[ 'TEST' ][ 'duration' ]
+ stop = time.time() + float( testDuration )
+
+ main.log.info( "Starting test loop..." )
+ logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+
+ while time.time() < stop:
+ time.sleep( float( logInterval ) )
+
+ intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
+ intentsJsonObj1 = json.loads( intentsJsonStr1 )
+ main.log.info( "Node 1 rate: " +
+ str( intentsJsonObj1[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate1 = intentsJsonObj1[ intentsRate ][ 'm1_rate' ]
+
+ intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics()
+ intentsJsonObj2 = json.loads( intentsJsonStr2 )
+ main.log.info( "Node 2 rate: " +
+ str( intentsJsonObj2[ intentsRate ][ 'm1_rate' ] ) )
+ lastRate2 = intentsJsonObj2[ intentsRate ][ 'm1_rate' ]
+
+ stopLoad = main.params[ 'TEST' ][ 'loadstop' ]
+ main.ONOS1.handle.sendline( stopLoad )
+ main.ONOS2.handle.sendline( stopLoad )
+
+ msg = ( "Final rate on node 1: " + str( lastRate1 ) )
+ main.log.report( msg )
+
+ msg = ( "Final rate on node 2: " + str( lastRate2 ) )
+ main.log.report( msg )
diff --git a/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo b/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo
new file mode 100644
index 0000000..a1a28ae
--- /dev/null
+++ b/TestON/tests/ScaleOutTemplate/.ScaleOutTemplate.py.swo
Binary files differ
diff --git a/TestON/tests/ScaleOutTemplate/NOTES.txt b/TestON/tests/ScaleOutTemplate/NOTES.txt
new file mode 100644
index 0000000..6942f14
--- /dev/null
+++ b/TestON/tests/ScaleOutTemplate/NOTES.txt
@@ -0,0 +1,5 @@
+create the params file to go with the topofile and write the python case
+need an __init__ doc? always empty? ask/look up
+remember to write in startup verification and check manually the first few times
+remember to refer to TopoConvNext for reference
+might need to delete THIS file when done
diff --git a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
index a75d694..b5a1e2e 100644
--- a/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
+++ b/TestON/tests/ScaleOutTemplate/ScaleOutTemplate.py
@@ -4,133 +4,132 @@
#
# cameron@onlab.us
-import sys
-import os
+import sys
+import os
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 ):
- 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()
-
+ global clusterCount
+ clusterCount = 1
+
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ 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' ]
+
+ main.log.step( "Cleaning Enviornment..." )
+ main.ONOSbench.onosUninstall( ONOS1Ip )
+ main.ONOSbench.onosUninstall( ONOS2Ip )
+ main.ONOSbench.onosUninstall( ONOS3Ip )
+
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
else:
- checkout_result = main.TRUE
- pull_result = main.TRUE
- main.log.info("Skipped git checkout and pull")
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
- 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)
+ #mvnResult = main.ONOSbench.cleanInstall()
- main.step("Creating ONOS package")
- package_result = main.ONOSbench.onos_package() #no file or directory
+ main.step( "Set cell for ONOS cli env" )
+ main.ONOS1cli.setCell( cellName )
+ main.ONOS2cli.setCell( cellName )
+ main.ONOS3cli.setCell( cellName )
- main.step("Installing ONOS package")
- install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
- 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( "Installing ONOS package" )
+ install1Result = main.ONOSbench.onosInstall( node=ONOS1Ip )
- main.step("Set cell for ONOS cli env")
- main.ONOS1cli.set_cell(cell_name)
- cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)
-
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.step( "Applying cell file to environment" )
+ cellApplyResult = main.ONOSbench.setCell( cellName )
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
- def CASE2(self, main):
+ main.step( "Set cell for ONOS cli env" )
+ main.ONOS1cli.setCell()
+ cli1 = main.ONOS1cli.startOnosCli( ONOS1Ip )
- '''
- Increase number of nodes and initiate CLI
- '''
- import time
-
- global cluster_count
-
- 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
-
+ def CASE2( self, main ):
+ ''
+ '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 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)
+ 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 cluster_count == 5:
+
+ #elif clusterCount == 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.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.start_onos_cli(ONOS4_ip)
- main.ONOS5cli.start_onos_cli(ONOS5_ip)
+ # main.ONOS4cli.startOnosCli( ONOS4Ip )
+ # main.ONOS5cli.startOnosCli( ONOS5Ip )
- elif cluster_count == 7:
+ #elif clusterCount == 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.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 )
+ #
- 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 scale == 1:
+ if clusterCount == 2:
+ main.log.info( "Installing node 2" )
+ install2Result = main.ONOSbench.onosInstall( node=ONOS2Ip )
+ cli2 = main.ONOS1cli.startOnosCli(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)
-
+ if clusterCount == 3:
+ main.log.info( "Installing node 3" )
+ install3Result = main.ONOSbench.onosInstall( node=ONOS3Ip )
+ cli3 = main.ONOS1cli.startOnosCli(ONOS3_ip)