[ONOS-6593]Review and Refactor ONOS startup procedures in TestON
Change-Id: I509a8ee7a26c198957bebf59da5c85a0edb8b995
diff --git a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
index b2e4f56..9e5404a 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
@@ -11,7 +11,7 @@
"""
main.step( "Check net config" )
if gossipTime:
- time.sleep( gossipTime * len( main.nodes ) )
+ time.sleep( gossipTime * len( main.RESTs ) )
responses = []
result = utilities.retry( f=checkNodeResponses,
retValue=False,
@@ -26,7 +26,7 @@
def checkNodeResponses ( main, responses ):
numberOfFailedNodes = 0 # Tracks the number of nodes that failed to get net configuration
- for node in main.nodes:
+ for node in main.RESTs:
response = node.getNetCfg( )
responses.append( node.pprint( response ) )
if response == main.FALSE:
diff --git a/TestON/tests/FUNC/FUNCnetCfg/dependencies/startUp.py b/TestON/tests/FUNC/FUNCnetCfg/dependencies/startUp.py
deleted file mode 100644
index 9ebeb60..0000000
--- a/TestON/tests/FUNC/FUNCnetCfg/dependencies/startUp.py
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
- This wrapper function is use for starting up onos instance
-"""
-import time
-
-
-def onosBuild( main, gitBranch ):
- """
- This includes pulling ONOS and building it using maven install
- """
- buildResult = main.FALSE
-
- # Git checkout a branch of ONOS
- checkOutResult = main.ONOSbench.gitCheckout( gitBranch )
- # Does the git pull on the branch that was checked out
- if not checkOutResult:
- main.log.warn( "Failed to checked out " + gitBranch +
- " branch" )
- else:
- main.log.info( "Successfully checked out " + gitBranch +
- " branch" )
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == main.ERROR:
- main.log.error( "Error pulling git branch" )
- else:
- main.log.info( "Successfully pulled " + gitBranch + " branch" )
-
- # buck build
- buildResult = main.ONOSbench.buckBuild()
-
- return buildResult
diff --git a/TestON/tests/FUNC/FUNCnetCfg/dependencies/topo.py b/TestON/tests/FUNC/FUNCnetCfg/dependencies/topo.py
deleted file mode 100644
index 7217d4d..0000000
--- a/TestON/tests/FUNC/FUNCnetCfg/dependencies/topo.py
+++ /dev/null
@@ -1,102 +0,0 @@
-"""
- These functions can be used for topology comparisons
-"""
-import time
-import os
-import json
-
-
-def getAllDevices( main ):
- """
- Return a list containing the devices output from each ONOS node
- """
- devices = []
- threads = []
- for i in range( main.numCtrls ):
- t = main.Thread( target=main.CLIs[ i ].devices,
- name="devices-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- return devices
-
-
-def getAllHosts( main ):
- """
- Return a list containing the hosts output from each ONOS node
- """
- hosts = []
- ipResult = main.TRUE
- threads = []
- for i in range( main.numCtrls ):
- t = main.Thread( target=main.CLIs[ i ].hosts,
- name="hosts-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- hosts.append( t.result )
- return hosts
-
-
-def getAllPorts( main ):
- """
- Return a list containing the ports output from each ONOS node
- """
- ports = []
- threads = []
- for i in range( main.numCtrls ):
- t = main.Thread( target=main.CLIs[ i ].ports,
- name="ports-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- return ports
-
-
-def getAllLinks( main ):
- """
- Return a list containing the links output from each ONOS node
- """
- links = []
- threads = []
- for i in range( main.numCtrls ):
- t = main.Thread( target=main.CLIs[ i ].links,
- name="links-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- return links
-
-
-def getAllClusters( main ):
- """
- Return a list containing the clusters output from each ONOS node
- """
- clusters = []
- threads = []
- for i in range( main.numCtrls ):
- t = main.Thread( target=main.CLIs[ i ].clusters,
- name="clusters-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
- return clusters