[ONOS-6593]Review and Refactor ONOS startup procedures in TestON
Change-Id: I509a8ee7a26c198957bebf59da5c85a0edb8b995
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index 9159e4d..d08154e 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -1911,7 +1911,16 @@
Confirms that all ONOS nodes have discovered all scapy hosts
"""
import collections
- hosts = main.topo.getAllHosts( main ) # Get host data from each ONOS node
+ try:
+ from tests.dependencies.topology import Topology
+ except Exception:
+ main.log.error( "Topology not found exiting the test" )
+ main.exit()
+ try:
+ main.topoRelated
+ except Exception:
+ main.topoRelated = Topology()
+ hosts = main.topoRelated.getAllHosts( main.numCtrls, False ) # Get host data from each ONOS node
hostFails = [] # Reset for each failed attempt
# Check for matching hosts on each node
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/startUp.py b/TestON/tests/FUNC/FUNCintent/dependencies/startUp.py
deleted file mode 100644
index ad92fb9..0000000
--- a/TestON/tests/FUNC/FUNCintent/dependencies/startUp.py
+++ /dev/null
@@ -1,33 +0,0 @@
-"""
- This wrapper function is use for starting up onos instance
-"""
-import time
-import os
-import json
-
-
-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/FUNCintent/dependencies/topo.py b/TestON/tests/FUNC/FUNCintent/dependencies/topo.py
deleted file mode 100644
index 7217d4d..0000000
--- a/TestON/tests/FUNC/FUNCintent/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