[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/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,