Refactor compare topo usages to use new versions
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
index adbdb24..5673173 100644
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ b/TestON/tests/ProdFunc/ProdFunc.py
@@ -839,7 +839,7 @@
time.sleep( 10 )
main.step( "Get list of hosts from Mininet" )
- hostList = main.Mininet1.getHosts()
+ hostList = main.Mininet1.getHosts().keys()
main.log.info( hostList )
main.step( "Get host list in ONOS format" )
@@ -1122,9 +1122,6 @@
Check ONOS topology matches with mininet
"""
import json
- # assumes that sts is already in you PYTHONPATH
- from sts.topology.teston_topology import TestONTopology
- # main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
main.log.report( "This testcase is testing if all ONOS nodes" +
" are in topology sync with mininet" )
main.log.report( "__________________________________" )
@@ -1171,43 +1168,19 @@
target=main.params[ 'PING' ][ 'target10' ],
pingTime=500 )
- main.step( "Create TestONTopology object" )
- global ctrls
- ctrls = []
- count = 1
- while True:
- temp = ()
- if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
- temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
- temp = temp + ( "ONOS" + str( count ), )
- temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
- temp = temp + \
- ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
- ctrls.append( temp )
- count = count + 1
- else:
- break
- global MNTopo
- Topo = TestONTopology(
- main.Mininet1,
- ctrls ) # can also add Intent API info for intent operations
- MNTopo = Topo
-
TopologyCheck = main.TRUE
main.step( "Compare ONOS Topology to MN Topology" )
devicesJson = main.ONOS2.devices()
linksJson = main.ONOS2.links()
portsJson = main.ONOS2.ports()
+ mnSwitches = main.Mininet1.getSwitches()
+ mnLinks = main.Mininet1.getLinks()
result1 = main.Mininet1.compareSwitches(
- MNTopo,
- json.loads( devicesJson ) )
+ mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
result2 = main.Mininet1.compareLinks(
- MNTopo,
- json.loads( linksJson ) )
+ mnSwitches, mnLinks, json.loads( linksJson ) )
- result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
- # result = result1 and result2 and result3
result = result1 and result2
print "***********************"
@@ -1237,8 +1210,6 @@
down or up properly.
"""
- from sts.topology.teston_topology import TestONTopology
-
linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "This testscase is killing a link to ensure that" +
@@ -1333,25 +1304,18 @@
# NOTE Check ping result here..add code for it
main.step( "Compare ONOS Topology to MN Topology" )
- Topo = TestONTopology(
- main.Mininet1,
- ctrls ) # can also add Intent API info for intent operations
- MNTopo = Topo
- TopologyCheck = main.TRUE
devicesJson = main.ONOS2.devices()
linksJson = main.ONOS2.links()
portsJson = main.ONOS2.ports()
+ mnSwitches = main.Mininet1.getSwitches()
+ mnLinks = main.Mininet1.getLinks()
result1 = main.Mininet1.compareSwitches(
- MNTopo,
- json.loads( devicesJson ) )
+ mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
result2 = main.Mininet1.compareLinks(
- MNTopo,
- json.loads( linksJson ) )
- result3 = main.Mininet1.comparePorts( MNTopo, json.loads( portsJson ) )
+ mnSwitches, mnLinks, json.loads( linksJson ) )
- # result = result1 and result2 and result3
result = result1 and result2
print "***********************"
@@ -1381,7 +1345,6 @@
"""
Intent removal
"""
- import time
main.log.report( "This testcase removes any previously added intents" +
" before adding any new set of intents" )
main.log.report( "__________________________________" )