[ONOS-7356] Initial commit to decouple Mininet from TestON tests:
- Add Network class
- Allow ONOS start up without Mininet component
- Migrate SAMP tests and FUNCintent to use Network class
Change-Id: I81b4a4dd27ff6b3a7f2b60abbbcef078b0fa0438
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index b7825e8..3efb3cc 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -98,7 +98,7 @@
main.testSetUp.evnSetupConclusion( stepResult )
- setupResult = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
+ setupResult = main.testSetUp.ONOSSetUp( main.Cluster,
cellName=main.onosCell )
for i in range( 1, main.Cluster.numCtrls + 1 ):
newController = Controller( i )
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
index 794cc75..dd2d2cc 100644
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
@@ -76,8 +76,8 @@
except Exception as e:
main.testSetUp.envSetupException( e )
- cliResults = main.testSetUp.ONOSSetUp( main.scapy_ip, main.Cluster,
- cellName=main.cellName, removeLog=True )
+ cliResults = main.testSetUp.ONOSSetUp( main.Cluster, cellName=main.cellName,
+ mininetIp=main.scapy_ip, removeLog=True )
main.step( "App Ids check" )
appCheck = main.Cluster.active( 0 ).CLI.appToIDCheck()
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index e900648..7f2f01c 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -102,7 +102,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ main.testSetUp.ONOSSetUp( main.Cluster )
def CASE10( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
index 8e06747..80ffe94 100644
--- a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
+++ b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
@@ -110,7 +110,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ main.testSetUp.ONOSSetUp( main.Cluster )
def CASE3( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.py b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
index 24d2f75..34c2674 100644
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
@@ -47,6 +47,9 @@
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
+ from tests.dependencies.Network import Network
+ main.Network = Network()
+
# Test variables
try:
main.apps = main.params[ 'ENV' ][ 'cellApps' ]
@@ -89,11 +92,12 @@
wrapperFile2 +
".py" )
- copyResult1 = main.ONOSbench.scp( main.Mininet1,
- main.dependencyPath +
- main.topology,
- main.Mininet1.home + "custom/",
- direction="to" )
+ if hasattr( main, "Mininet1" ):
+ copyResult1 = main.ONOSbench.scp( main.Mininet1,
+ main.dependencyPath +
+ main.topology,
+ main.Mininet1.home + "custom/",
+ direction="to" )
stepResult = main.testSetUp.envSetup()
except Exception as e:
@@ -113,7 +117,7 @@
- Connect to cli
"""
main.flowCompiler = "Flow Rules"
- main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True )
+ main.initialized = main.testSetUp.ONOSSetUp( main.Cluster, True )
main.intents.report( main )
def CASE8( self, main ):
@@ -212,7 +216,7 @@
tempONOSip = main.Cluster.getIps()
- assignResult = main.Mininet1.assignSwController( sw=switchList,
+ assignResult = main.Network.assignSwController( sw=switchList,
ip=tempONOSip,
port="6653" )
if not assignResult:
@@ -221,7 +225,7 @@
main.skipCase()
for i in range( 1, ( main.numSwitch + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
+ response = main.Network.getSwController( "s" + str( i ) )
main.log.debug( "Response is " + str( response ) )
if re.search( "tcp:" + main.Cluster.active( 0 ).ipAddress, response ):
assignResult = assignResult and main.TRUE
@@ -463,12 +467,6 @@
# if you want to use the wrapper function
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " +
@@ -757,12 +755,6 @@
# if you want to use the wrapper function
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " +
@@ -1254,12 +1246,6 @@
main.skipCase()
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " +
@@ -1550,12 +1536,6 @@
main.skipCase()
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " +
@@ -1875,12 +1855,6 @@
main.skipCase()
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " +
@@ -1892,7 +1866,7 @@
main.step( "Testing host mobility by moving h1 from s5 to s6" )
main.log.info( "Moving h1 from s5 to s6" )
- main.Mininet1.moveHost( "h1", "s5", "s6" )
+ main.Network.moveHost( "h1", "s5", "s6" )
# Send discovery ping from moved host
# Moving the host brings down the default interfaces and creates a new one.
@@ -1957,12 +1931,6 @@
main.skipCase()
assert main, "There is no main"
try:
- assert main.Mininet1
- except AssertionError:
- main.log.error( "Mininet handle should be named Mininet1, skipping test cases" )
- main.initialized = main.FALSE
- main.skipCase()
- try:
assert main.numSwitch
except AssertionError:
main.log.error( "Place the total number of switch topology in " + main.numSwitch )
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index 1a7002b..0fcd334 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -743,7 +743,7 @@
checkFlowsState( main )
# Run iperf to both host
- iperfTemp = main.Mininet1.iperftcp( host1, host2, 10 )
+ iperfTemp = main.Network.iperftcp( host1, host2, 10 )
iperfResult = iperfResult and iperfTemp
if iperfTemp:
main.assertReturnString += 'Initial Iperf Passed\n'
@@ -773,7 +773,7 @@
main.assertReturnString += 'Link Down Topology State Failed\n'
# Run iperf to both host
- iperfTemp = main.Mininet1.iperftcp( host1, host2, 10 )
+ iperfTemp = main.Network.iperftcp( host1, host2, 10 )
iperfResult = iperfResult and iperfTemp
if iperfTemp:
main.assertReturnString += 'Link Down Iperf Passed\n'
@@ -822,7 +822,7 @@
main.assertReturnString += 'Link Up Topology State Failed\n'
# Run iperf to both host
- iperfTemp = main.Mininet1.iperftcp( host1, host2, 10 )
+ iperfTemp = main.Network.iperftcp( host1, host2, 10 )
iperfResult = iperfResult and iperfTemp
if iperfTemp:
main.assertReturnString += 'Link Up Iperf Passed\n'
@@ -1904,7 +1904,7 @@
Ping all host in the hosts list variable
"""
main.log.info( "Pinging: " + str( hostList ) )
- return main.Mininet1.pingallHosts( hostList )
+ return main.Network.pingallHosts( hostList )
def fwdPingall( main ):
@@ -1928,7 +1928,7 @@
# Send pingall in mininet
main.log.info( "Run Pingall" )
- pingResult = main.Mininet1.pingall( timeout=600 )
+ pingResult = main.Network.pingall( timeout=600 )
main.log.info( "Deactivating reactive forwarding app " )
deactivateResult = main.Cluster.active( 0 ).CLI.deactivateApp( "org.onosproject.fwd" )
@@ -2025,12 +2025,12 @@
import json
try:
hostsJson = json.loads( main.Cluster.active( 0 ).CLI.hosts() )
- hosts = main.Mininet1.getHosts().keys()
+ hosts = main.Network.getHosts().keys()
# TODO: Make better use of new getHosts function
for host in hosts:
main.hostsData[ host ] = {}
main.hostsData[ host ][ 'mac' ] = \
- main.Mininet1.getMacAddress( host ).upper()
+ main.Network.getMacAddress( host ).upper()
for hostj in hostsJson:
if main.hostsData[ host ][ 'mac' ] == hostj[ 'mac' ]:
main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
@@ -2116,7 +2116,7 @@
# link down
main.log.info( itemName + ": Bring link " + option + " between " +
sw1 + " and " + sw2 )
- linkResult = main.Mininet1.link( end1=sw1, end2=sw2, option=option )
+ linkResult = main.Network.link( end1=sw1, end2=sw2, option=option )
return linkResult
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index cbf1fea..b5fc12f 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -112,7 +112,7 @@
- Connect to cli
"""
main.flowCompiler = "Flow Rules"
- main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True )
+ main.initialized = main.testSetUp.ONOSSetUp( main.Cluster, True )
main.intentFunction.report( main )
def CASE8( self, main ):
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
index 4488458..656a625 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -98,7 +98,7 @@
"""
import time
- main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True )
+ main.initialized = main.testSetUp.ONOSSetUp( main.Cluster, True )
main.step( "Checking that ONOS is ready" )
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index 6aba822..733d5e5 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
@@ -83,7 +83,7 @@
- Connect to cli
"""
import time
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ main.testSetUp.ONOSSetUp( main.Cluster )
def CASE8( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index ad2c4ba..566cb2b 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -105,7 +105,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True )
+ main.testSetUp.ONOSSetUp( main.Cluster, True )
def CASE19( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index aa298ab..db9f217 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -83,7 +83,7 @@
- Connect to cli
"""
main.flowCompiler = "Flow Rules"
- main.testSetUp.ONOSSetUp( main.LincOE, main.Cluster, True )
+ main.testSetUp.ONOSSetUp( main.Cluster, True, mininetIp=main.LincOE )
def CASE10( self, main ):
"""
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
index 6b6ad93..fd5c9a7 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
@@ -78,8 +78,8 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- cliResults = main.testSetUp.ONOSSetUp( main.OVSDB1, main.Cluster,
- cellName=cellName, removeLog=True )
+ cliResults = main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName,
+ mininetIp=main.OVSDB1, removeLog=True )
if cliResults == main.FALSE:
main.log.error( "Failed to start ONOS, stopping test" )
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
index 73e7f4a..2cb3832 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
@@ -86,7 +86,7 @@
main.maxNodes = 1
- cliResults = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
+ cliResults = main.testSetUp.ONOSSetUp( main.Cluster,
cellName=cellName, removeLog=True )
if cliResults == main.FALSE:
main.log.error( "Failed to start ONOS, stopping test" )
diff --git a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
index 2460c94..96e49c2 100644
--- a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
@@ -88,7 +88,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=main.HA.startingMininet )
main.HA.initialSetUp()
diff --git a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
index 9a27fea..8438780 100644
--- a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
+++ b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
@@ -91,7 +91,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.customizeOnosGenPartitions ],
extraClean=main.HA.cleanUpGenPartition )
diff --git a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
index 37e106c..d3bb153 100644
--- a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
@@ -90,7 +90,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.customizeOnosGenPartitions ],
extraClean=main.HA.cleanUpGenPartition )
diff --git a/TestON/tests/HA/HAkillNodes/HAkillNodes.py b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
index cd47131..5676d3c 100644
--- a/TestON/tests/HA/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
@@ -88,7 +88,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.customizeOnosGenPartitions,
main.HA.copyBackupConfig,
diff --git a/TestON/tests/HA/HAsanity/HAsanity.py b/TestON/tests/HA/HAsanity/HAsanity.py
index ee98b25..2773ac6 100644
--- a/TestON/tests/HA/HAsanity/HAsanity.py
+++ b/TestON/tests/HA/HAsanity/HAsanity.py
@@ -87,7 +87,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=main.HA.startingMininet )
main.HA.initialSetUp()
diff --git a/TestON/tests/HA/HAscaling/HAscaling.py b/TestON/tests/HA/HAscaling/HAscaling.py
index e862d1d..e87275d 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.py
+++ b/TestON/tests/HA/HAscaling/HAscaling.py
@@ -93,7 +93,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.setServerForCluster,
main.HA.scalingMetadata,
main.HA.startingMininet,
diff --git a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index b18f8c4..71a1e30 100644
--- a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -96,7 +96,7 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.Cluster.setRunningNode( int( main.params[ 'num_controllers' ] ) )
ip = main.Cluster.getIps( allNode=True )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName="SingleHA", removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName="SingleHA", removeLog=True,
extraApply=[ main.testSetUp.createApplyCell,
main.HA.startingMininet,
main.testSetUp.createApplyCell ],
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index 4c8fe1d..815ab52 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -88,7 +88,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.customizeOnosGenPartitions,
main.HA.copyBackupConfig ],
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 98a2e30..05989fd 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -91,7 +91,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.setServerForCluster,
main.HA.swapNodeMetadata,
main.HA.startingMininet,
diff --git a/TestON/tests/HA/HAupgrade/HAupgrade.py b/TestON/tests/HA/HAupgrade/HAupgrade.py
index 10e8fdc..2254bc3 100644
--- a/TestON/tests/HA/HAupgrade/HAupgrade.py
+++ b/TestON/tests/HA/HAupgrade/HAupgrade.py
@@ -90,7 +90,7 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.HA.generateGraph( "HAupgrade" )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.copyBackupConfig ],
extraClean=main.HA.cleanUpGenPartition )
diff --git a/TestON/tests/HA/HAupgradeRollback/HAupgradeRollback.py b/TestON/tests/HA/HAupgradeRollback/HAupgradeRollback.py
index fd49fb1..be68336 100644
--- a/TestON/tests/HA/HAupgradeRollback/HAupgradeRollback.py
+++ b/TestON/tests/HA/HAupgradeRollback/HAupgradeRollback.py
@@ -90,7 +90,7 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.HA.generateGraph( "HAupgrade" )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, removeLog=True,
extraApply=[ main.HA.startingMininet,
main.HA.copyBackupConfig ],
extraClean=main.HA.cleanUpGenPartition )
diff --git a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
index 1ad81ad..d536106 100644
--- a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
+++ b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
@@ -86,7 +86,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
+ main.testSetUp.ONOSSetUp( main.Cluster,
skipPack=main.skipPackaging )
def CASE10( self, main ):
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
index c940bde..4fb94c9 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
@@ -37,12 +37,13 @@
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
main.testSetUp.gitPulling()
+ from tests.dependencies.Network import Network
+ main.Network = Network()
def CASE1( self, main ):
"""
Set up global test variables;
Uninstall all running cells in test env defined in .topo file
-
"""
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
@@ -80,7 +81,7 @@
import time
main.case( "Start up " + str( main.Cluster.numCtrls ) + "-node onos cluster." )
main.step( "Start ONOS cluster with basic (drivers) app." )
- stepResult = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ stepResult = main.testSetUp.ONOSSetUp( main.Cluster )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully started basic ONOS cluster ",
@@ -131,7 +132,7 @@
main.case( "Start Mininet topology" )
main.step( "Starting Mininet Topology" )
- topoResult = main.Mininet1.startNet( mnCmd=topology )
+ topoResult = main.Network.startNet( mnCmd=topology )
stepResult = topoResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -145,7 +146,7 @@
assignResult = main.TRUE
for i in range( 1, 8 ):
assignResult = assignResult & \
- main.Mininet1.assignSwController( sw="s" + str( i ),
+ main.Network.assignSwController( sw="s" + str( i ),
ip=main.Cluster.getIps(),
port='6653' )
time.sleep( main.mnCfgSleep )
@@ -187,10 +188,10 @@
main.step( "Run pingall to check connectivity. " )
pingResult = main.FALSE
passMsg = "Reactive Pingall test passed"
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Network.pingall()
if not pingResult:
main.log.warn( "First pingall failed. Trying again..." )
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Network.pingall()
passMsg += "on the second try"
utilities.assert_equals( expect=main.TRUE,
actual=pingResult,
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
index 80994b8..21d86d4 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
@@ -37,6 +37,8 @@
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
main.testSetUp.gitPulling()
+ from tests.dependencies.Network import Network
+ main.Network = Network()
def CASE1( self, main ):
"""
@@ -82,7 +84,7 @@
main.case( "Start up " + str( main.Cluster.numCtrls ) + "-node onos cluster." )
main.step( "Start ONOS cluster with basic (drivers) app." )
- stepResult = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ stepResult = main.testSetUp.ONOSSetUp( main.Cluster )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully started basic ONOS cluster ",
@@ -135,7 +137,7 @@
main.case( "Start Mininet topology" )
main.step( "Starting Mininet Topology" )
- topoResult = main.Mininet1.startNet( mnCmd=topology )
+ topoResult = main.Network.startNet( mnCmd=topology )
stepResult = topoResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -148,7 +150,7 @@
main.step( "Assign switches to controllers." )
assignResult = main.TRUE
for i in range( 1, 8 ):
- assignResult = assignResult & main.Mininet1.assignSwController( sw="s" + str( i ),
+ assignResult = assignResult & main.Network.assignSwController( sw="s" + str( i ),
ip=main.Cluster.getIps(),
port='6653' )
time.sleep( main.mnCfgSleep )
@@ -190,10 +192,10 @@
main.step( "Run pingall to check connectivity. " )
pingResult = main.FALSE
passMsg = "Reactive Pingall test passed"
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Network.pingall()
if not pingResult:
main.log.warn( "First pingall failed. Trying again..." )
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Network.pingall()
passMsg += "on the second try"
utilities.assert_equals( expect=main.TRUE,
actual=pingResult,
diff --git a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
index c139d48..4a09129 100644
--- a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
@@ -56,7 +56,7 @@
main.commit = ( main.commit.split( " " ) )[ 1 ]
# -- END OF INIT SECTION --#
- main.testSetUp.ONOSSetUp( MN1Ip, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName )
for i in range( 5 ):
diff --git a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
index c86ecac..45f3741 100644
--- a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
+++ b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
@@ -66,7 +66,7 @@
main.commit = ( main.commit.split( " " ) )[ 1 ]
def CASE1( self, main ):
- main.testSetUp.ONOSSetUp( "localhost", main.Cluster, True, cellName=cellName )
+ main.testSetUp.ONOSSetUp( main.Cluster, True, cellName=cellName )
main.log.info( "Startup sequence complete" )
main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
index b742960..f3e686f 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
@@ -96,7 +96,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
def CASE11( self, main ):
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index 7be0cc3..629dad7 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -99,7 +99,7 @@
# Clean up test environment and set up
import time
main.maxNumBatch = 0
- main.testSetUp.ONOSSetUp( main.MN1Ip, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
# config apps
main.Cluster.active( 0 ).CLI.setCfg( main.intentManagerCfg,
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index 9232a73..ef1cfb9 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -110,7 +110,7 @@
import time
main.maxNumBatch = 0
- main.testSetUp.ONOSSetUp( main.MN1Ip, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
configRetry = 0
main.cfgCheck = False
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 71bf1aa..f5f1f19 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -121,7 +121,7 @@
import time
main.maxNumBatch = 0
- main.testSetUp.ONOSSetUp( main.MN1Ip, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
configRetry = 0
main.cfgCheck = False
diff --git a/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py b/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
index e591381..4596db8 100644
--- a/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
+++ b/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
@@ -82,7 +82,7 @@
def CASE1( self, main ):
# Clean up test environment and set up
import time
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
try:
from tests.dependencies.utils import Utils
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index 180d860..3a6f503 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -98,7 +98,7 @@
def CASE1( self, main ):
# Clean up test environment and set up
import time
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
main.log.info( "Configure apps" )
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index b0b8880..7c5952a 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -139,7 +139,7 @@
- Connect to cli
"""
import time
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster )
+ main.testSetUp.ONOSSetUp( main.Cluster )
def CASE3( self, main ):
"""
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 87e14a4..674b925 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -111,7 +111,7 @@
- Install ONOS cluster
- Connect to cli
"""
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
killRemoveMax=False )
def CASE10( self, main ):
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
index 4e230c0..74afcf8 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
@@ -109,7 +109,7 @@
except ( NameError, AttributeError ):
main.Utils = Utils()
main.maxNumBatch = 0
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True,
+ main.testSetUp.ONOSSetUp( main.Cluster, True,
cellName=main.cellName, killRemoveMax=False )
main.log.info( "Configure apps" )
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index cf0d9a9..2e0ae48 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -114,7 +114,7 @@
main.log.info( "NODE COUNT = " + str( main.Cluster.numCtrls ) )
main.log.info( ''.join( main.Cluster.getIps() ) )
main.dynamicHosts = [ 'in1', 'out1' ]
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, newCell=True, cellName=main.cellName,
+ main.testSetUp.ONOSSetUp( main.Cluster, newCell=True, cellName=main.cellName,
skipPack=skipPackage, useSSH=Testcaselib.useSSH )
ready = utilities.retry( main.Cluster.active( 0 ).CLI.summary,
main.FALSE,
diff --git a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
index 4f8d159..8a44063 100644
--- a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
+++ b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
@@ -70,7 +70,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
+ main.testSetUp.ONOSSetUp( main.Cluster,
cellName=main.cellName )
main.step( "Starting Mininet" )
diff --git a/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py b/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
index 9778b68..c8dd52b 100644
--- a/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
+++ b/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
@@ -77,7 +77,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
- main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster,
+ main.testSetUp.ONOSSetUp( main.Cluster,
cellName=cellName )
main.step( "Starting Mininet" )
diff --git a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
index c5eb905..796d5bd 100644
--- a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
+++ b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
@@ -27,9 +27,7 @@
actual=status,
onpass="Copy config file succeeded",
onfail="Copy config file failed" )
- main.testSetUp.ONOSSetUp( main.Mininet,
- main.Cluster,
- cellName=cellName )
+ main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName )
main.step( "Checking if ONOS CLI is ready for issuing commands" )
ready = utilities.retry( main.Cluster.command,
diff --git a/TestON/tests/dependencies/Cluster.py b/TestON/tests/dependencies/Cluster.py
index af17ab5..34a373a 100644
--- a/TestON/tests/dependencies/Cluster.py
+++ b/TestON/tests/dependencies/Cluster.py
@@ -149,14 +149,14 @@
"""
self.iterator = iter( self.active() )
- def createCell( self, cellName, cellApps, Mininet, useSSH, ips, installMax=False ):
+ def createCell( self, cellName, cellApps, mininetIp, useSSH, ips, installMax=False ):
"""
Description:
create a new cell
Required:
* cellName - The name of the cell.
* cellApps - The ONOS apps string.
- * Mininet - a mininet driver that will be used.
+ * mininetIp - Mininet IP address.
* useSSH - True for using ssh when creating a cell
* ips - ip( s ) of the node( s ).
Returns:
@@ -168,8 +168,7 @@
self.command( "createCellFile",
args=[ main.ONOSbench.ip_address,
cellName,
- Mininet if isinstance( Mininet, str ) else
- Mininet.ip_address,
+ mininetIp,
apps,
ips,
main.ONOScell.karafUser,
diff --git a/TestON/tests/dependencies/Network.py b/TestON/tests/dependencies/Network.py
new file mode 100644
index 0000000..6377c0c
--- /dev/null
+++ b/TestON/tests/dependencies/Network.py
@@ -0,0 +1,58 @@
+"""
+Copyright 2018 Open Networking Foundation ( ONF )
+
+Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
+the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
+or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg>
+
+ TestON is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ ( at your option ) any later version.
+
+ TestON is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with TestON. If not, see <http://www.gnu.org/licenses/>.
+"""
+import json
+class Network():
+
+ def __str__( self ):
+ return self.name
+
+ def __repr__( self ):
+ return "%s:%s" % ( self.name, self.components )
+
+ def __getattr__( self, name ):
+ """
+ Called when an attribute lookup has not found the attribute
+ in the usual places (i.e. it is not an instance attribute nor
+ is it found in the class tree for self). name is the attribute
+ name. This method should return the (computed) attribute value
+ or raise an AttributeError exception.
+
+ We will look into each of the network component handles to try
+ to find the attreibute.
+ """
+ #FIXME: allow to call a specific driver
+ for component in self.components:
+ if hasattr( component, name ):
+ main.log.debug( "%s has attribute '%s'" % ( component.options[ 'name' ], name ) )
+ return getattr( component, name )
+ raise AttributeError( "Could not find attribute '%s' in any of these components: %s" % ( name, self.components ) )
+
+ def __init__( self, name="Network" ):
+ """
+ components: network components created for the test
+ """
+ self.name = str( name )
+ # Get a list of network components that are created in the test
+ self.components = []
+ for key, value in main.componentDictionary.items():
+ if value[ 'type' ] in [ 'MininetCliDriver', 'RemoteMininetDriver', 'NetworkDriver' ] and hasattr( main, key ):
+ self.components.append( getattr( main, key ) )
+ main.log.debug( "%s initialized with components: %s" % ( self.name, self.components ) )
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index 11f5886..98f1d5b 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -198,7 +198,7 @@
return cluster.kill( killRemoveMax, stopOnos )
def createApplyCell( self, cluster, newCell, cellName, cellApps,
- Mininet, useSSH, ips, installMax=False ):
+ mininetIp, useSSH, ips, installMax=False ):
"""
Description:
create new cell ( optional ) and apply it. It will also verify the
@@ -208,14 +208,14 @@
* newCell - True for making a new cell and False for not making it.
* cellName - The name of the cell.
* cellApps - The onos apps string.
- * Mininet - a mininet driver that will be used.
+ * mininetIp - Mininet IP address.
* useSSH - True for using ssh when creating a cell
* ips - ip( s ) of the node( s ).
Returns:
Returns main.TRUE if it successfully executed.
"""
if newCell:
- cluster.createCell( cellName, cellApps, Mininet, useSSH, ips )
+ cluster.createCell( cellName, cellApps, mininetIp, useSSH, ips )
main.step( "Apply cell to environment" )
stepResult = cluster.applyCell( cellName )
utilities.assert_equals( expect=main.TRUE,
@@ -352,8 +352,8 @@
else:
functions( *args ) if args is not None else functions()
- def ONOSSetUp( self, Mininet, cluster, hasMultiNodeRounds=False, startOnos=True, newCell=True,
- cellName="temp", cellApps="drivers", removeLog=False, extraApply=None, applyArgs=None,
+ def ONOSSetUp( self, cluster, hasMultiNodeRounds=False, startOnos=True, newCell=True,
+ cellName="temp", cellApps="drivers", mininetIp="", removeLog=False, extraApply=None, applyArgs=None,
extraClean=None, cleanArgs=None, skipPack=False, installMax=False, useSSH=True,
killRemoveMax=True, stopOnos=False, installParallel=True ):
"""
@@ -372,13 +372,13 @@
checking the onos service
starting onos
Required:
- * Mininet - the mininet driver that will be used
* cluster - the cluster driver that will be used.
* hasMultiNodeRouds - True if the test is testing different set of nodes
* startOnos - True if wish to start onos.
* newCell - True for making a new cell and False for not making it.
* cellName - Name of the cell that will be used.
* cellApps - The cell apps string.
+ * mininetIp - Mininet IP address.
* removeLog - True if wish to remove raft logs
* extraApply - Function( s ) that will be called before building ONOS. Default to None.
* applyArgs - argument of the functon( s ) of the extraApply. Should be in list.
@@ -411,9 +411,15 @@
tempOnosIp = []
for ctrl in cluster.runningNodes:
tempOnosIp.append( ctrl.ipAddress )
+ if mininetIp == "":
+ mininetIp = "localhost"
+ for key, value in main.componentDictionary.items():
+ if value['type'] in ['MininetCliDriver', 'RemoteMininetDriver'] and hasattr( main, key ):
+ mininetIp = getattr( main, key ).ip_address
+ break
cellResult = self.createApplyCell( cluster, newCell,
cellName, cellApps,
- Mininet, useSSH,
+ mininetIp, useSSH,
tempOnosIp, installMax )
if removeLog:
main.log.info( "Removing raft logs" )