Merge "return main.TRUE when mininet handle not logged into mininet"
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index cdf30c2..c198c4f 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -1159,11 +1159,11 @@
main.exit()
return response
- def links( self ):
+ def links( self, timeout=20 ):
main.log.info( self.name + ": List network links" )
try:
response = self.execute( cmd='links', prompt='mininet>',
- timeout=20 )
+ timeout=timeout )
except pexpect.EOF:
main.log.error( self.name + ": EOF exception found" )
main.log.error( self.name + ": " + self.handle.before )
@@ -1985,7 +1985,7 @@
response = main.FALSE
return response
- def arping( self, srcHost="", dstHost="10.128.20.211", ethDevice="" ):
+ def arping( self, srcHost="", dstHost="10.128.20.211", ethDevice="", output=main.TRUE ):
"""
Description:
Sends arp message from mininet host for hosts discovery
@@ -1999,7 +1999,8 @@
ethDevice = '-I ' + ethDevice + ' '
cmd = srcHost + " arping -c1 " + ethDevice + dstHost
try:
- main.log.info( "Sending: " + cmd )
+ if output:
+ main.log.info( "Sending: " + cmd )
self.handle.sendline( cmd )
i = self.handle.expect( [ "mininet>", "arping: " ] )
if i == 0:
@@ -2508,7 +2509,7 @@
hosts[ name ] = { "interfaces": interfaces }
return hosts
- def getLinks( self ):
+ def getLinks( self, timeout=20 ):
"""
Gathers information about current Mininet links. These links may not
be up if one of the ports is down.
@@ -2525,7 +2526,7 @@
hosts, this is just the eth#.
"""
self.update()
- response = self.links().split( '\n' )
+ response = self.links(timeout=timeout).split( '\n' )
# Examples:
# s1-eth3<->s2-eth1 (OK OK)
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index c5ac77e..a333be5 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -4028,14 +4028,13 @@
main.cleanup()
main.exit()
- def counterTestAddAndGet( self, counter, delta=1, inMemory=False ):
+ def counterTestAddAndGet( self, counter, delta=1 ):
"""
CLI command to add a delta to then get a distributed counter.
Required arguments:
counter - The name of the counter to increment.
Optional arguments:
delta - The long to add to the counter
- inMemory - use in memory map for the counter
returns:
integer value of the counter or
None on Error
@@ -4044,8 +4043,6 @@
counter = str( counter )
delta = int( delta )
cmdStr = "counter-test-increment "
- if inMemory:
- cmdStr += "-i "
cmdStr += counter
if delta != 1:
cmdStr += " " + str( delta )
@@ -4093,14 +4090,13 @@
main.cleanup()
main.exit()
- def counterTestGetAndAdd( self, counter, delta=1, inMemory=False ):
+ def counterTestGetAndAdd( self, counter, delta=1 ):
"""
CLI command to get a distributed counter then add a delta to it.
Required arguments:
counter - The name of the counter to increment.
Optional arguments:
delta - The long to add to the counter
- inMemory - use in memory map for the counter
returns:
integer value of the counter or
None on Error
@@ -4109,8 +4105,6 @@
counter = str( counter )
delta = int( delta )
cmdStr = "counter-test-increment -g "
- if inMemory:
- cmdStr += "-i "
cmdStr += counter
if delta != 1:
cmdStr += " " + str( delta )
@@ -4193,15 +4187,13 @@
main.cleanup()
main.exit()
- def transactionalMapGet( self, keyName, inMemory=False ):
+ def transactionalMapGet( self, keyName ):
"""
CLI command to get the value of a key in a consistent map using
transactions. This a test function and can only get keys from the
test map hard coded into the cli command
Required arguments:
keyName - The name of the key to get
- Optional arguments:
- inMemory - use in memory map for the counter
returns:
The string value of the key or
None on Error
@@ -4209,8 +4201,6 @@
try:
keyName = str( keyName )
cmdStr = "transactional-map-test-get "
- if inMemory:
- cmdStr += "-i "
cmdStr += keyName
output = self.sendline( cmdStr )
assert "Command not found:" not in output, output
@@ -4253,7 +4243,7 @@
main.cleanup()
main.exit()
- def transactionalMapPut( self, numKeys, value, inMemory=False ):
+ def transactionalMapPut( self, numKeys, value ):
"""
CLI command to put a value into 'numKeys' number of keys in a
consistent map using transactions. This a test function and can only
@@ -4261,8 +4251,6 @@
Required arguments:
numKeys - Number of keys to add the value to
value - The string value to put into the keys
- Optional arguments:
- inMemory - use in memory map for the counter
returns:
A dictionary whose keys are the name of the keys put into the map
and the values of the keys are dictionaries whose key-values are
@@ -4278,8 +4266,6 @@
numKeys = str( numKeys )
value = str( value )
cmdStr = "transactional-map-test-put "
- if inMemory:
- cmdStr += "-i "
cmdStr += numKeys + " " + value
output = self.sendline( cmdStr )
assert "Command not found:" not in output, output
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
index 986145e..b44a3c0 100755
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.params
@@ -11,7 +11,7 @@
<testcases>1,2,[10,300,11,100,300,11,200,300,11,1000]*3</testcases>
<DEPENDENCY>
- <path>/tests/SCPFscaleTopo/dependencies/</path>
+ <path>/tests/SCPF/SCPFscaleTopo/dependencies/</path>
<wrapper1>startUp</wrapper1>
<wrapper2>scaleTopoFunction</wrapper2>
<wrapper3>topo</wrapper3>
@@ -37,7 +37,7 @@
<balance>10</balance>
<nodeSleep>10</nodeSleep>
<pingall>15</pingall>
- <MNsleep>5</MNsleep>
+ <MNsleep>120</MNsleep>
</SLEEP>
<TIMEOUT>
@@ -52,7 +52,7 @@
<TOPOLOGY>
<topology>torus</topology>
- <scale>5,10,15</scale>
+ <scale>10,15,20</scale>
</TOPOLOGY>
</PARAMS>
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index 830fbf2..96ac405 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -64,17 +64,14 @@
main.dependencyPath +
wrapperFile1 +
".py" )
-
main.scaleTopoFunction = imp.load_source( wrapperFile2,
main.dependencyPath +
wrapperFile2 +
".py" )
-
main.topo = imp.load_source( wrapperFile3,
main.dependencyPath +
wrapperFile3 +
".py" )
-
main.ONOSbench.scp( main.Mininet1,
main.dependencyPath +
main.multiovs,
@@ -247,6 +244,13 @@
main.currScale = main.topoScale.pop(0)
else: main.log.error( "topology scale is empty" )
+ # remove device before setup topology
+ devices = main.topo.getAllDevices( main )
+ if( devices[0] != '[]' ): # because devices is a list witch contain 3 string, not contain list!
+ temp = json.loads( devices[0] )
+ devicesIdList = []
+ for d in temp:
+ main.CLIs[0].deviceRemove( d.get('id').encode() )
main.step( "Starting up TORUS %sx%s topology" % (main.currScale, main.currScale) )
@@ -279,58 +283,66 @@
main.caseExplanation = "Pinging all hosts and comparing topology " +\
"elements between Mininet and ONOS"
- main.log.info( "Pinging all hosts" )
-
- # the pingall timeout is depend on the number of total host
- pingTimeout = int( main.pingTimeout * float( int(main.currScale) * int(main.currScale ) ) )
- pingResult = main.Mininet1.pingall( pingTimeout )
-
main.log.info( "Gathering topology information" )
-
time.sleep( main.MNSleep )
devicesResults = main.TRUE
linksResults = main.TRUE
hostsResults = main.TRUE
stepResult = main.TRUE
- devices = main.topo.getAllDevices( main )
- hosts = main.topo.getAllHosts( main )
- ports = main.topo.getAllPorts( main )
- links = main.topo.getAllLinks( main )
- clusters = main.topo.getAllClusters( main )
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
-
main.step( "Comparing MN topology to ONOS topology" )
- for controller in range(len(main.activeNodes)):
- controllerStr = str( main.activeNodes[controller] + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
-
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
+ compareRetry=0
+ while compareRetry <3:
+ #While loop for retry
+ devices = main.topo.getAllDevices( main )
+ ports = main.topo.getAllPorts( main )
+ links = main.topo.getAllLinks( main)
+ clusters = main.topo.getAllClusters( main )
+ mnSwitches = main.Mininet1.getSwitches()
+ mnLinks = main.Mininet1.getLinks(timeout=180)
+ mnHosts = main.Mininet1.getHosts()
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- json.loads( hosts[ controller ] ) )
- else:
- currentHostsResult = main.FALSE
+ for controller in range(len(main.activeNodes)):
+ controllerStr = str( main.activeNodes[controller] + 1 )
+ if devices[ controller ] and ports[ controller ] and\
+ "Error" not in devices[ controller ] and\
+ "Error" not in ports[ controller ]:
- stepResult = stepResult and currentDevicesResult and currentLinksResult and currentHostsResult
+ currentDevicesResult = main.Mininet1.compareSwitches(
+ mnSwitches,
+ json.loads( devices[ controller ] ),
+ json.loads( ports[ controller ] ) )
+ else:
+ currentDevicesResult = main.FALSE
+
+ if links[ controller ] and "Error" not in links[ controller ]:
+ currentLinksResult = main.Mininet1.compareLinks(
+ mnSwitches, mnLinks,
+ json.loads( links[ controller ] ) )
+ else:
+ currentLinksResult = main.FALSE
+
+ stepResult = currentDevicesResult and currentLinksResult
+ if stepResult:
+ break
+ compareRetry += 1
+
+ # host discover
+ hostList=[]
+ for i in range( 1, int(main.currScale)+1 ):
+ for j in range( 1, int(main.currScale)+1 ):
+ hoststr = "h" + str(i)+ "x" + str(j)
+ hostList.append(hoststr)
+ totalNum = main.topo.sendArpPackage(main, hostList)
+ # check host number
+ main.log.info("{} hosts has been discovered".format( totalNum ))
+ if int(totalNum) == ( int(main.currScale) * int(main.currScale) ):
+ main.log.info("All hosts has been discovered")
+ stepResult = stepResult and main.TRUE
+ else:
+ main.log.warn("Hosts number is not correct!")
+ stepResult = stepResult and main.FALSE
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -341,7 +353,7 @@
def CASE100( self, main ):
'''
- Bring Down node 3
+ Bring Down node 3
'''
main.case("Balancing Masters and bring ONOS node 3 down: TORUS %sx%s" % (main.currScale, main.currScale))
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/multiovs.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/multiovs.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/newFuncTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/newFuncTopo.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/scaleTopoFunction.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/scaleTopoFunction.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/spine.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/spine.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/startUp.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/startUp.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/startUp.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/startUp.py
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/topo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
similarity index 81%
rename from TestON/tests/SCPF/SCPFscaleTopo/Dependency/topo.py
rename to TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
index 0dbb02d..7a8c0c6 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/Dependency/topo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
@@ -97,4 +97,19 @@
clusters.append( t.result )
return clusters
-
+def sendArpPackage( main, hostList ):
+ import json
+ """
+ send arping package from host
+ return the total hosts number from Onos
+ """
+ main.log.info("Sending Arping package...")
+ if isinstance(hostList, list):
+ threads = []
+ for h in hostList:
+ main.Mininet1.arping( srcHost=h, dstHost="10.0.0.1", output=main.FALSE )
+ else:
+ main.Mininet1.arping(srcHost=hostList)
+ summaryStr = json.loads( main.CLIs[0].summary().encode() )
+ hostNum = summaryStr.get('hosts')
+ return hostNum
diff --git a/TestON/tests/SCPF/SCPFswitchLat/Dependency/topo-perf-1sw.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py
similarity index 100%
rename from TestON/tests/SCPF/SCPFswitchLat/Dependency/topo-perf-1sw.py
rename to TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.params b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.params
index 6f4e47b..3570fd0 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.params
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.params
@@ -15,7 +15,7 @@
</CTRL>
<DEPENDENCY>
- <path>/USECASE_SdnipFunction/dependencies/</path>
+ <path>/USECASE/USECASE_SdnipFunction/dependencies/</path>
<topology>USECASE_SdnipI2MN.py</topology>
<wrapper1>Functions</wrapper1>
</DEPENDENCY>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index 58fce87..ac41fda 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -11,7 +11,7 @@
"""
import os
import imp
- main.log.case( "Setup the Mininet testbed" )
+ main.case( "Setup the Mininet testbed" )
main.dependencyPath = main.testDir + \
main.params[ 'DEPENDENCY' ][ 'path' ]
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
@@ -81,6 +81,15 @@
ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
ipList = [ ONOS1Ip ]
+ main.step( "Copying config files" )
+ src = os.path.dirname( main.testFile ) + "/network-cfg.json"
+ dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
+ status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=status,
+ onpass="Copy config file succeeded",
+ onfail="Copy config file failed" )
+
main.step( "Create cell file" )
cellAppString = main.params[ 'ENV' ][ 'appString' ]
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
@@ -94,6 +103,7 @@
onpass="Set cell succeeded",
onfail="Set cell failed" )
+ main.step( "Verify cell connectivity" )
verifyResult = main.ONOSbench.verifyCell()
utilities.assert_equals( expect=main.TRUE,
actual=verifyResult,
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
index c266402..7f93976 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
@@ -16,7 +16,7 @@
</CTRL>
<DEPENDENCY>
- <path>/USECASE_SdnipFunctionCluster/dependencies/</path>
+ <path>/USECASE/USECASE_SdnipFunctionCluster/dependencies/</path>
<topology>USECASE_SdnipI2MN_Cluster.py</topology>
<wrapper1>Functions</wrapper1>
<wrapper2>USECASE_SdnipI2MN_Cluster</wrapper2>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 7593368..5742092 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -76,6 +76,15 @@
peer64515 = main.params['config']['peer64515']
peer64516 = main.params['config']['peer64516']
+ main.step( "Copying config files" )
+ src = os.path.dirname( main.testFile ) + "/network-cfg.json"
+ dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
+ status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=status,
+ onpass="Copy config file succeeded",
+ onfail="Copy config file failed" )
+
main.step( "Create cell file" )
cellAppString = main.params[ 'ENV' ][ 'appString' ]
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
@@ -89,6 +98,7 @@
onpass="Set cell succeeded",
onfail="Set cell failed" )
+ main.step( "Verify cell connectivity" )
verifyResult = main.ONOSbench.verifyCell()
utilities.assert_equals( expect=main.TRUE,
actual=verifyResult,
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
index fa41d0d..54c42be 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.params
@@ -21,7 +21,7 @@
</CTRL>
<DEPENDENCY>
- <path>/USECASE_SdnipFunctionCluster_fsfw/dependencies/</path>
+ <path>/USECASE/USECASE_SdnipFunctionCluster_fsfw/dependencies/</path>
<topology>USECASE_SdnipI2MN_Cluster.py</topology>
<wrapper1>Functions</wrapper1>
<wrapper2>USECASE_SdnipI2MN_Cluster_fsfw</wrapper2>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
index 98c28bb..3e27a10 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster_fsfw/USECASE_SdnipFunctionCluster_fsfw.py
@@ -10,7 +10,7 @@
Start mininet
"""
import imp
- main.log.case( "Setup the Mininet testbed" )
+ main.case( "Setup the Mininet testbed" )
main.dependencyPath = main.testDir + \
main.params[ 'DEPENDENCY' ][ 'path' ]
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
@@ -81,6 +81,15 @@
fsfwIp = main.params[ 'CTRL' ][ 'fsfwIp' ]
fsfwPort = main.params[ 'CTRL' ][ 'fsfwPort' ]
+ main.step( "Copying config files" )
+ src = os.path.dirname( main.testFile ) + "/network-cfg.json"
+ dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
+ status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=status,
+ onpass="Copy config file succeeded",
+ onfail="Copy config file failed" )
+
main.step( "Create cell file" )
cellAppString = main.params[ 'ENV' ][ 'appString' ]
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
@@ -94,6 +103,7 @@
onpass="Set cell succeeded",
onfail="Set cell failed" )
+ main.step( "Verify cell connectivity" )
verifyResult = main.ONOSbench.verifyCell()
utilities.assert_equals( expect=main.TRUE,
actual=verifyResult,
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
index ae028d0..b1c2f8f 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.params
@@ -19,7 +19,7 @@
</CTRL>
<DEPENDENCY>
- <path>/USECASE_SdnipFunction_fsfw/dependencies/</path>
+ <path>/USECASE/USECASE_SdnipFunction_fsfw/dependencies/</path>
<topology>USECASE_SdnipI2MN.py</topology>
<wrapper1>Functions</wrapper1>
</DEPENDENCY>
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
index 938b6e0..e931a0b 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction_fsfw/USECASE_SdnipFunction_fsfw.py
@@ -11,7 +11,7 @@
"""
import os
import imp
- main.log.case( "Setup the Mininet testbed" )
+ main.case( "Setup the Mininet testbed" )
main.dependencyPath = main.testDir + \
main.params[ 'DEPENDENCY' ][ 'path' ]
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
@@ -83,13 +83,22 @@
import os
from operator import eq
- main.case( "Setting up test environment" )
+ main.case( "Setting up ONOS environment" )
cellName = main.params[ 'ENV' ][ 'cellName' ]
global ONOS1Ip
ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
ipList = [ ONOS1Ip ]
+ main.step( "Copying config files" )
+ src = os.path.dirname( main.testFile ) + "/network-cfg.json"
+ dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
+ status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=status,
+ onpass="Copy config file succeeded",
+ onfail="Copy config file failed" )
+
main.step( "Create cell file" )
cellAppString = main.params[ 'ENV' ][ 'appString' ]
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
@@ -103,6 +112,7 @@
onpass="Set cell succeeded",
onfail="Set cell failed" )
+ main.step( "Verify cell connectivity" )
verifyResult = main.ONOSbench.verifyCell()
utilities.assert_equals( expect=main.TRUE,
actual=verifyResult,
diff --git a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
index 31678fe..c95e232 100644
--- a/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
+++ b/TestON/tests/USECASE/USECASE_SegmentRouting/USECASE_SegmentRouting.py
@@ -31,7 +31,8 @@
main.apps = main.params[ 'ENV' ][ 'cellApps' ]
main.diff = ( main.params[ 'ENV' ][ 'diffApps' ] ).split(";")
gitBranch = main.params[ 'GIT' ][ 'branch' ]
- main.dependencyPath = os.path.dirname( main.testFile ) + "/dependencies/"
+ main.path = os.path.dirname( main.testFile )
+ main.dependencyPath = main.path + "/dependencies/"
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
#main.json = ["4x4"]
main.json = ["2x2", "2x2"]
@@ -105,8 +106,11 @@
# main.scale[ 0 ] determines the current number of ONOS controller
main.numCtrls = int( main.scale[ 0 ] )
-
- main.case( "Package and start ONOS")
+ apps=main.apps
+ if main.diff:
+ apps = main.apps+","+main.diff.pop(0)
+ else: main.log.error( "App list is empty" )
+ main.case( "Package and start ONOS using apps:" + apps)
#kill off all onos processes
main.log.info( "Safety check, killing all ONOS processes" +
@@ -120,16 +124,14 @@
tempOnosIp = []
for i in range( main.numCtrls ):
tempOnosIp.append( main.ONOSip[i] )
- apps=main.apps
- if main.diff:
- apps = main.apps+","+main.diff.pop(0)
- else: main.log.error( "App list is empty" )
onosUser = main.params[ 'ENV' ][ 'cellUser' ]
+ main.step("Creating cell file")
main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
"temp",
main.Mininet1.ip_address,
apps,
- tempOnosIp )
+ tempOnosIp,
+ onosUser )
main.step( "Apply cell to environment" )
cellResult = main.ONOSbench.setCell( "temp" )
@@ -142,7 +144,8 @@
onfail="Failed to apply cell to environment " )
main.step( "Creating ONOS package" )
- main.ONOSbench.handle.sendline( "cp ~/OnosSystemTest/TestON/tests/USECASE_SegmentRouting/"+main.json.pop(0)+".json ~/onos/tools/package/config/network-cfg.json")
+ main.jsonFile=main.json.pop(0)
+ main.ONOSbench.handle.sendline( "cp "+main.path+"/"+main.jsonFile+".json ~/onos/tools/package/config/network-cfg.json")
packageResult = main.ONOSbench.onosPackage()
stepResult = packageResult
utilities.assert_equals( expect=main.TRUE,
@@ -192,7 +195,10 @@
'''
Report errors/warnings/exceptions
'''
- main.log.case( "Logging test" )
+ main.case( "Logging test for " + main.jsonFile )
+ if len(main.json) > 0 :
+ main.ONOSbench.cpLogsToDir("/opt/onos/log/karaf.log",main.logdir,
+ copyFileName="karaf.log."+main.jsonFile+str(len(main.json)))
#main.ONOSbench.logReport( main.ONOSip[ 0 ],
# [ "INFO" ],
# "a" )
@@ -210,7 +216,7 @@
"""
Start mininet
"""
- main.log.case( "Start Leaf-Spine 2x2 Mininet Topology" )
+ main.case( "Start Leaf-Spine "+main.jsonFile+" Mininet Topology" )
main.log.report( "Start Mininet topology" )
main.step( "Starting Mininet Topology" )