Update Cluster Driver
Change-Id: I8a3a57e19637ff210548e57d41178e6f194cf694
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
index be4caec..566bd34 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.params
@@ -1,5 +1,5 @@
<PARAMS>
- <testcases>0,1,2,11,20,1,2,11,20,1,2,11,20,1,2,11,20</testcases>
+ <testcases>0,2,11,20,2,11,20,2,11,20,2,11,20</testcases>
<SCALE>1,3,5,7</SCALE>
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
index ec12f35..fb6dec8 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
@@ -33,7 +33,7 @@
def __init__( self ):
self.default = ''
- def CASE0( self, main):
+ def CASE0( self, main ):
import sys
import json
import time
@@ -83,18 +83,13 @@
main.log.info( "Cresting DB file" )
with open( main.dbFileName, "w+" ) as dbFile:
dbFile.write( "" )
- stepResult = main.testSetUp.gitPulling()
+ stepResult = main.testSetUp.envSetup()
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
- def CASE1( self ):
- # main.scale[ 0 ] determines the current number of ONOS controller
- main.testSetUp.getNumCtrls( True )
- main.testSetUp.envSetup( includeGitPull=False, makeMaxNodes=False )
-
def CASE2( self, main ):
"""
- Uninstall ONOS cluster
@@ -102,17 +97,16 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, True,
- cellName=main.cellName, killRemoveMax=False,
- CtrlsSet=False )
+ main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ cellName=main.cellName, killRemoveMax=False )
def CASE11( self, main ):
main.log.info( "set and configure Application" )
import json
import time
- time.sleep(main.startUpSleep)
+ time.sleep( main.startUpSleep )
main.step( "Activating org.onosproject.proxyarp" )
- appStatus = utilities.retry( main.ONOSrest1.activateApp,
+ appStatus = utilities.retry( main.Cluster.active( 0 ).REST.activateApp,
main.FALSE,
[ 'org.onosproject.proxyarp' ],
sleep=3,
@@ -120,40 +114,41 @@
utilities.assert_equals( expect=main.TRUE,
actual=appStatus,
onpass="Successfully activated proxyarp",
- onfail="Failed to activated proxyarp")
+ onfail="Failed to activated proxyarp" )
main.step( "Set up Default Topology Provider" )
appStatus = main.TRUE
configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
configParam = 'maxEvents'
- appStatus = appStatus and main.CLIs[0].setCfg( configName, configParam,'1' )
+ appStatus = appStatus and main.Cluster.active( 0 ).CLI.setCfg( configName, configParam, '1' )
configParam = 'maxBatchMs'
- appStatus = appStatus and main.CLIs[0].setCfg( configName, configParam, '0')
+ appStatus = appStatus and main.Cluster.active( 0 ).CLI.setCfg( configName, configParam, '0' )
configParam = 'maxIdleMs'
- appStatus = appStatus and main.CLIs[0].setCfg( configName, configParam,'0' )
+ appStatus = appStatus and main.Cluster.active( 0 ).CLI.setCfg( configName, configParam, '0' )
utilities.assert_equals( expect=main.TRUE,
actual=appStatus,
onpass="Successfully set DefaultTopologyProvider",
onfail="Failed to set DefaultTopologyProvider" )
- time.sleep( main.startUpSleep)
- main.step('Starting mininet topology')
- mnStatus = main.Mininet1.startNet(args='--topo=linear,1')
+ time.sleep( main.startUpSleep )
+ main.step( 'Starting mininet topology' )
+ mnStatus = main.Mininet1.startNet( args='--topo=linear,1' )
utilities.assert_equals( expect=main.TRUE,
actual=mnStatus,
onpass="Successfully started Mininet",
onfail="Failed to activate Mininet" )
- main.step("Assinging masters to switches")
+ main.step( "Assinging masters to switches" )
switches = main.Mininet1.getSwitches()
- swStatus = main.Mininet1.assignSwController( sw=switches.keys(), ip=main.ONOSip[0] )
+ swStatus = main.Mininet1.assignSwController( sw=switches.keys(),
+ ip=main.Cluster.active( 0 ).ipAddress )
utilities.assert_equals( expect=main.TRUE,
actual=swStatus,
onpass="Successfully assigned switches to masters",
onfail="Failed assign switches to masters" )
- time.sleep( main.startUpSleep)
+ time.sleep( main.startUpSleep )
- def CASE20(self, main):
+ def CASE20( self, main ):
"""
host1 send arping package and measure latency
@@ -180,9 +175,9 @@
# Host adding measurement
assertion = main.TRUE
- main.log.report('Latency of adding one host to ONOS')
- main.log.report('First ' + str( main.iterIgnore ) + ' iterations ignored' + ' for jvm warmup time')
- main.log.report('Total iterations of test: ' + str( main.numlter ) )
+ main.log.report( 'Latency of adding one host to ONOS' )
+ main.log.report( 'First ' + str( main.iterIgnore ) + ' iterations ignored' + ' for jvm warmup time' )
+ main.log.report( 'Total iterations of test: ' + str( main.numlter ) )
addingHostTime = []
metricsResultList = []
@@ -191,16 +186,16 @@
with open( main.tsharkResultPath, "w" ) as dbFile:
dbFile.write( "" )
- main.log.info('Starting tshark capture')
+ main.log.info( 'Starting tshark capture' )
main.ONOSbench.tsharkGrep( main.tsharkPacketIn, main.tsharkResultPath )
time.sleep( main.measurementSleep )
- main.log.info('host 1 arping...')
- main.Mininet1.arping(srcHost='h1', dstHost='10.0.0.2')
+ main.log.info( 'host 1 arping...' )
+ main.Mininet1.arping( srcHost='h1', dstHost='10.0.0.2' )
time.sleep( main.measurementSleep )
- main.log.info('Stopping all Tshark processes')
+ main.log.info( 'Stopping all Tshark processes' )
main.ONOSbench.tsharkStop()
time.sleep( main.measurementSleep )
@@ -209,7 +204,7 @@
with open( main.tsharkResultPath, "r" ) as resultFile:
resultText = resultFile.readline()
main.log.info( 'Capture result:' + resultText )
- resultText = resultText.split(' ')
+ resultText = resultText.split( ' ' )
if len( resultText ) > 1:
tsharkResultTime = float( resultText[ 1 ] ) * 1000.0
else:
@@ -220,8 +215,8 @@
# Compare the timestemps, and get the lowest one.
temp = 0;
# Get host event timestamps from each nodes
- for node in range ( 0, main.numCtrls ):
- metricsResult = json.loads( main.CLIs[ node ].topologyEventsMetrics() )
+ for ctrl in main.Cluster.active():
+ metricsResult = json.loads( ctrl.CLI.topologyEventsMetrics() )
metricsResult = metricsResult.get( main.hostTimestampKey ).get( "value" )
main.log.info( "ONOS topology event matrics timestemp: {}".format( str( metricsResult ) ) )
@@ -230,12 +225,12 @@
metricsResult = temp
addingHostTime.append( float( metricsResult ) - tsharkResultTime )
- main.log.info( "Result of this iteration: {}".format( str( float( metricsResult ) - tsharkResultTime) ) )
+ main.log.info( "Result of this iteration: {}".format( str( float( metricsResult ) - tsharkResultTime ) ) )
# gethost to remove
- gethost = main.ONOSrest1.hosts()
+ gethost = main.Cluster.active( 0 ).REST.hosts()
HosttoRemove = []
HosttoRemove.append( json.loads( gethost[ 1:len( gethost )-1 ] ).get( 'id' ) )
- main.CLIs[0].removeHost( HosttoRemove )
+ main.Cluster.active( 0 ).CLI.removeHost( HosttoRemove )
main.log.info( "Result List: {}".format( addingHostTime ) )
@@ -244,28 +239,28 @@
main.log.info( "Average Latency: {}".format( averageResult ) )
# calculate std
- stdResult = numpy.std(addingHostTime)
- main.log.info("std: {}".format(stdResult))
+ stdResult = numpy.std( addingHostTime )
+ main.log.info( "std: {}".format( stdResult ) )
# write to DB file
- main.log.info("Writing results to DS file")
- with open(main.dbFileName, "a") as dbFile:
+ main.log.info( "Writing results to DS file" )
+ with open( main.dbFileName, "a" ) as dbFile:
temp = "'" + main.commit + "',"
temp += "'" + main.nic + "',"
# Scale number
- temp += str( main.numCtrls )
+ temp += str( main.Cluster.numCtrls )
temp += ",'" + "baremetal1" + "'"
# average latency
temp += "," + str( averageResult )
# std of latency
- temp += "," + str(stdResult)
+ temp += "," + str( stdResult )
temp += "\n"
dbFile.write( temp )
assertion = main.TRUE
- utilities.assert_equals(expect=main.TRUE, actual=assertion,
+ utilities.assert_equals( expect=main.TRUE, actual=assertion,
onpass='Host latency test successful',
- onfail='Host latency test failed')
+ onfail='Host latency test failed' )
main.Utils.mininetCleanup( main.Mininet1 )
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.topo b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.topo
index 74e1277..ebde314 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.topo
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.topo
@@ -1,109 +1,25 @@
<TOPOLOGY>
-
<COMPONENT>
- <ONOSbench>
- <host>localhost</host>
+ <ONOScell>
+ <host>localhost</host> # ONOS "bench" machine
<user>sdn</user>
<password>rocks</password>
- <type>OnosDriver</type>
+ <type>OnosClusterDriver</type>
<connect_order>1</connect_order>
<COMPONENTS>
- <home>~/onos</home>
- <nodes>7</nodes>
- <prompt></prompt>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS>
+ <cluster_name></cluster_name> # Used as a prefix for cluster components. Defaults to 'ONOS'
+ <diff_clihost></diff_clihost> # if it has different host other than localhost for CLI. True or empty. OC# will be used if True.
<karaf_username></karaf_username>
<karaf_password></karaf_password>
- <prompt></prompt>
+ <web_user></web_user>
+ <web_pass></web_pass>
+ <rest_port></rest_port>
+ <prompt></prompt> # TODO: we technically need a few of these, one per component
+ <onos_home></onos_home> # defines where onos home is
+ <nodes> 7 </nodes> # number of nodes in the cluster
</COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli3>
-
- <ONOScli4>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli4>
-
- <ONOScli5>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli5>
-
- <ONOScli6>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli6>
-
- <ONOScli7>
- <host>localhost</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>OC1</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOS1>
+ </ONOScell>
<Mininet1>
<host>OCN</host>
@@ -116,18 +32,6 @@
</COMPONENTS>
</Mininet1>
- <ONOSrest1>
- <host>OC1</host>
- <port>8181</port>
- <user>onos</user>
- <password>rocks</password>
- <type>OnosRestDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS>
- <prompt></prompt>
- </COMPONENTS>
- </ONOSrest1>
-
</COMPONENT>
</TOPOLOGY>