Merge "Initial implementation of test suite for ONOS NETCONF functionality using OF-Config -for more information please check the README"
diff --git a/TestON/bin/cleanup.sh b/TestON/bin/cleanup.sh
index 3f82161..f931eca 100755
--- a/TestON/bin/cleanup.sh
+++ b/TestON/bin/cleanup.sh
@@ -29,6 +29,5 @@
echo "Restoring iptables rules on ${i}"
ssh sdn@$i "sudo iptables -F"
ssh sdn@$i "sudo iptables-restore < /etc/iptables/rules.v4"
- exit 0
done
fi
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 54e7d0f..a34741a 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -181,7 +181,7 @@
main.log.info(
"Starting Mininet from topo file " +
topoFile )
- cmdString += topoFile + " "
+ cmdString += "-E python " + topoFile + " "
if args is None:
args = ''
# TODO: allow use of args from .topo file?
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index ba2b37c..3c8b2ef 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -142,8 +142,21 @@
timeout=10 )
if i == 0: # In ONOS CLI
self.handle.sendline( "logout" )
- self.handle.expect( "\$" )
- return main.TRUE
+ j = self.handle.expect( [ "\$",
+ "Command not found:",
+ pexpect.TIMEOUT ] )
+ if j == 0: # Successfully logged out
+ return main.TRUE
+ elif j == 1 or j == 2:
+ # ONOS didn't fully load, and logout command isn't working
+ # or the command timed out
+ self.handle.send( "\x04" ) # send ctrl-d
+ self.handle.expect( "\$" )
+ return main.TRUE
+ else: # some other output
+ main.log.warn( "Unknown repsonse to logout command: '{}'",
+ repr( self.handle.before ) )
+ return main.FALSE
elif i == 1: # not in CLI
return main.TRUE
elif i == 3: # Timeout
@@ -2508,7 +2521,7 @@
nodesStr = self.nodes( jsonFormat=True )
idList = []
# Sample nodesStr output
- # id=local, address=127.0.0.1:9876, state=ACTIVE *
+ # id=local, address=127.0.0.1:9876, state=READY *
if not nodesStr:
main.log.info( "There are no nodes to get id from" )
return idList
@@ -3283,7 +3296,6 @@
response = self.app( appName, "activate" )
if check and response == main.TRUE:
for i in range(10): # try 10 times then give up
- # TODO: Check with Thomas about this delay
status = self.appStatus( appName )
if status == "ACTIVE":
return main.TRUE
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index d8edf32..7dbf023 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -671,7 +671,7 @@
main.exit()
def createCellFile( self, benchIp, fileName, mnIpAddrs,
- appString, onosIpAddrs ):
+ appString, onosIpAddrs, onosUser="sdn" ):
"""
Creates a cell file based on arguments
Required:
@@ -683,6 +683,8 @@
supported currently
* ONOS IP addresses ( onosIpAddrs )
- Must be passed in as last arguments
+ * ONOS USER (onosUser)
+ - optional argument to set ONOS_USER environment variable
NOTE: Assumes cells are located at:
~/<self.home>/tools/test/cells/
@@ -702,6 +704,8 @@
# Note that you may not want certain apps listed
# on here.
appString = "export ONOS_APPS=" + appString
+ onosGroup = "export ONOS_GROUP=" + onosUser
+ onosUser = "export ONOS_USER=" + onosUser
mnString = "export OCN="
if mnIpAddrs == "":
mnString = ""
@@ -734,6 +738,8 @@
cellFile.write( "export OCI=$OC1\n" )
cellFile.write( mnString + "\"" + mnIpAddrs + "\"\n" )
cellFile.write( appString + "\n" )
+ cellFile.write( onosGroup + "\n" )
+ cellFile.write( onosUser + "\n" )
cellFile.close()
# We use os.system to send the command to TestON cluster
@@ -991,16 +997,22 @@
i = self.handle.expect( [
"Job\sis\salready\srunning",
"start/running",
+ "\$",
"Unknown\sinstance",
pexpect.TIMEOUT ], timeout=120 )
- self.handle.expect( "\$" )
if i == 0:
+ self.handle.expect( "\$" )
main.log.info( "Service is already running" )
return main.TRUE
elif i == 1:
+ self.handle.expect( "\$" )
+ main.log.info( "ONOS service started" )
+ return main.TRUE
+ elif i == 2:
main.log.info( "ONOS service started" )
return main.TRUE
else:
+ self.handle.expect( "\$" )
main.log.error( "ONOS service failed to start" )
main.cleanup()
main.exit()
@@ -1028,18 +1040,24 @@
"stop/waiting",
"Could not resolve hostname",
"Unknown\sinstance",
+ "\$",
pexpect.TIMEOUT ], timeout=60 )
- self.handle.expect( "\$" )
if i == 0:
+ self.handle.expect( "\$" )
main.log.info( "ONOS service stopped" )
return main.TRUE
elif i == 1:
+ self.handle.expect( "\$" )
main.log.info( "onosStop() Unknown ONOS instance specified: " +
str( nodeIp ) )
return main.FALSE
elif i == 2:
+ self.handle.expect( "\$" )
main.log.warn( "ONOS wasn't running" )
return main.TRUE
+ elif i == 3:
+ main.log.info( "ONOS service stopped" )
+ return main.TRUE
else:
main.log.error( "ONOS service failed to stop" )
return main.FALSE
@@ -1088,7 +1106,7 @@
try:
self.handle.sendline( "" )
self.handle.expect( "\$" )
- cmdStr = "onos-kill " + str( nodeIp )
+ cmdStr = "onos-die " + str( nodeIp )
self.handle.sendline( cmdStr )
i = self.handle.expect( [
"Killing\sONOS",
@@ -1672,13 +1690,15 @@
" status" )
i = self.handle.expect( [
"start/running",
+ "Running ...",
"stop/waiting",
+ "Not Running ...",
pexpect.TIMEOUT ], timeout=120 )
- if i == 0:
+ if i == 0 or i == 1:
main.log.info( "ONOS is running" )
return main.TRUE
- elif i == 1:
+ elif i == 2 or i == 3:
main.log.info( "ONOS is stopped" )
main.log.error( "ONOS service failed to check the status" )
main.cleanup()
diff --git a/TestON/tests/CHOtest/CHOtest.params b/TestON/tests/CHOtest/CHOtest.params
index 2062a4a..2098689 100644
--- a/TestON/tests/CHOtest/CHOtest.params
+++ b/TestON/tests/CHOtest/CHOtest.params
@@ -1,5 +1,5 @@
<PARAMS>
- # 1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*20,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*20,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*20
+ # 1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*10,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*10,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*10
# 1. Starts ONOS cluster with 5 nodes
# 20. Starts Att Topology
# 21. Starts Chordal Topology
@@ -17,9 +17,14 @@
# 9X. Point,Multi-single,Single-Multi Intents
# 19X. IPv6 ping across Point,Multi-single,Single-Multi Intents
-<testcases>
-1,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*10,200,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*10,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*10
-</testcases>
+ <testcases>
+ 1,21,3,48,148,[5,61,161,72,172,82,182,10,5,91,191,73,173,83,183,10]*20,200,20,3,47,147,[5,60,160,70,170,80,180,10,5,90,190,71,171,81,181,10]*20,200,22,3,49,149,[5,62,162,74,174,84,184,10,5,92,192,75,175,85,185,10]*20
+ </testcases>
+
+ <DEPENDENCY>
+ <path>/tests/CHOtest/Dependencies/</path>
+ <wrapper>CHOtestFunctions</wrapper>
+ </DEPENDENCY>
<GIT>
#autoPull 'on' or 'off'
@@ -87,24 +92,25 @@
</SPINECORELINKS>
<timers>
- <LinkDiscovery>15</LinkDiscovery>
+ <LinkDiscovery>10</LinkDiscovery>
<SwitchDiscovery>10</SwitchDiscovery>
<IntentPurgeDelay>15</IntentPurgeDelay>
<CheckIntentDelay>15</CheckIntentDelay>
<topoCheckDelay>15</topoCheckDelay>
- <pingSleep>3</pingSleep>
- <pingTimeout>300</pingTimeout>
- <remHostDelay>5</remHostDelay>
- <remDevDelay>10</remDevDelay>
+ <pingSleep>15</pingSleep>
+ <pingTimeoutSmallTopo>180</pingTimeoutSmallTopo>
+ <pingTimeoutLargeTopo>300</pingTimeoutLargeTopo>
+ <remHostDelay>60</remHostDelay>
+ <remDevDelay>60</remDevDelay>
</timers>
<TEST>
<pauseTest>off</pauseTest>
<email>off</email>
- <intentChecks>8</intentChecks>
+ <intentChecks>10</intentChecks>
<linkChecks>3</linkChecks>
<topoChecks>3</topoChecks>
- <numPings>5</numPings>
+ <numPings>3</numPings>
</TEST>
</PARAMS>
diff --git a/TestON/tests/CHOtest/CHOtest.py b/TestON/tests/CHOtest/CHOtest.py
index 40bd549..5c9d673 100644
--- a/TestON/tests/CHOtest/CHOtest.py
+++ b/TestON/tests/CHOtest/CHOtest.py
@@ -24,25 +24,33 @@
onos-start-cli
"""
import time
+ import re
+ import imp
global intentState
main.threadID = 0
+ main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+ main.dependencyPath = main.testOnDirectory + \
+ main.params[ 'DEPENDENCY' ][ 'path' ]
+ wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper' ]
main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
git_pull = main.params[ 'GIT' ][ 'autoPull' ]
git_branch = main.params[ 'GIT' ][ 'branch' ]
karafTimeout = main.params['CTRL']['karafCliTimeout']
+ main.linkSleep = int( main.params['timers']['LinkDiscovery'] )
main.checkIntentsDelay = int( main.params['timers']['CheckIntentDelay'] )
+ main.pingSleep = int( main.params['timers']['pingSleep'] )
+ main.topoCheckDelay = int( main.params['timers']['topoCheckDelay'] )
+ main.pingTimeoutSmallTopo = int( main.params['timers']['pingTimeoutSmallTopo'] )
+ main.pingTimeoutLargeTopo = int( main.params['timers']['pingTimeoutLargeTopo'] )
+ main.remHostDelay = int( main.params['timers']['remHostDelay'] )
+ main.remDevDelay = int( main.params['timers']['remDevDelay'] )
main.failSwitch = main.params['TEST']['pauseTest']
main.emailOnStop = main.params['TEST']['email']
main.intentCheck = int( main.params['TEST']['intentChecks'] )
main.linkCheck = int( main.params['TEST']['linkChecks'] )
main.topoCheck = int( main.params['TEST']['topoChecks'] )
main.numPings = int( main.params['TEST']['numPings'] )
- main.pingSleep = int( main.params['timers']['pingSleep'] )
- main.topoCheckDelay = int( main.params['timers']['topoCheckDelay'] )
- main.pingTimeout = int( main.params['timers']['pingTimeout'] )
- main.remHostDelay = int( main.params['timers']['remHostDelay'] )
- main.remDevDelay = int( main.params['timers']['remDevDelay'] )
main.newTopo = ""
main.CLIs = []
@@ -52,6 +60,11 @@
for i in range( 1, int(main.numCtrls) + 1 ):
main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+ main.CHOtestFunctions = imp.load_source( wrapperFile,
+ main.dependencyPath +
+ wrapperFile +
+ ".py" )
+
main.case( "Set up test environment" )
main.log.report( "Set up test environment" )
main.log.report( "_______________________" )
@@ -159,6 +172,7 @@
startCliResult = main.TRUE
main.step( "Set IPv6 cfg parameters for Neighbor Discovery" )
+ time.sleep(30)
cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.proxyarp.ProxyArp", "ipv6NeighborDiscovery", "true" )
cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "ipv6NeighborDiscovery", "true" )
cfgResult = cfgResult1 and cfgResult2
@@ -181,10 +195,11 @@
import copy
main.prefix = 0
-
main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
+ main.pingTimeout = main.pingTimeoutSmallTopo
+
main.log.report(
"Load Att topology and Balance all Mininet switches across controllers" )
main.log.report(
@@ -245,11 +260,12 @@
import copy
main.prefix = 1
-
main.newTopo = main.params['TOPO2']['topo']
main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] )
main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] )
main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] )
+ main.pingTimeout = main.pingTimeoutSmallTopo
+
main.log.report(
"Load Chordal topology and Balance all Mininet switches across controllers" )
main.log.report(
@@ -307,12 +323,11 @@
import copy
main.prefix = 2
-
main.newTopo = main.params['TOPO3']['topo']
main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] )
main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
- main.pingTimeout = 600
+ main.pingTimeout = main.pingTimeoutLargeTopo
main.log.report(
"Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
@@ -562,13 +577,14 @@
str( timeDiff ) +
" seconds" )
- if not pingResult:
- main.stop()
-
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="Reactive Mode IPv4 Pingall test PASS",
onfail="Reactive Mode IPv4 Pingall test FAIL" )
+ if not pingResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
main.step( "Disable Reactive forwarding" )
appResult = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
utilities.assert_equals( expect=main.TRUE, actual=appResult,
@@ -626,6 +642,10 @@
str( timeDiff ) +
" seconds" )
+ if not pingResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
if pingResult == main.TRUE:
main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
else:
@@ -687,6 +707,10 @@
str( timeDiff ) +
" seconds" )
+ if not pingResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
if pingResult == main.TRUE:
main.log.report( "IPv4 Pingall Test in Reactive mode successful" )
else:
@@ -1005,22 +1029,18 @@
onpass="Reactive mode ipv6Fowarding cfg is set to true",
onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
-
+ main.step( "Discover hosts using ping" )
numHosts = int( main.params['TOPO1']['numHosts'] )
-
for i in range(numHosts):
src = "h1"
dest = "1000::" + str(i+1)
main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
main.Mininet1.handle.expect( "mininet>" )
main.log.info( main.Mininet1.handle.before )
-
hosts = main.CLIs[0].hosts( jsonFormat=False )
-
main.log.info( hosts )
main.step( "Disable Reactive forwarding" )
-
main.log.info( "Uninstall IPv6 reactive forwarding app" )
appCheck = main.TRUE
appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1075,22 +1095,18 @@
onpass="Reactive mode ipv6Fowarding cfg is set to true",
onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
-
+ main.step( "Discover hosts using ping" )
numHosts = int( main.params['TOPO2']['numHosts'] )
-
for i in range(numHosts):
src = "h1"
dest = "1000::" + str(i+1)
main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
main.Mininet1.handle.expect( "mininet>" )
main.log.info( main.Mininet1.handle.before )
-
hosts = main.CLIs[0].hosts( jsonFormat=False )
-
main.log.info( hosts )
main.step( "Disable Reactive forwarding" )
-
main.log.info( "Uninstall IPv6 reactive forwarding app" )
appCheck = main.TRUE
appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1145,22 +1161,18 @@
onpass="Reactive mode ipv6Fowarding cfg is set to true",
onfail="Failed to cfg set Reactive mode ipv6Fowarding" )
-
+ main.step( "Discover hosts using ping" )
numHosts = int( main.params['TOPO3']['numHosts'] )
-
for i in range(11, numHosts+10):
src = "h11"
dest = "1000::" + str(i+1)
main.Mininet1.handle.sendline( src + " ping6 " + dest + " -c 3 -i 1 -W 1")
main.Mininet1.handle.expect( "mininet>" )
main.log.info( main.Mininet1.handle.before )
-
hosts = main.CLIs[0].hosts( jsonFormat=False )
-
main.log.info( hosts )
main.step( "Disable Reactive forwarding" )
-
main.log.info( "Uninstall IPv6 reactive forwarding app" )
appCheck = main.TRUE
appResults = main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
@@ -1307,79 +1319,20 @@
"""
main.log.report( "Add 300 host intents and verify pingall (Att Topology)" )
main.log.report( "_______________________________________" )
- import itertools
- import time
main.case( "Install 300 host intents" )
+
main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
-
- # Saving intent ids to check intents in later cases
+ intentIdList = main.CHOtestFunctions.installHostIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
+ intentState = main.CHOtestFunctions.checkIntents()
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(3)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
+ pingResult = main.CHOtestFunctions.checkPingall()
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -1406,90 +1359,29 @@
"""
main.log.report( "Add 300 host intents and verify pingall (Chordal Topo)" )
main.log.report( "_______________________________________" )
- import itertools
-
main.case( "Install 300 host intents" )
+
main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
-
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
-
- # Saving intent ids to check intents in later cases
+ intentIdList = main.CHOtestFunctions.installHostIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) )
-
+ intentState = main.CHOtestFunctions.checkIntents()
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
+ pingResult = main.CHOtestFunctions.checkPingall()
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = ( intentState and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=caseResult,
- onpass="Install 300 Host Intents and Ping All test PASS",
- onfail="Install 300 Host Intents and Ping All test FAIL" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=caseResult,
+ onpass="Install 300 Host Intents and Ping All test PASS",
+ onfail="Install 300 Host Intents and Ping All test FAIL" )
if not intentState:
main.log.debug( "Intents failed to install completely" )
@@ -1506,89 +1398,29 @@
"""
main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
main.log.report( "_______________________________________" )
- import itertools
-
main.case( "Install 2278 host intents" )
- main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
- main.pingTimeout = 300
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
- # Saving intent ids to check intents in later cases
+ main.step( "Add host Intents" )
+ intentIdList = main.CHOtestFunctions.installHostIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) )
-
+ intentState = main.CHOtestFunctions.checkIntents()
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
+ pingResult = main.CHOtestFunctions.checkPingall()
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = ( intentState and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=caseResult,
- onpass="Install 2278 Host Intents and Ping All test PASS",
- onfail="Install 2278 Host Intents and Ping All test FAIL" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=caseResult,
+ onpass="Install 2278 Host Intents and Ping All test PASS",
+ onfail="Install 2278 Host Intents and Ping All test FAIL" )
if not intentState:
main.log.debug( "Intents failed to install completely" )
@@ -1605,24 +1437,12 @@
"""
main.log.report( "Verify IPv6 ping across 300 host intents (Att Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 300 host intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -1633,29 +1453,20 @@
onpass="IPv6 Ping across 300 host intents test PASS",
onfail="IPv6 Ping across 300 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE161( self ):
"""
Verify IPv6 ping across 300 host intents (Chordal Topology)
"""
main.log.report( "Verify IPv6 ping across 300 host intents (Chordal Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 300 host intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -1667,29 +1478,20 @@
onpass="IPv6 Ping across 300 host intents test PASS",
onfail="IPv6 Ping across 300 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE162( self ):
"""
Verify IPv6 ping across 2278 host intents (Spine Topology)
"""
main.log.report( "Verify IPv6 ping across 2278 host intents (Spine Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 2278 host intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
utilities.assert_equals( expect=main.TRUE, actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -1701,6 +1503,10 @@
onpass="IPv6 Ping across 2278 host intents test PASS",
onfail="IPv6 Ping across 2278 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE70( self, main ):
"""
Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
@@ -1716,7 +1522,6 @@
link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -1739,88 +1544,46 @@
END1=link1End1,
END2=main.randomLink1[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link2End1,
END2=main.randomLink2[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link3End1,
END2=main.randomLink3[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+ int( main.numMNlinks ) -
+ int( switchLinksToToggle ) * 6 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = linkDown and pingResult and intentState
- utilities.assert_equals( expect=main.TRUE, actual=caseResult,
+ utilities.assert_equals( expect=main.TRUE,
+ actual=caseResult,
onpass="Random Link cut Test PASS",
onfail="Random Link cut Test FAIL" )
@@ -1844,7 +1607,7 @@
link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
main.log.report(
@@ -1859,84 +1622,39 @@
END1=link1End1,
END2=main.randomLink1[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link2End1,
END2=main.randomLink2[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link3End1,
END2=main.randomLink3[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up",
+ int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -1971,7 +1689,7 @@
link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -1994,83 +1712,39 @@
END1=link1End1,
END2=main.randomLink1[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link2End1,
END2=main.randomLink2[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link3End1,
END2=main.randomLink3[ i ],
OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down",
+ int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2099,7 +1773,7 @@
link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
main.log.report(
@@ -2114,84 +1788,38 @@
END1=link1End1,
END2=main.randomLink1[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link2End1,
END2=main.randomLink2[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link(
END1=link3End1,
END2=main.randomLink3[ i ],
OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2217,7 +1845,7 @@
"""
import random
import itertools
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -2236,73 +1864,28 @@
END1=switch[0],
END2=switch[1],
OPTION="down")
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 5 * 2 ) )
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 5 * 2 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2328,7 +1911,7 @@
Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
"""
import random
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report(
"Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
@@ -2343,74 +1926,28 @@
END1=switch[0],
END2=switch[1],
OPTION="up")
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2436,7 +1973,7 @@
"""
import random
import itertools
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -2455,73 +1992,28 @@
END1=switch[0],
END2=switch[1],
OPTION="down")
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 5 * 2 ) )
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 5 * 2 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2547,7 +2039,7 @@
Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
"""
import random
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report(
"Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
@@ -2562,74 +2054,28 @@
END1=switch[0],
END2=switch[1],
OPTION="up")
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2664,7 +2110,7 @@
link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -2684,75 +2130,30 @@
# main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
# main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
- main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
+ main.step( "Verify link down is discoverd by onos" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 4 ))
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
-
- main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ main.step( "Verify intents are installed" )
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2780,7 +2181,7 @@
import random
link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report(
"Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
main.log.report(
@@ -2793,76 +2194,30 @@
# main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
# main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -2897,8 +2252,7 @@
link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- main.pingTimeout = 400
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" )
main.log.report( "___________________________________________________________________________" )
@@ -2918,75 +2272,30 @@
# main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
# main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link down is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 4 ))
- if linkDown:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkDown = main.CHOtestFunctions.checkLinkEvents( "down", int( main.numMNlinks ) - 4 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3014,7 +2323,7 @@
import random
link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
+ main.linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
main.log.report(
"Bring the core links up that are down and verify ping all (Point Intents-Spine Topo" )
main.log.report(
@@ -3027,76 +2336,30 @@
# main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
# main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
- time.sleep( link_sleep )
+ time.sleep( main.linkSleep )
main.step("Verify link up is discoverd by onos")
- # Giving onos multiple chances to discover link events
- for i in range( main.linkCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli1.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- if linkUp:
- break
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep * main.linkCheck ) +
- " seconds" )
+ linkUp = main.CHOtestFunctions.checkLinkEvents( "up", int( main.numMNlinks ) )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( main.linkSleep * main.linkCheck ) +
+ " seconds" )
main.step("Verify intents are installed")
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Giving onos some time...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
-
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3122,23 +2385,12 @@
"""
main.log.report( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Host Intents-Att Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("Failed to ping Ipv6 hosts. Retrying...")
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3149,30 +2401,22 @@
onpass="IPv6 Ping across 300 host intents test PASS",
onfail="IPv6 Ping across 300 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE180( self ):
"""
IPv6 ping all with after core links back up( Host Intents-Att Topo)
"""
main.log.report( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3183,30 +2427,22 @@
onpass="IPv6 Ping across 300 host intents test PASS",
onfail="IPv6 Ping across 300 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE171( self ):
"""
IPv6 ping all with some core links down( Point Intents-Att Topo)
"""
main.log.report( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Point Intents-Att Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3217,30 +2453,22 @@
onpass="IPv6 Ping across 600 point intents test PASS",
onfail="IPv6 Ping across 600 point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE181( self ):
"""
IPv6 ping all with after core links back up( Point Intents-Att Topo)
"""
main.log.report( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3251,30 +2479,22 @@
onpass="IPv6 Ping across 600 Point intents test PASS",
onfail="IPv6 Ping across 600 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE172( self ):
"""
IPv6 ping all with some core links down( Host Intents-Chordal Topo)
"""
main.log.report( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3291,24 +2511,12 @@
"""
main.log.report( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3319,30 +2527,22 @@
onpass="IPv6 Ping across 300 host intents test PASS",
onfail="IPv6 Ping across 300 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE173( self ):
"""
IPv6 ping all with some core links down( Point Intents-Chordal Topo)
"""
main.log.report( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3353,30 +2553,22 @@
onpass="IPv6 Ping across 600 point intents test PASS",
onfail="IPv6 Ping across 600 point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE183( self ):
"""
IPv6 ping all with after core links back up( Point Intents-Chordal Topo)
"""
main.log.report( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3387,30 +2579,22 @@
onpass="IPv6 Ping across 600 Point intents test PASS",
onfail="IPv6 Ping across 600 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE174( self ):
"""
IPv6 ping all with some core links down( Host Intents-Spine Topo)
"""
main.log.report( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3421,30 +2605,22 @@
onpass="IPv6 Ping across 2278 host intents test PASS",
onfail="IPv6 Ping across 2278 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE184( self ):
"""
IPv6 ping all with after core links back up( Host Intents-Spine Topo)
"""
main.log.report( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3455,30 +2631,22 @@
onpass="IPv6 Ping across 2278 host intents test PASS",
onfail="IPv6 Ping across 2278 host intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE175( self ):
"""
IPv6 ping all with some core links down( Point Intents-Spine Topo)
"""
main.log.report( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3489,30 +2657,22 @@
onpass="IPv6 Ping across 4556 point intents test PASS",
onfail="IPv6 Ping across 4556 point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE185( self ):
"""
IPv6 ping all with after core links back up( Point Intents-Spine Topo)
"""
main.log.report( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First ping failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -3523,90 +2683,37 @@
onpass="IPv6 Ping across 4556 Point intents test PASS",
onfail="IPv6 Ping across 4556 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE90( self ):
"""
Install 600 point intents and verify ping all (Att Topology)
"""
main.log.report( "Add 600 point intents and verify pingall (Att Topology)" )
main.log.report( "_______________________________________" )
- import itertools
- import time
main.case( "Install 600 point intents" )
+
main.step( "Add point Intents" )
- intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
-
- # Saving intent ids to check intents in later case
+ intentIdList = main.CHOtestFunctions.installPointIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = ( intentState and pingResult )
-
utilities.assert_equals(
expect=main.TRUE,
actual=caseResult,
@@ -3628,85 +2735,27 @@
"""
main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" )
main.log.report( "_______________________________________" )
- import itertools
- import time
main.case( "Install 600 point intents" )
+
main.step( "Add point Intents" )
- intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info( "Time for adding point intents: %2f seconds" %(time2-time1) )
-
- # Saving intent ids to check intents in later case
+ intentIdList = main.CHOtestFunctions.installPointIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = ( intentState and pingResult )
-
utilities.assert_equals(
expect=main.TRUE,
actual=caseResult,
@@ -3728,88 +2777,27 @@
"""
main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" )
main.log.report( "_______________________________________" )
- import itertools
- import time
main.case( "Install 4556 point intents" )
- main.step( "Add point Intents" )
- intentResult = main.TRUE
- main.pingTimeout = 600
- for i in range(len(main.hostMACs)):
- main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0]
- print main.MACsDict
- deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- # Saving intent ids to check intents in later case
+ main.step( "Add point Intents" )
+ intentIdList = main.CHOtestFunctions.installPointIntents()
main.intentIds = list(intentIdList)
main.step("Verify intents are installed")
-
- # Giving onos multiple chances to install intents
- for i in range( main.intentCheck ):
- if i != 0:
- main.log.warn( "Verification failed. Retrying..." )
- main.log.info("Waiting for onos to install intents...")
- time.sleep( main.checkIntentsDelay )
-
- intentState = main.TRUE
- for e in range(int(main.numCtrls)):
- main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
- if intentState:
- break
- else:
- #Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=intentState,
+ intentState = main.CHOtestFunctions.checkIntents()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentState,
onpass="INTENTS INSTALLED",
onfail="SOME INTENTS NOT INSTALLED" )
main.step( "Verify Ping across all hosts" )
- for i in range(main.numPings):
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time.sleep(main.pingSleep)
- else: break
-
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall()
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
caseResult = ( intentState and pingResult )
-
utilities.assert_equals(
expect=main.TRUE,
actual=caseResult,
@@ -3864,7 +2852,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -3875,15 +2862,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -3984,7 +2971,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -3995,15 +2981,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -4104,7 +3090,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -4115,15 +3100,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -4223,7 +3208,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -4234,15 +3218,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -4342,7 +3326,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -4353,15 +3336,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -4467,7 +3450,6 @@
main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
main.step("Verify intents are installed")
-
# Giving onos multiple chances to install intents
for i in range( main.intentCheck ):
if i != 0:
@@ -4478,15 +3460,15 @@
intentState = main.TRUE
for e in range(int(main.numCtrls)):
main.log.info( "Checking intents on CLI %s" % (e+1) )
- intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\
- intentState
- if not intentState:
- main.log.warn( "Not all intents installed" )
+ IntentStateIndividual = main.CLIs[e].checkIntentState( intentsId=intentIdList )
+ if not IntentStateIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentState = intentState and IntentStateIndividual
if intentState:
break
- else:
+ if not intentState:
#Dumping intent summary
- main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) )
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
utilities.assert_equals( expect=main.TRUE, actual=intentState,
onpass="INTENTS INSTALLED",
@@ -4555,24 +3537,12 @@
"""
main.log.report( "Verify IPv6 ping across 600 Point intents (Att Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 600 Point intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -4583,30 +3553,22 @@
onpass="IPv6 Ping across 600 Point intents test PASS",
onfail="IPv6 Ping across 600 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE191( self ):
"""
Verify IPv6 ping across 600 Point intents (Chordal Topology)
"""
main.log.report( "Verify IPv6 ping across 600 Point intents (Chordal Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 600 Point intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -4617,30 +3579,22 @@
onpass="IPv6 Ping across 600 Point intents test PASS",
onfail="IPv6 Ping across 600 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE192( self ):
"""
Verify IPv6 ping across 4556 Point intents (Spine Topology)
"""
main.log.report( "Verify IPv6 ping across 4556 Point intents (Spine Topology)" )
main.log.report( "_________________________________________________" )
- import itertools
- import time
main.case( "IPv6 ping all 4556 Point intents" )
+
main.step( "Verify IPv6 Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- if not pingResult:
- main.log.warn("First pingall failed. Retrying...")
- time1 = time.time()
- pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for IPv6 Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
+ pingResult = main.CHOtestFunctions.checkPingall( protocol="IPv6" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=pingResult,
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
@@ -4651,6 +3605,10 @@
onpass="IPv6 Ping across 4556 Point intents test PASS",
onfail="IPv6 Ping across 4556 Point intents test FAIL" )
+ if not caseResult and main.failSwitch:
+ main.log.report("Stopping test")
+ main.stop( email=main.emailOnStop )
+
def CASE10( self ):
import time
import re
@@ -4680,6 +3638,8 @@
removeIntentCount = 0
intentsCount = len(intentsList)
main.log.info ( "Current number of intents: " + str(intentsCount) )
+
+ main.step( "Remove all installed intents" )
if ( len( intentsList ) > 1 ):
results = main.TRUE
main.log.info("Removing intent...")
@@ -4748,6 +3708,8 @@
step1Result = main.FALSE
print main.ONOScli1.intents()
+
+ main.log.info( main.ONOScli1.summary( jsonFormat=False ) )
caseResult = step1Result
utilities.assert_equals( expect=main.TRUE, actual=caseResult,
onpass="Intent removal test successful",
diff --git a/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py b/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
new file mode 100644
index 0000000..7441a5b
--- /dev/null
+++ b/TestON/tests/CHOtest/Dependencies/CHOtestFunctions.py
@@ -0,0 +1,152 @@
+"""
+Wrapper functions for CHOtest
+Author: you@onlab.us
+"""
+
+def __init__( self ):
+ self.default = ''
+
+def installHostIntents():
+ """
+ Install one host intent for each combination of hosts in the topology
+ """
+ import itertools
+ import time
+
+ hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
+ intentIdList = []
+ for i in xrange( 0, len( hostCombos ), int( main.numCtrls ) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( hostCombos ):
+ break
+ t = main.Thread( target=cli.addHostIntent,
+ threadID=main.threadID,
+ name="addHostIntent",
+ args=[hostCombos[i][0],
+ hostCombos[i][1]])
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append( thread.result )
+
+ return intentIdList
+
+def installPointIntents():
+ """
+ Install one point intent for each permutation of devices in the topology
+ """
+ import itertools
+ import time
+
+ if main.prefix == 2:
+ # Spine-leaf topology is a special case
+ for i in range( len( main.hostMACs ) ):
+ main.MACsDict[ main.deviceDPIDs[ i+10 ] ] = main.hostMACs[ i ].split('/')[0]
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
+ else:
+ deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
+ intentIdList = []
+ time1 = time.time()
+ for i in xrange( 0, len( deviceCombos ), int( main.numCtrls ) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( deviceCombos ):
+ break
+ t = main.Thread( target=cli.addPointIntent,
+ threadID=main.threadID,
+ name="addPointIntent",
+ args=[ deviceCombos[i][0],
+ deviceCombos[i][1],
+ 1, 1, '',
+ main.MACsDict.get( deviceCombos[i][0] ),
+ main.MACsDict.get( deviceCombos[i][1] ) ] )
+ pool.append(t)
+ t.start()
+ i = i + 1
+ main.threadID = main.threadID + 1
+ for thread in pool:
+ thread.join()
+ intentIdList.append( thread.result )
+ time2 = time.time()
+ main.log.info("Time taken for adding point intents: %2f seconds" %( time2 - time1 ) )
+
+ return intentIdList
+
+def checkIntents():
+ """
+ Check if all the intents are in INSTALLED state
+ """
+ import time
+
+ intentResult = main.TRUE
+ for i in range( main.intentCheck ):
+ if i != 0:
+ main.log.warn( "Verification failed. Retrying..." )
+ main.log.info("Waiting for onos to install intents...")
+ time.sleep( main.checkIntentsDelay )
+
+ intentResult = main.TRUE
+ for e in range(int(main.numCtrls)):
+ main.log.info( "Checking intents on CLI %s" % (e+1) )
+ intentResultIndividual = main.CLIs[e].checkIntentState( intentsId=main.intentIds )
+ if not intentResultIndividual:
+ main.log.warn( "Not all intents installed on ONOS%s" % (e+1) )
+ intentResult = intentResult and intentResultIndividual
+ if intentResult:
+ break
+ if not intentResult:
+ main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) )
+
+ return intentResult
+
+def checkPingall( protocol="IPv4" ):
+ """
+ Verify ping across all hosts
+ """
+ import time
+
+ pingResult = main.TRUE
+ for i in range( main.numPings ):
+ if i != 0:
+ main.log.warn( "Pingall failed. Retrying..." )
+ main.log.info( "Giving ONOS some time...")
+ time.sleep( main.pingSleep )
+
+ pingResult = main.Mininet1.pingall( protocol=protocol, timeout=main.pingTimeout )
+ if pingResult:
+ break
+
+ return pingResult
+
+def checkLinkEvents( linkEvent, linkNum ):
+ """
+ Verify link down/up events are correctly discovered by ONOS
+ linkNum: the correct link number after link down/up
+ """
+ import time
+
+ linkResult = main.TRUE
+ for i in range( main.linkCheck ):
+ if i != 0:
+ main.log.warn( "Verification failed. Retrying..." )
+ main.log.info( "Giving ONOS some time..." )
+ time.sleep( main.linkSleep )
+
+ linkResult = main.TRUE
+ for e in range( int( main.numCtrls ) ):
+ main.log.info( "Checking link number on ONOS%s" % (e+1) )
+ topology_output = main.CLIs[e].topology()
+ linkResultIndividual = main.ONOSbench.checkStatus( topology_output,
+ main.numMNswitches,
+ str( linkNum ) )
+ if not linkResultIndividual:
+ main.log.warn( "Link %s not discovered by ONOS%s" % ( linkEvent, (e+1) ) )
+ linkResult = linkResult and linkResultIndividual
+ if linkResult:
+ break
+
+ return linkResult
diff --git a/TestON/tests/FUNCintent/Dependency/FuncIntentFunction.py b/TestON/tests/FUNCintent/Dependency/FuncIntentFunction.py
index fe26d5a..989b3a5 100644
--- a/TestON/tests/FUNCintent/Dependency/FuncIntentFunction.py
+++ b/TestON/tests/FUNCintent/Dependency/FuncIntentFunction.py
@@ -328,7 +328,7 @@
itemName = name
onosNode = int( onosNode )
- main.log.info( itemName + ": Adding mutli to single point intents" )
+ main.log.info( itemName + ": Adding point to point intents" )
for sender in senders:
if not sender.get( "device" ):
diff --git a/TestON/tests/FUNCintent/FUNCintent.params b/TestON/tests/FUNCintent/FUNCintent.params
index 26ee48d..3271819 100644
--- a/TestON/tests/FUNCintent/FUNCintent.params
+++ b/TestON/tests/FUNCintent/FUNCintent.params
@@ -11,7 +11,8 @@
# 14 - Discover hosts with Mininet Pingall
# 15 - Discover hosts with Scapy arping ( only discovers scapy hosts )
# 16 - Balance ownership of switches
- # 17 - Stop Mininet
+ # 17 - Activate Flow Objectives
+ # 18 - Stop Mininet
# 1000 - Test host intents
# 2000 - Test point intents
# 3000 - Test single to multi point intents
@@ -19,10 +20,10 @@
# 5000 - Test host mobility
# 6000 - Test Multi Point intent End Point Failure
- <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,17]*2</testcases>
+ <testcases>1,[2,10,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,10,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,1000,2000,3000,4000,5000,6000,18]*2,[2,11,12,13,15,16,17,1000,2000,3000,4000,5000,6000,18]*2</testcases>
<SCALE>
- <size>1,3,1,3</size>
+ <size>1,3,1,3,1,3,1,3</size>
</SCALE>
<DEPENDENCY>
@@ -62,7 +63,7 @@
# Intent tests params
<SDNIP>
<tcpProto>6</tcpProto>
- <icmpProto>1</icmpProto>
+ <ipPrototype>6</ipPrototype>
<srcPort>5001</srcPort>
<dstPort>5001</dstPort>
</SDNIP>
diff --git a/TestON/tests/FUNCintent/FUNCintent.py b/TestON/tests/FUNCintent/FUNCintent.py
index ba4e8dd..0855dc1 100644
--- a/TestON/tests/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNCintent/FUNCintent.py
@@ -134,6 +134,7 @@
# main.scale[ 0 ] determines the current number of ONOS controller
main.numCtrls = int( main.scale[ 0 ] )
+ main.flowCompiler = "Flow Rules"
main.case( "Starting up " + str( main.numCtrls ) +
" node(s) ONOS cluster" )
@@ -548,12 +549,31 @@
balanceResult = utilities.retry( f=main.CLIs[ 0 ].balanceMasters, retValue=main.FALSE, args=[] )
utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
+ actual=balanceResult,
onpass="Successfully balanced mastership of switches",
onfail="Failed to balance mastership of switches" )
def CASE17( self, main ):
"""
+ Use Flow Objectives
+ """
+ main.case( "Enable intent compilation using Flow Objectives" )
+ main.step( "Enabling Flow Objectives" )
+
+ main.flowCompiler = "Flow Objectives"
+
+ cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+ stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
+ propName="useFlowObjectives", value="true" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully activated Flow Objectives",
+ onfail="Failed to activate Flow Objectives" )
+
+ def CASE18( self, main ):
+ """
Stop mininet and remove scapy host
"""
main.log.report( "Stop Mininet and Scapy" )
@@ -626,13 +646,14 @@
main.testName = "Host Intents"
main.case( main.testName + " Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case tests Host intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN " +\
- "etc;\nThe test will use OF " + main.OFProtocol\
- + " OVS running in Mininet"
+ "etc;\nThe test will use OF " + main.OFProtocol +\
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "IPV4: Add host intents between h1 and h9" )
main.assertReturnString = "Assertion Result for IPV4 host intent with mac addresses\n"
@@ -856,14 +877,15 @@
main.testName = "Point Intents"
main.case( main.testName + " Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test point to point" +\
" intents using " + str( main.numCtrls ) +\
" node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
# No option point intents
main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -974,13 +996,13 @@
main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV4 using TCP point intents\n"
senders = [
{ "name":"h1","device":"of:0000000000000005/1","mac":"00:00:00:00:00:01",
- "ip":main.h1.hostIp }
+ "ip":( main.h1.hostIp + "/24" ) }
]
recipients = [
{ "name":"h9","device":"of:0000000000000006/1","mac":"00:00:00:00:00:09",
- "ip":main.h9.hostIp }
+ "ip":( main.h9.hostIp + "/24" ) }
]
- ipProto = main.params[ 'SDNIP' ][ 'icmpProto' ]
+ ipProto = main.params[ 'SDNIP' ][ 'ipPrototype' ]
# Uneccessary, not including this in the selectors
tcpSrc = main.params[ 'SDNIP' ][ 'srcPort' ]
tcpDst = main.params[ 'SDNIP' ][ 'dstPort' ]
@@ -1041,7 +1063,7 @@
tcp2=tcp2 )
utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
+ actual=stepResult,
onpass=main.assertReturnString,
onfail=main.assertReturnString )
@@ -1177,14 +1199,15 @@
main.testName = "Single to Multi Point Intents"
main.case( main.testName + " Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test single point to" +\
" multi point intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "NOOPTION: Install and test single point to multi point intents" )
main.assertReturnString = "Assertion results for IPV4 single to multi point intent with no options set\n"
@@ -1382,14 +1405,15 @@
main.testName = "Multi To Single Point Intents"
main.case( main.testName + " Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test single point to" +\
" multi point intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "NOOPTION: Add multi point to single point intents" )
main.assertReturnString = "Assertion results for NOOPTION multi to single point intent\n"
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.params b/TestON/tests/FUNCintentRest/FUNCintentRest.params
index 07a5cff..7b29e9d 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.params
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.params
@@ -11,17 +11,18 @@
# 14 - Discover all hosts and Create a dictionary of hosts information
# 15 - Discover hosts with scapy arping ( only discovers scapy hosts )
# 16 - Balance ownership of switches
- # 17 - Stop Mininet
+ # 17 - Activate Flow Objectives
+ # 18 - Stop Mininet
# 1000 - Test host intents
# 2000 - Test point intents
# 3000 - Test single to multi point intents
# 4000 - Test multi to single point intents
# 5000 - Test host mobility
- <testcases>1,[2,10,12,13,15,16,1000,2000,5000,17]*2,[2,11,12,13,15,16,1000,2000,5000,17]*2</testcases>
+ <testcases>1,[2,10,12,13,15,16,1000,2000,5000,18]*2,[2,10,12,13,15,16,17,1000,2000,5000,18]*2,[2,11,12,13,15,16,1000,2000,5000,18]*2,[2,11,12,13,15,16,17,1000,2000,5000,18]*2</testcases>
<SCALE>
- <size>1,3,1,3</size>
+ <size>1,3,1,3,1,3,1,3</size>
</SCALE>
<DEPENDENCY>
diff --git a/TestON/tests/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNCintentRest/FUNCintentRest.py
index 1a32bc1..8c6c8d5 100644
--- a/TestON/tests/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNCintentRest/FUNCintentRest.py
@@ -154,6 +154,7 @@
# main.scale[ 0 ] determines the current number of ONOS controller
main.numCtrls = int( main.scale[ 0 ] )
+ main.flowCompiler = "Flow Rules"
main.case( "Starting up " + str( main.numCtrls ) +
" node(s) ONOS cluster" )
@@ -671,6 +672,25 @@
def CASE17( self, main ):
"""
+ Use Flow Objectives
+ """
+ main.case( "Enable intent compilation using Flow Objectives" )
+ main.step( "Enabling Flow Objectives" )
+
+ main.flowCompiler = "Flow Objectives"
+
+ cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+ stepResult = main.CLIs2[ 0 ].setCfg( component=cmd,
+ propName="useFlowObjectives", value="true" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully activated Flow Objectives",
+ onfail="Failed to activate Flow Objectives" )
+
+ def CASE18( self, main ):
+ """
Stop mininet and remove scapy hosts
"""
main.log.report( "Stop Mininet and Scapy" )
@@ -743,13 +763,14 @@
intentLeadersOld = main.CLIs2[ 0 ].leaderCandidates()
main.case( "Host Intents Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case tests Host intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN " +\
- "etc;\nThe test will use OF " + main.OFProtocol\
- + " OVS running in Mininet"
+ "etc;\nThe test will use OF " + main.OFProtocol +\
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "IPV4: Add and test host intents between h1 and h9" )
main.assertReturnString = "Assertion result for IPV4 host intent with mac addresses\n"
@@ -960,14 +981,15 @@
main.numSwitch"
main.case( "Point Intents Test - " + str( main.numCtrls ) +
- " NODE(S) - OF " + main.OFProtocol )
+ " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test point to point" +\
" intents using " + str( main.numCtrls ) +\
" node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
# No option point intents
main.step( "NOOPTION: Add point intents between h1 and h9" )
@@ -1255,14 +1277,15 @@
main.numSwitch"
main.case( "Single To Multi Point Intents Test - " +
- str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+ str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test single point to" +\
" multi point intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "NOOPTION: Add single point to multi point intents" )
stepResult = main.TRUE
@@ -1395,14 +1418,15 @@
main.numSwitch"
main.case( "Multi To Single Point Intents Test - " +
- str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol )
+ str( main.numCtrls ) + " NODE(S) - OF " + main.OFProtocol + " - Using " + main.flowCompiler )
main.caseExplanation = "This test case will test single point to" +\
" multi point intents using " +\
str( main.numCtrls ) + " node(s) cluster;\n" +\
"Different type of hosts will be tested in " +\
"each step such as IPV4, Dual stack, VLAN etc" +\
";\nThe test will use OF " + main.OFProtocol +\
- " OVS running in Mininet"
+ " OVS running in Mininet and compile intents" +\
+ " using " + main.flowCompiler
main.step( "NOOPTION: Add multi point to single point intents" )
stepResult = main.TRUE
diff --git a/TestON/tests/FUNCoptical/FUNCoptical.params b/TestON/tests/FUNCoptical/FUNCoptical.params
index 2d8df50..3735af0 100644
--- a/TestON/tests/FUNCoptical/FUNCoptical.params
+++ b/TestON/tests/FUNCoptical/FUNCoptical.params
@@ -4,16 +4,17 @@
# 2 - Install ONOS
# 10 - Start Mininet opticalTest Topology
# 14 - Stop Mininet
+ # 17 - Activate Flow Objectives
# 21 - Run pingall to discover all hosts
# 22 - Send arpings to discover all hosts
# 23 - Compare ONOS Topology to Mininet Topology
# 31 - Add and test bidirectional point intents
# 32 - Add and test bidirectional host intents
- <testcases>1,2,10,21,22,23,31,32,14,2,10,21,22,23,31,32,14</testcases>
+ <testcases>1,[2,10,21,22,23,31,32,14,2,10,21,22,23,31,32,14]*1,[2,10,17,21,22,23,31,32,14,2,10,17,21,22,23,31,32,14]*1</testcases>
<SCALE>
- <size>1,3</size>
+ <size>1,3,1,3</size>
</SCALE>
<DEPENDENCY>
diff --git a/TestON/tests/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNCoptical/FUNCoptical.py
index 3ab0df4..2d71cc2 100644
--- a/TestON/tests/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNCoptical/FUNCoptical.py
@@ -126,6 +126,7 @@
# main.scale[ 0 ] determines the current number of ONOS controller
main.numCtrls = int( main.scale[ 0 ] )
+ main.flowCompiler = "Flow Rules"
main.case( "Starting up " + str( main.numCtrls ) +
" node(s) ONOS cluster" )
@@ -261,7 +262,7 @@
main.cleanup()
main.exit()
-
+
def CASE14( self, main ):
@@ -284,6 +285,25 @@
main.cleanup()
main.exit()
+ def CASE17( self, main ):
+ """
+ Use Flow Objectives
+ """
+ main.case( "Enable intent compilation using Flow Objectives" )
+ main.step( "Enabling Flow Objectives" )
+
+ main.flowCompiler = "Flow Objectives"
+
+ cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
+
+ stepResult = main.CLIs[ 0 ].setCfg( component=cmd,
+ propName="useFlowObjectives", value="true" )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully activated Flow Objectives",
+ onfail="Failed to activate Flow Objectives" )
+
def CASE21( self,main ):
"""
Run pingall to discover all hosts
@@ -383,7 +403,7 @@
currentDevicesResult = main.TRUE
else:
currentDevicesResult = main.FALSE
- main.log.error( "Node {} only sees {} device(s) but {} exist".format(
+ main.log.error( "Node {} only sees {} device(s) but {} exist".format(
controllerStr,len( deviceData ),mnSwitches ) )
else:
currentDevicesResult = main.FALSE
@@ -402,7 +422,7 @@
currentLinksResult = main.TRUE
else:
currentLinksResult = main.FALSE
- main.log.error( "Node {} only sees {} link(s) but {} exist".format(
+ main.log.error( "Node {} only sees {} link(s) but {} exist".format(
controllerStr,len( linkData ),mnLinks ) )
else:
currentLinksResult = main.FALSE
@@ -421,7 +441,7 @@
currentHostsResult = main.TRUE
else:
currentHostsResult = main.FALSE
- main.log.error( "Node {} only sees {} host(s) but {} exist".format(
+ main.log.error( "Node {} only sees {} host(s) but {} exist".format(
controllerStr,len( hostData ),mnHosts ) )
else:
currentHostsResult = main.FALSE
@@ -494,7 +514,7 @@
main.log.info( "Checking intents state one more time")
checkStateResult = main.CLIs[ 0 ].checkIntentState(
intentsId = main.pIntentsId )
-
+
if checkStateResult and checkFlowResult:
addIntentsResult = main.TRUE
else:
@@ -547,7 +567,7 @@
main.log.info( "Checking intents state" )
intentResult = main.CLIs[ 0 ].checkIntentState( intentsId = intentsId )
# Check intent state again if intents are not in installed state
-
+
# If intent state is wrong, wait 3 sec and try again
if not intentResult:
@@ -557,7 +577,7 @@
# If intent state is still wrong, display intent states
if not intentResult:
main.log.error( main.CLIs[ 0 ].intents() )
-
+
utilities.assert_equals( expect=main.TRUE,
actual=intentResult,
onpass="All intents are in INSTALLED state ",
@@ -572,7 +592,7 @@
pingResult = main.TRUE
pingResult = main.LincOE.pingHostOptical( src="h1", target="h2" ) \
and main.LincOE.pingHostOptical( src="h2",target="h1" )
-
+
utilities.assert_equals( expect=main.TRUE,
actual=pingResult,
onpass="Pinged successfully between h1 and h2",
@@ -585,16 +605,24 @@
intentsJson = json.loads( main.CLIs[ 0 ].intents() )
main.CLIs[ 0 ].removeIntent( intentId=intent1, purge=True )
#main.CLIs[ 0 ].removeIntent( intentId=intent2, purge=True )
+ main.log.debug(intentsJson)
for intents in intentsJson:
- main.CLIs[ 0 ].removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- # Check if any intents could not be removed
- if len( json.loads( main.CLIs[ 0 ].intents() ) ):
- print json.loads( main.CLIs[ 0 ].intents() )
- removeResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=removeResult,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
+ try:
+ main.CLIs[ 0 ].removeIntent( intentId=intents.get( 'id' ),
+ app='org.onosproject.optical',
+ purge=True )
+ except TypeError:
+ main.log.error( "Cannot see intents on Node " + str( main.CLIs[ 0 ] ) +\
+ ". Removing all intents.")
+ main.CLIs[ 0 ].removeAllIntents( purge=True )
+ main.CLIs[ 0 ].removeAllIntents( purge=True, app='org.onosproject.optical')
+ # Check if any intents could not be removed
+ for i in range( main.numCtrls ):
+ if len( json.loads( main.CLIs[ i ].intents() ) ):
+ print json.loads( main.CLIs[ i ].intents() )
+ removeResult = main.FALSE
+ utilities.assert_equals( expect=main.TRUE,
+ actual=removeResult,
+ onpass="Successfully removed host intents",
+ onfail="Failed to remove host intents" )
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index 4e7ac23..f903f95 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -182,7 +182,7 @@
# index = The number of the graph under plot name
job = "HAclusterRestart"
plotName = "Plot-HA"
- index = "1"
+ index = "2"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2533,7 +2533,7 @@
activeIps = []
currentResult = main.FALSE
for node in current:
- if node['state'] == 'ACTIVE':
+ if node['state'] == 'READY':
activeIps.append( node['ip'] )
activeIps.sort()
if ips == activeIps:
diff --git a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
index 925a1c6..5a6de1a 100644
--- a/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HAfullNetPartition/HAfullNetPartition.py
@@ -179,7 +179,7 @@
# index = The number of the graph under plot name
job = "HAfullNetPartition"
plotName = "Plot-HA"
- index = "0"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2537,7 +2537,7 @@
activeIps = []
currentResult = main.FALSE
for node in current:
- if node['state'] == 'ACTIVE':
+ if node['state'] == 'READY':
activeIps.append( node['ip'] )
activeIps.sort()
if ips == activeIps:
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index 3461278..7654097 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -186,7 +186,7 @@
# index = The number of the graph under plot name
job = "HAkillNodes"
plotName = "Plot-HA"
- index = "1"
+ index = "2"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2547,7 +2547,7 @@
activeIps = []
currentResult = main.FALSE
for node in current:
- if node['state'] == 'ACTIVE':
+ if node['state'] == 'READY':
activeIps.append( node['ip'] )
activeIps.sort()
if ips == activeIps:
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index b45bffc..624b720 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -178,7 +178,7 @@
# index = The number of the graph under plot name
job = "HAsanity"
plotName = "Plot-HA"
- index = "1"
+ index = "2"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2434,7 +2434,7 @@
activeIps = []
currentResult = main.FALSE
for node in current:
- if node['state'] == 'ACTIVE':
+ if node['state'] == 'READY':
activeIps.append( node['ip'] )
activeIps.sort()
if ips == activeIps:
diff --git a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index 3ab5072..2b98bbe 100644
--- a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -159,7 +159,7 @@
# index = The number of the graph under plot name
job = "HAsingleInstanceRestart"
plotName = "Plot-HA"
- index = "1"
+ index = "2"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index a98c62a..21ec7f3 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -179,7 +179,7 @@
# index = The number of the graph under plot name
job = "HAstopNodes"
plotName = "Plot-HA"
- index = "1"
+ index = "2"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
@@ -2536,7 +2536,7 @@
activeIps = []
currentResult = main.FALSE
for node in current:
- if node['state'] == 'ACTIVE':
+ if node['state'] == 'READY':
activeIps.append( node['ip'] )
activeIps.sort()
if ips == activeIps:
diff --git a/TestON/tests/PLATdockertest/PLATdockertest.py b/TestON/tests/PLATdockertest/PLATdockertest.py
index f56ae70..2e743f3 100755
--- a/TestON/tests/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLATdockertest/PLATdockertest.py
@@ -167,7 +167,7 @@
main.log.debug("Rest call response: " + str(status) + " - " + response)
if status == 200:
jrsp = json.loads(response)
- clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "ACTIVE"]
+ clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "READY"]
main.log.debug(" IPlist is:" + ",".join(IPlist))
main.log.debug("cluster IP is" + ",".join(clusterIP) )
if set(IPlist) == set(clusterIP): stepResult = main.TRUE
diff --git a/TestON/tests/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPFhostLat/SCPFhostLat.py
index 3dd5129..c24b6a7 100644
--- a/TestON/tests/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPFhostLat/SCPFhostLat.py
@@ -322,11 +322,15 @@
HosttoRemove.append( json.loads( gethost[1:len(gethost)-1] ).get('id') )
main.CLIs[0].removeHost(HosttoRemove)
+ main.log.info("Result List: {}".format(addingHostTime))
+
# calculate average latency from each nodes
averageResult = numpy.average(addingHostTime)
+ main.log.info("Average Latency: {}".format(averageResult))
# calculate std
stdResult = numpy.std(addingHostTime)
+ main.log.info("std: {}".format(stdResult))
# write to DB file
main.log.info("Writing results to DS file")
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/README b/TestON/tests/SCPFintentEventTpWithFlowObj/README
new file mode 100644
index 0000000..980c748
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/README
@@ -0,0 +1,28 @@
+INTENT EVENT THROUGHPUT
+
+Summary: This is a performance test suite to test the intent
+ throughput capabilities of ONOS with various controller cluster sizes.
+
+Pre-requisites: To run out-of-the box this test requires 7 NODES. OC1->OC7
+ must be set before initiating the test. Passwordless login must be set
+ from TestStation "admin" root user.
+
+***If you wish to run this test with less than 7 nodes the following
+ alterations must be made:
+
+NOTE: Only scale sizes 1,3,5 and 7 will be functional
+
+Modifying .params file:
+-- Remove any values in the comma separated list in the
+ <scale> tag that are above your desired cluster size.
+
+-- Remove one instance of “1,2” from the <testcases>
+ tag for each value you removed from <scale> (case 1 and 2 are each
+ called once for each scale value)
+
+-- Change the value in the <max> tag to your desired scale size (1,3, or 5)
+
+Modifying .topo file:
+-- Change the <ONOSbench/COMPONENTS/nodes> tag to your desired scale size
+
+-- Remove all unneeded <ONOS#cli> tags and their contents
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
new file mode 100644
index 0000000..5ccea03
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.params
@@ -0,0 +1,71 @@
+<PARAMS>
+
+ <testcases>1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2,1,3,2</testcases>
+
+ <debugMode></debugMode> #nothing means false
+
+ <ENV>
+ <cellName>intentTP</cellName>
+ <cellApps>drivers,null,intentperf</cellApps>
+ </ENV>
+
+ <SCALE>1,3,3,5,5,7,7</SCALE>
+ <max>7</max>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <USER>admin</USER>
+
+ <ip1>OC1</ip1>
+ <port1>6653</port1>
+
+ <ip2>OC2</ip2>
+ <port2>6653</port2>
+
+ <ip3>OC3</ip3>
+ <port3>6653</port3>
+
+ <ip4>OC4</ip4>
+ <port4>6653</port4>
+
+ <ip5>OC5</ip5>
+ <port5>6653</port5>
+
+ <ip6>OC6</ip6>
+ <port6>6653</port6>
+
+ <ip7>OC7</ip7>
+ <port7>6653</port7>
+ </CTRL>
+
+ <MN><ip1>OCN</ip1></MN>
+
+ <BENCH>
+ <user>admin</user>
+ <ip1>OCN</ip1>
+ </BENCH>
+
+ <TEST>
+ <loadFrom>1,1,1,1,1,1,1</loadFrom> #generate load on server, 1 = generator on
+ <numSwitches>10,10,10,10,10,10,10</numSwitches>
+ <skipCleanInstall>yes</skipCleanInstall>
+ <duration>400</duration>
+ <log_interval>10</log_interval>
+ <numKeys>40000</numKeys>
+ <cyclePeriod>1000</cyclePeriod>
+ <neighbors>0,a</neighbors> #a == all nodes (-1)
+ <flowRuleBUEnabled>true</flowRuleBUEnabled>
+ <skipReleaseResourcesOnWithdrawal>true</skipReleaseResourcesOnWithdrawal>
+ </TEST>
+
+ <METRICS>
+ <intents_rate>intents-events-metrics|grep "Intent Installed Events"|cut -d ' ' -f7</intents_rate>
+ <intents_withdrawn>intents-events-metrics|grep "Intent Withdrawn Events"|cut -d ' ' -f7</intents_withdrawn>
+ <intents_failed>intents-events-metrics|grep "Intent Failed Events"|cut -d ' ' -f7</intents_failed>
+ </METRICS>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
new file mode 100644
index 0000000..092af87
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.py
@@ -0,0 +1,335 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+import time
+
+
+class SCPFintentEventTpWithFlowObj:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+ import sys
+ import os.path
+ import time
+
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Apps = main.params[ 'ENV' ][ 'cellApps' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+ BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ maxNodes = int(main.params[ 'max' ])
+ main.maxNodes = maxNodes
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ numSwitches = (main.params[ 'TEST' ][ 'numSwitches' ]).split(",")
+ flowRuleBU = main.params[ 'TEST' ][ 'flowRuleBUEnabled' ]
+ skipRelRsrc = main.params[ 'TEST'][ 'skipReleaseResourcesOnWithdrawal']
+ homeDir = os.path.expanduser('~')
+
+ main.exceptions = [0]*11
+ main.warnings = [0]*11
+ main.errors = [0]*11
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
+ global scale
+ global commit
+
+ clusterCount = 0
+ ONOSIp = main.ONOSbench.getOnosIps()
+ print ONOSIp
+ print main.ONOSbench.onosIps.values()
+
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
+
+ #Populate ONOSIp with ips from params
+ ONOSIp.extend(main.ONOSbench.getOnosIps())
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
+
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ main.log.step("Grabbing commit number")
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ main.log.step("Creating results file")
+ # Create results file with flow object
+ flowObjResultsDB = open("/tmp/IntentEventTPflowObjDB", "w+")
+ flowObjResultsDB.close()
+
+ # -- END OF INIT SECTION --#
+
+ main.log.step("Adjusting scale")
+ print str(scale)
+ print str(ONOSIp)
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ MN1Ip = ONOSIp[len(ONOSIp) -1]
+ BENCHIp = ONOSIp[len(ONOSIp) -2]
+
+ #kill off all onos processes
+ main.log.step("Safety check, killing all ONOS processes")
+ main.log.step("before initiating environment setup")
+ for node in range(maxNodes):
+ main.ONOSbench.onosDie(ONOSIp[node])
+
+ MN1Ip = ONOSIp[len(ONOSIp) -1]
+ BENCHIp = ONOSIp[len(ONOSIp) -2]
+
+ #Uninstall everywhere
+ main.log.step( "Cleaning Enviornment..." )
+ for i in range(maxNodes):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( ONOSIp[i] )
+ main.log.info("Sleep 10 second for uninstall to settle...")
+ time.sleep(10)
+ main.ONOSbench.handle.sendline(" ")
+ main.ONOSbench.handle.expect(":~")
+
+ #construct the cell file
+ main.log.info("Creating cell file")
+ cellIp = []
+ for node in range (clusterCount):
+ cellIp.append(ONOSIp[node])
+
+ main.ONOSbench.createCellFile("localhost",cellName,MN1Ip,str(Apps), cellIp)
+
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
+
+ myDistribution = []
+ for node in range (clusterCount):
+ myDistribution.append(numSwitches[node])
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+ for node in range(clusterCount):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+
+ for node in range(clusterCount):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+ main.log.info("Startup sequence complete")
+
+ time.sleep(20)
+
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled " + str(flowRuleBU))
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.net.intent.impl.IntentManager", "skipReleaseResourcesOnWithdrawal " + skipRelRsrc)
+ devices = int(clusterCount)*10
+
+ main.log.step("Setting up null provider")
+ for i in range(3):
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "deviceCount " + str(devices))
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
+ main.ONOSbench.onosCfgSet( ONOSIp[0], "org.onosproject.provider.nil.NullProviders", "enabled true")
+ time.sleep(5)
+
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+
+ before = main.ONOSbench.handle.before
+ if ("devices=" + str(devices)) in before:
+ break
+
+ main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+ main.ONOSbench.handle.expect(":~")
+ print main.ONOSbench.handle.before
+
+ for i in range(3):
+ passed = main.ONOSbench.verifySummary( ONOSIp[0] )
+ if passed:
+ main.log.info("Clusters have converged")
+ break
+ else:
+ main.log.error("Clusters have not converged, retying...")
+ time.sleep(3)
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ def CASE2( self, main ):
+ import time
+ import json
+ import string
+ import csv
+ import numpy
+ import os.path
+
+ global currentNeighbors
+ neighbors = []
+
+ try:
+ currentNeighbors
+ except:
+ currentNeighbors = "0"
+ neighbors = ['0']
+ else:
+ if currentNeighbors == "r": #reset
+ currentNeighbors = "a"
+ neighbors = ['0']
+ else:
+ currentNeighbors = "r"
+ neighbors = ['a']
+
+ if clusterCount == 1:
+ currentNeighbors = "r"
+
+ main.log.info("Cluster Count = " + str(clusterCount))
+
+ intentsRate = main.params['METRICS']['intents_rate']
+ intentsWithdrawn = main.params[ 'METRICS' ][ 'intents_withdrawn' ]
+ intentsFailed = main.params[ 'METRICS' ][ 'intents_failed' ]
+ testDuration = main.params[ 'TEST' ][ 'duration' ]
+ logInterval = main.params[ 'TEST' ][ 'log_interval' ]
+ debug = main.params[ 'debugMode' ]
+ numKeys = main.params[ 'TEST' ][ 'numKeys' ]
+ cyclePeriod = main.params[ 'TEST' ][ 'cyclePeriod' ]
+ #neighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
+ metricList = [intentsRate, intentsWithdrawn, intentsFailed]
+
+ for n in range(0, len(neighbors)):
+ if neighbors[n] == 'a':
+ neighbors[n] = str(clusterCount -1)
+ if int(clusterCount) == 1:
+ neighbors = neighbors.pop()
+
+ for n in neighbors:
+ main.log.info("Run with " + n + " neighbors")
+ time.sleep(5)
+ main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numKeys " + numKeys )
+ main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller numNeighbors " + n )
+ main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.handle.sendline("onos $OC1 cfg set org.onosproject.intentperf.IntentPerfInstaller cyclePeriod " + cyclePeriod )
+ main.ONOSbench.handle.expect(":~")
+
+ cmd = "onos $OC1 intent-perf-start"
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ main.log.info("Starting ONOS (all nodes) intent-perf from $OC1" )
+
+ main.log.info( "Starting test loop for " + str(testDuration) + " seconds...\n" )
+ stop = time.time() + float( testDuration )
+
+ while time.time() < stop:
+ time.sleep( float( logInterval ) )
+ groupResult = []
+ for node in range (1, clusterCount + 1):
+ groupResult.append(0)
+
+ cmd = " onos-ssh $OC" + str(node) + """ cat /opt/onos/log/karaf.log | grep "Throughput:" | tail -1 """
+ main.log.info("COMMAND: " + str(cmd))
+
+ x = 0
+ while True:
+ main.ONOSbench.handle.sendline(cmd)
+ time.sleep(6)
+ main.ONOSbench.handle.expect(":~")
+ raw = main.ONOSbench.handle.before
+ if "OVERALL=" in raw:
+ break
+ x += 1
+ if x > 10:
+ main.log.error("Expected output not being recieved... continuing")
+ break
+ time.sleep(2)
+
+ raw = raw.splitlines()
+ splitResults = []
+ for line in raw:
+ splitResults.extend(line.split(" "))
+
+ myResult = "--"
+ for field in splitResults:
+ if "OVERALL" in field:
+ myResult = field
+
+ if myResult == "--":
+ main.log.error("Parsing/Pexpect error\n" + str(splitResults))
+
+ myResult = myResult.replace(";", "")
+ myResult = myResult.replace("OVERALL=","")
+ myResult = float(myResult)
+ groupResult[len(groupResult) -1] = myResult
+
+ main.log.info("Node " + str(node) + " overall rate: " + str(myResult))
+
+ clusterTotal = str(numpy.sum(groupResult))
+ main.log.report("Results from this round of polling: " + str(groupResult))
+ main.log.report("Cluster Total: " + clusterTotal + "\n")
+
+ cmd = "onos $OC1 intent-perf-stop"
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ main.log.info("Stopping intentperf" )
+
+ with open("/tmp/IntentEventTPflowObjDB", "a") as resultsDB:
+ for node in groupResult:
+ resultString = "'" + commit + "',"
+ resultString += "'1gig',"
+ resultString += str(clusterCount) + ","
+ resultString += "'baremetal" + str(int(groupResult.index(node)) + 1) + "',"
+ resultString += n + ","
+ resultString += str(node) + ","
+ resultString += str(0) + "\n" #no stddev
+ resultsDB.write(resultString)
+ resultsDB.close()
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ def CASE3( self, main ):
+ main.step("Set Intent Compiler use Flow Object")
+ stepResult = utilities.retry( main.ONOSbench.onosCfgSet,
+ main.FALSE,
+ args=[ "10.128.174.1",
+ "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
+ "useFlowObjectives true" ],
+ sleep=3,
+ attempts=3 )
+ utilities.assert_equals( expect = main.TRUE,
+ actual = stepResult,
+ onpass = "Successfully set Intent compiler use Flow object",
+ onfail = "Failed to set up" )
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/SCPFintentEventTpWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
+
+ <ONOS4cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4cli>
+
+ <ONOS5cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5cli>
+
+ <ONOS6cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6cli>
+
+ <ONOS7cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ <ONOS2>
+ <host>OC2</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>10</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2>
+
+ <ONOS3>
+ <host>OC3</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>11</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3>
+
+ <ONOS4>
+ <host>OC4</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>12</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4>
+
+
+ <ONOS5>
+ <host>OC5</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>13</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5>
+
+ <ONOS6>
+ <host>OC6</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>14</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6>
+
+ <ONOS7>
+ <host>OC7</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>15</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SCPFintentEventTpWithFlowObj/__init__.py b/TestON/tests/SCPFintentEventTpWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentEventTpWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
new file mode 100644
index 0000000..1521a75
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.params
@@ -0,0 +1,66 @@
+<PARAMS>
+
+ <testcases>1,2,1,2,1,2,1,2</testcases>
+
+ <SCALE>1,3,5,7</SCALE>
+ <max>7</max>
+
+ <ENV>
+ <cellName>IntentInstallWithdrawCell</cellName>
+ <cellApps>drivers,null</cellApps>
+ </ENV>
+
+ <TEST>
+ <skipCleanInstall>yes</skipCleanInstall>
+ <switchCount>7</switchCount>
+ <warmUp>5</warmUp>
+ <sampleSize>20</sampleSize>
+ <wait></wait>
+ <intents>1,100,1000</intents> #list format, will be split on ','
+ <debug>True</debug> #"True" for true
+ </TEST>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <USER>admin</USER>
+
+ <ip1>OC1</ip1>
+ <port1>6653</port1>
+
+ <ip2>OC2</ip2>
+ <port2>6653</port2>
+
+ <ip3>OC3</ip3>
+ <port3>6653</port3>
+
+ <ip4>OC4</ip4>
+ <port4>6653</port4>
+
+ <ip5>OC5</ip5>
+ <port5>6653</port5>
+
+ <ip6>OC6</ip6>
+ <port6>6653</port6>
+
+ <ip7>OC7</ip7>
+ <port7>6653</port7>
+
+ </CTRL>
+
+ <MN>
+ <ip1>localhost</ip1>
+ </MN>
+
+ <BENCH>
+ <user>admin</user>
+ <ip1>localhost</ip1>
+ </BENCH>
+
+ <JSON>
+ </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
new file mode 100644
index 0000000..ec47721
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.py
@@ -0,0 +1,274 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class SCPFintentInstallWithdrawLatWithFlowObj:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+
+ import time
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Apps = main.params[ 'ENV' ][ 'cellApps' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+ BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ main.maxNodes = int(main.params[ 'max' ])
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ switchCount = main.params[ 'TEST' ][ 'switchCount' ]
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
+ global scale
+ global commit
+
+ clusterCount = 0
+ ONOSIp = [ 0 ]
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
+
+ #Populate ONOSIp with ips from params
+ ONOSIp = [0]
+ ONOSIp.extend(main.ONOSbench.getOnosIps())
+
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
+
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ resultsDB = open("/tmp/IntentInstallWithdrawLatDBWFO", "w+")
+ resultsDB.close()
+
+ # -- END OF INIT SECTION --#
+
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
+ main.log.step("Safety check, killing all ONOS processes")
+ main.log.step("before initiating environment setup")
+ for node in range(1, main.maxNodes + 1):
+ main.ONOSbench.onosDie(ONOSIp[node])
+
+ #Uninstall everywhere
+ main.log.step( "Cleaning Enviornment..." )
+ for i in range(1, main.maxNodes + 1):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( ONOSIp[i] )
+
+ #construct the cell file
+ main.log.info("Creating cell file")
+ cellIp = []
+ for node in range (1, clusterCount + 1):
+ cellIp.append(ONOSIp[node])
+
+ main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), cellIp)
+
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
+ for node in range(1, clusterCount + 1):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+
+ for node in range(1, clusterCount + 1):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+
+ main.ONOS1cli.startOnosCli( ONOSIp[1] )
+ main.log.info("Startup sequence complete")
+
+ time.sleep(30)
+
+ for i in range(3):
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", ("deviceCount " + str(switchCount)) )
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape linear")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+ main.ONOS1cli.setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"," useFlowObjectives","true" )
+ if main.ONOSbench.verifySummary(ONOSIp[1], switchCount):
+ break
+ else:
+ print "Failed- looping"
+
+ main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
+ main.ONOSbench.handle.expect(":~")
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ def CASE2( self, main ):
+
+ import time
+ import numpy
+
+ testStatus = "pass"
+ sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+ warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+ intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+ switchCount = int(main.params[ 'TEST' ][ 'switchCount' ])
+ debug = main.params[ 'TEST' ][ 'switchCount' ]
+ for i in range(0,len(intentsList)):
+ intentsList[i] = int(intentsList[i])
+
+ ######################
+ debug = True
+ ######################
+
+ linkCount = 0
+ for i in range(0,10):
+ main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
+ main.ONOSbench.handle.expect(":~")
+ linkCount = main.ONOSbench.handle.before
+ if debug: main.log.info("Link Count check: " + linkCount)
+ if str((switchCount*2)-2) in linkCount:
+ break
+ time.sleep(2)
+
+ links = "--"
+ for i in range(8):
+ if debug: main.log.info("top of loop")
+ main.ONOSbench.handle.sendline("onos $OC1 links")
+ main.ONOSbench.handle.expect(":~")
+ links = main.ONOSbench.handle.before
+ if "=null:" in links:
+ break
+ if debug: main.log.info(str(links))
+ if i > 3:
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+ if i == 7:
+ main.log.error("link data missing")
+ time.sleep(3)
+
+ links = links.splitlines()
+ templinks = links
+
+ tempDevices = []
+ for line in links:
+ temp = line.split(" ")
+ temp[0].replace("src=","")
+ temp[0] = (temp[0].split("/"))[0]
+ tempDevices.append(temp[0])
+
+ tempDevices.sort()
+ devices = []
+ for i in tempDevices:
+ if "src=null" in i:
+ devices.append(i.replace("src=", ""))
+ if debug: main.log.info(str(devices))
+
+ ingress = devices[0]
+ egress = devices.pop()
+ if debug: main.log.info(ingress)
+ if debug: main.log.info(egress)
+
+ for intentSize in intentsList:
+ cmd = "onos $OC1 push-test-intents "
+ cmd += ingress + "/6 "
+ cmd += egress + "/5 "
+ cmd += str(intentSize) + " 1"
+ installed = []
+ withdrawn = []
+ testStatus = ""
+
+ for run in range(0, (warmUp + sampleSize)):
+ if run > warmUp:
+ time.sleep(5)
+
+ myRawResult = "--"
+
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ myRawResult = main.ONOSbench.handle.before
+
+ if debug: main.log.info(myRawResult)
+
+ if run >= warmUp:
+ myRawResult = myRawResult.splitlines()
+ for line in myRawResult:
+ if "Failure:" in line:
+ main.log.error("INTENT TEST FAILURE, ABORTING TESTCASE")
+ testStatus = "fail"
+ break
+
+ if "install" in line:
+ installed.append(int(line.split(" ")[5]))
+
+ if "withdraw" in line:
+ withdrawn.append(int(line.split(" ")[5]))
+
+ if testStatus == "fail":
+ main.log.info("Installed: " + str(installed))
+ main.log.info("Withdrawn: " + str(withdrawn))
+ main.log.info("Scale: " + str(clusterCount))
+ main.log.info("Warmup: " + str(warmUp) + " SampleSize: " + str(sampleSize))
+ main.log.info("Run: " + str(run))
+ main.log.error("Skipping test case")
+ main.skipCase()
+
+ main.log.report("----------------------------------------------------")
+ main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
+ main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
+ main.log.report("Installed average: " + str(numpy.mean(installed)))
+ main.log.report("Installed standard deviation: " + str(numpy.std(installed)))
+ main.log.report("Withdraw average: " + str(numpy.mean(withdrawn)))
+ main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
+ main.log.report(" ")
+
+ resultString = "'" + commit + "',"
+ resultString += str(clusterCount) + ","
+ resultString += str(intentSize) + ","
+ resultString += str(numpy.mean(installed)) + ","
+ resultString += str(numpy.std(installed)) + ","
+ resultString += str(numpy.mean(withdrawn)) + ","
+ resultString += str(numpy.std(withdrawn)) + "\n"
+ resultsDB = open("/tmp/IntentInstallWithdrawLatDBWFO", "a")
+ resultsDB.write(resultString)
+ resultsDB.close()
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+ time.sleep(20)
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/SCPFintentInstallWithdrawLatWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
+
+ <ONOS4cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4cli>
+
+ <ONOS5cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5cli>
+
+ <ONOS6cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6cli>
+
+ <ONOS7cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ <ONOS2>
+ <host>OC2</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>10</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2>
+
+ <ONOS3>
+ <host>OC3</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>11</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3>
+
+ <ONOS4>
+ <host>OC4</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>12</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4>
+
+
+ <ONOS5>
+ <host>OC5</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>13</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5>
+
+ <ONOS6>
+ <host>OC6</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>14</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6>
+
+ <ONOS7>
+ <host>OC7</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>15</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentInstallWithdrawLatWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/README b/TestON/tests/SCPFintentRerouteLatWithFlowObj/README
new file mode 100644
index 0000000..af912f1
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/README
@@ -0,0 +1,29 @@
+INTENT REROUTE LATENCY
+
+Summary: This is a performance test designed to benchmark the
+ intent reroute speed of ONOS at various controller cluster sizes.
+
+Pre-requisites: To run out-of-the box this test requires 7 NODES.
+ OC1->OC7 must be set before initiating the test. Passwordless login
+ must be set from TestStation "admin" root user.
+
+***If you wish to run this test with less than 7 nodes the
+ following alterations must be made:
+
+NOTE: Only scale sizes 1,3,5 and 7 will be functional
+
+Modifying .params file:
+-- Remove any values in the comma separated list in
+ the <scale> tag that are above your desired cluster size.
+
+-- Remove one instance of “1,2” from the <testcases> tag for
+ each value you removed from <scale> (case1 and 2 are each
+ called once for each scale value)
+
+-- Change the value in the <max> tag to your desired scale size (1,3,5)
+
+Modifying .topo file:
+-- Change the <ONOSbench/COMPONENTS/nodes> tag to
+ your desired scale size
+
+-- Remove all unneeded <ONOS#cli> tags and their contents
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
new file mode 100644
index 0000000..73175d1
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.params
@@ -0,0 +1,79 @@
+<PARAMS>
+
+ <testcases>1,2,1,2,1,2,1,2</testcases>
+
+ <SCALE>1,3,5,7</SCALE>
+ <max>7</max>
+
+ <ENV>
+ <cellName>intentRerouteCell</cellName>
+ <cellApps>drivers,null,intentperf,metrics</cellApps>
+ </ENV>
+
+ <TEST>
+ <skipCleanInstall>yes</skipCleanInstall>
+ <warmUp>5</warmUp>
+ <sampleSize>20</sampleSize>
+ <wait></wait>
+ <intents>1,100,1000</intents> #list format, will be split on ','
+ <debug>True</debug>
+
+ <s1>1,1,1,1,1,1,1,1</s1>
+ <s3>2,2,1,1,3,3,3,1</s3>
+ <s5>2,2,1,1,3,4,5,3</s5>
+ <s7>2,3,1,1,5,6,7,4</s7>
+
+ </TEST>
+
+ <METRICS>
+ <Submitted>0</Submitted>
+ <Installed>1</Installed>
+ <Failed>0</Failed>
+ <Withdraw>0</Withdraw>
+ <Withdrawn>0</Withdrawn>
+ </METRICS>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <USER>admin</USER>
+
+ <ip1>OC1</ip1>
+ <port1>6653</port1>
+
+ <ip2>OC2</ip2>
+ <port2>6653</port2>
+
+ <ip3>OC3</ip3>
+ <port3>6653</port3>
+
+ <ip4>OC4</ip4>
+ <port4>6653</port4>
+
+ <ip5>OC5</ip5>
+ <port5>6653</port5>
+
+ <ip6>OC6</ip6>
+ <port6>6653</port6>
+
+ <ip7>OC7</ip7>
+ <port7>6653</port7>
+
+ </CTRL>
+
+ <MN>
+ <ip1>localhost</ip1>
+ </MN>
+
+ <BENCH>
+ <user>admin</user>
+ <ip1>localhost</ip1>
+ </BENCH>
+
+ <JSON>
+ </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
new file mode 100644
index 0000000..439ecef
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.py
@@ -0,0 +1,419 @@
+# ScaleOutTemplate
+#
+# CASE1 starts number of nodes specified in param file
+#
+# cameron@onlab.us
+
+import sys
+import os.path
+
+
+class SCPFintentRerouteLatWithFlowObj:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+
+ import time
+
+ global init
+ try:
+ if type(init) is not bool:
+ init = False
+ except NameError:
+ init = False
+
+ #Load values from params file
+ checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
+ gitPull = main.params[ 'GIT' ][ 'autopull' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+ Apps = main.params[ 'ENV' ][ 'cellApps' ]
+ BENCHUser = main.params[ 'BENCH' ][ 'user' ]
+ BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
+ MN1Ip = main.params[ 'MN' ][ 'ip1' ]
+ main.maxNodes = int(main.params[ 'max' ])
+ skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ if init == False:
+ init = True
+ global clusterCount #number of nodes running
+ global ONOSIp #list of ONOS IP addresses
+ global scale
+ global commit
+
+ clusterCount = 0
+ ONOSIp = [ 0 ]
+ scale = (main.params[ 'SCALE' ]).split(",")
+ clusterCount = int(scale[0])
+
+ #Populate ONOSIp with ips from params
+ ONOSIp = [0]
+ ONOSIp.extend(main.ONOSbench.getOnosIps())
+
+ print("-----------------" + str(ONOSIp))
+ #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
+ if skipMvn != "yes":
+ mvnResult = main.ONOSbench.cleanInstall()
+
+ #git
+ main.step( "Git checkout and pull " + checkoutBranch )
+ if gitPull == 'on':
+ checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
+ pullResult = main.ONOSbench.gitPull()
+
+ else:
+ checkoutResult = main.TRUE
+ pullResult = main.TRUE
+ main.log.info( "Skipped git checkout and pull" )
+
+ commit = main.ONOSbench.getVersion()
+ commit = (commit.split(" "))[1]
+
+ resultsDB = open("/tmp/IntentRerouteLatDBWithFlowObj", "w+")
+ resultsDB.close()
+
+ # -- END OF INIT SECTION --#
+
+ clusterCount = int(scale[0])
+ scale.remove(scale[0])
+
+ #kill off all onos processes
+ main.log.step("Safety check, killing all ONOS processes")
+ main.log.step("before initiating environment setup")
+ for node in range(1, main.maxNodes + 1):
+ main.ONOSbench.onosDie(ONOSIp[node])
+
+ #Uninstall everywhere
+ main.log.step( "Cleaning Enviornment..." )
+ for i in range(1, main.maxNodes + 1):
+ main.log.info(" Uninstalling ONOS " + str(i) )
+ main.ONOSbench.onosUninstall( ONOSIp[i] )
+
+ #construct the cell file
+ main.log.info("Creating cell file")
+ cellIp = []
+ for node in range (1, clusterCount + 1):
+ cellIp.append(ONOSIp[node])
+
+ main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), cellIp)
+
+ main.step( "Set Cell" )
+ main.ONOSbench.setCell(cellName)
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+
+ main.step( "verify cells" )
+ verifyCellResult = main.ONOSbench.verifyCell()
+
+ main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
+ for node in range(1, clusterCount + 1):
+ main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
+ main.ONOSbench.onosInstall( ONOSIp[node])
+
+ for node in range(1, clusterCount + 1):
+ for i in range( 2 ):
+ isup = main.ONOSbench.isup( ONOSIp[node] )
+ if isup:
+ main.log.info("ONOS " + str(node) + " is up\n")
+ break
+ if not isup:
+ main.log.report( "ONOS " + str(node) + " didn't start!" )
+ main.log.info("Startup sequence complete")
+
+ deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
+ print("Device mastership list: " + str(deviceMastership))
+
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.store.flow.impl.NewDistributedFlowRuleStore", "backupEnabled false")
+
+ main.log.step("Setting up null provider")
+ for i in range(3):
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "deviceCount 8")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "topoShape reroute")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.provider.nil.NullProviders", "enabled true")
+ main.ONOSbench.onosCfgSet( ONOSIp[1], "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", "useFlowObjectives true" )
+ time.sleep(5)
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+ x = main.ONOSbench.handle.before
+ if "devices=8" in x and "links=16," in x:
+ break
+
+ index = 1
+ for node in deviceMastership:
+ for attempt in range(0,10):
+ cmd = ( "onos $OC" + node + """ "device-role null:000000000000000""" + str(index) + " " + ONOSIp[int(node)] + """ master" """)
+ main.log.info("assigning mastership of device " + str(index) + " to node " + node + ": \n " + cmd + "\n")
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ time.sleep(4)
+
+ cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
+ main.log.info(cmd)
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ check = main.ONOSbench.handle.before
+ main.log.info("CHECK:\n" + check)
+ if ("master=" + ONOSIp[int(node)]) in check:
+ break
+ index += 1
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
+
+ def CASE2( self, main ):
+
+ import time
+ import numpy
+ import datetime
+ #from scipy import stats
+
+ ts = time.time()
+
+ sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
+ warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
+ intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
+ debug = main.params[ 'TEST' ][ 'debug' ]
+ for i in range(0,len(intentsList)):
+ intentsList[i] = int(intentsList[i])
+
+ timestampMetrics = []
+ if main.params['METRICS']['Submitted'] == "1":
+ timestampMetrics.append("Submitted")
+ if main.params['METRICS']['Installed'] == "1":
+ timestampMetrics.append("Installed")
+ if main.params['METRICS']['Failed'] == "1":
+ timestampMetrics.append("Failed")
+ if main.params['METRICS']['Withdraw'] == "1":
+ timestampMetrics.append("Withdraw")
+ if main.params['METRICS']['Withdrawn'] == "1":
+ timestampMetrics.append("Withdrawn")
+ if debug: main.log.info(timestampMetrics)
+
+ if debug == "True":
+ debug = True
+ else:
+ debug = False
+
+ ingress = "null:0000000000000001"
+ egress = "null:0000000000000007"
+
+ for intents in intentsList:
+ main.log.report("Intent Batch size: " + str(intents) + "\n ")
+ myResult = [["latency", "lastNode"] for x in range(sampleSize)]
+
+ for run in range(0, (warmUp + sampleSize)):
+ if run > warmUp:
+ main.log.info("Starting test iteration " + str(run-warmUp))
+
+ cmd = """onos $OC1 "push-test-intents -i """
+ cmd += ingress + "/0 "
+ cmd += egress + "/0 "
+ cmd += str(intents) +""" 1" """
+ if debug: main.log.info(cmd)
+
+ withdrawCmd = cmd.replace("intents -i", "intents -w ")
+
+ #push-test-intents
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ myRawResult = main.ONOSbench.handle.before
+
+ for i in range(0, 40):
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+ linkCheck = main.ONOSbench.handle.before
+ if ("links=16,") in linkCheck and ("flows=" + str(intents*7) + ","):
+ break
+ if i == 39:
+ main.log.error("Flow/link count incorrect, data invalid."+ linkCheck)
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+ #main.ONOSbench.logReport(ONOSIp[(clusterCount-1)], ["ERROR", "WARNING", "EXCEPT"], "d")
+ main.ONOSbench.sendline("onos $OC1 summary")
+ main.ONOSbench.sendline("onos $OC1 devices")
+ main.ONOSbench.sendline("onos $OC1 links")
+ main.ONOSbench.expect(":~")
+ main.log.info(main.ONOSbench.before)
+
+ #collect timestamp from link cut
+ cmd = """onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 down" """
+ if debug: main.log.info("COMMAND: " + str(cmd))
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+
+ cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
+ for i in range(0,10):
+ main.ONOSbench.handle.sendline(cmd)
+ time.sleep(2)
+ main.ONOSbench.handle.expect(":~")
+ raw = main.ONOSbench.handle.before
+ #if "NullLinkProvider" in raw and "links=14" in raw:
+ if "links=14" in raw:
+ break
+ if i >= 9:
+ main.log.error("Expected output not being recieved... continuing")
+ main.log.info(raw)
+ break
+ time.sleep(2)
+
+ if debug: main.log.debug("raw: " + raw)
+
+ temp = raw.splitlines()
+
+ if debug: main.log.debug("temp (after splitlines): " + str(temp))
+
+ # Since the string is deterministic the date is always the 3rd element.
+ # However, if the data were grepping for in the onos log changes then this will
+ # not work. This is why we print out the raw and temp string so we can visually
+ # check if everything is in the correct order. temp should like this:
+ # temp = ['/onos$ onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep Top ',
+ # 'ologyManager| tail -1', '2015-10-15 12:03:33,736 ... ]
+ temp = temp[2]
+
+ if debug: main.log.debug("temp (checking for date): " + str(temp))
+
+ cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
+
+ if debug: main.log.info("Cut timestamp: " + cutTimestamp)
+
+ #validate link count and flow count
+ for i in range(0, 40):
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+ linkCheck = main.ONOSbench.handle.before
+ #if "links=" + str(7*intents)+ "," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
+ if "links=14," in linkCheck and ("flows=" + str(8*intents) + ",") in linkCheck:
+ break
+ if i == 39:
+ main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
+
+ time.sleep(5) #trying to avoid negative values
+
+ #intents events metrics installed timestamp
+ IEMtimestamps = [0]*(clusterCount + 1)
+ installedTemp = [0]*(clusterCount + 1)
+ for node in range(1, clusterCount +1):
+ cmd = "onos $OC" + str(node) + """ "intents-events-metrics"|grep Timestamp """
+ raw = ""
+ while "epoch)" not in raw:
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+ raw = main.ONOSbench.handle.before
+
+ print(raw)
+
+ intentsTimestamps = {}
+ rawTimestamps = raw.splitlines()
+ for line in rawTimestamps:
+ if "Timestamp" in line and "grep" not in line:
+ metricKey = (line.split(" "))[1]
+ metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
+ metricTimestamp = float(metricTimestamp)
+ metricTimestamp = numpy.divide(metricTimestamp, 1000)
+ if debug: main.log.info(repr(metricTimestamp))
+ intentsTimestamps[metricKey] = metricTimestamp
+ if metricKey == "Installed":
+ installedTemp[node] = metricTimestamp
+
+ main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
+ IEMtimestamps[node] = intentsTimestamps
+
+ myMax = max(installedTemp)
+ indexOfMax = installedTemp.index(myMax)
+
+ #number crunch
+ for metric in timestampMetrics: #this is where we sould add support for computing other timestamp metrics
+ if metric == "Installed":
+ if run >= warmUp:
+ main.log.report("link cut timestamp: " + cutTimestamp)
+ #readableInstalledTimestamp = str(intentsTimestamps["Installed"])
+ readableInstalledTimestamp = str(myMax)
+
+ #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
+ main.log.report("Intent Installed timestamp: " + str(myMax))
+
+ cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
+ if debug: main.log.info("cutEpoch=" + str(cutEpoch))
+ #rerouteLatency = float(intentsTimestamps["Installed"] - cutEpoch)
+ rerouteLatency = float(myMax - cutEpoch)
+
+ rerouteLatency = numpy.divide(rerouteLatency, 1000)
+ main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n ")
+ myResult[run-warmUp][0] = rerouteLatency
+ myResult[run-warmUp][1] = indexOfMax
+ if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
+ if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
+
+ cmd = """ onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 up" """
+ if debug: main.log.info(cmd)
+ main.ONOSbench.handle.sendline(cmd)
+ main.ONOSbench.handle.expect(":~")
+
+ #wait for intent withdraw
+ main.ONOSbench.handle.sendline(withdrawCmd)
+ main.log.info(withdrawCmd)
+ main.ONOSbench.handle.expect(":~")
+ if debug: main.log.info(main.ONOSbench.handle.before)
+ main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
+ main.ONOSbench.handle.expect(":~")
+ intentWithdrawCheck = main.ONOSbench.handle.before
+ if (str(intents)) in intentWithdrawCheck:
+ main.log.info("intents withdrawn")
+ if debug: main.log.info(intentWithdrawCheck)
+
+ # wait for links to be reestablished
+ for i in range(0, 10):
+ main.ONOSbench.handle.sendline("onos $OC1 summary")
+ main.ONOSbench.handle.expect(":~")
+ linkCheck = main.ONOSbench.handle.before
+ if "links=16," in linkCheck:
+ break
+ time.sleep(1)
+ if i == 9:
+ main.log.info("Links Failed to reconnect, next iteration of data invalid." + linkCheck)
+
+ if run < warmUp:
+ main.log.info("Warm up run " + str(run+1) + " completed")
+
+ if debug: main.log.info(myResult)
+ latTemp = []
+ nodeTemp = []
+ for i in myResult:
+ latTemp.append(i[0])
+ nodeTemp.append(i[1])
+
+ mode = {}
+ for i in nodeTemp:
+ if i in mode:
+ mode[i] += 1
+ else:
+ mode[i] = 1
+
+ for i in mode.keys():
+ if mode[i] == max(mode.values()):
+ nodeMode = i
+
+ average = numpy.average(latTemp)
+ stdDev = numpy.std(latTemp)
+
+ average = numpy.multiply(average, 1000)
+ stdDev = numpy.multiply(stdDev, 1000)
+
+ main.log.report("Scale: " + str(clusterCount) + " \tIntent batch: " + str(intents))
+ main.log.report("Latency average:................" + str(average))
+ main.log.report("Latency standard deviation:....." + str(stdDev))
+ main.log.report("Mode of last node to respond:..." + str(nodeMode))
+ main.log.report("________________________________________________________")
+
+ resultsDB = open("/tmp/IntentRerouteLatDBWithFlowObj", "a")
+ resultsDB.write("'" + commit + "',")
+ resultsDB.write(str(clusterCount) + ",")
+ resultsDB.write(str(intents) + ",")
+ resultsDB.write(str(average) + ",")
+ resultsDB.write(str(stdDev) + "\n")
+ resultsDB.close()
+
+ main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
new file mode 100644
index 0000000..01370b6
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/SCPFintentRerouteLatWithFlowObj.topo
@@ -0,0 +1,147 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
+
+ <ONOS4cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4cli>
+
+ <ONOS5cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5cli>
+
+ <ONOS6cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6cli>
+
+ <ONOS7cli>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ <ONOS2>
+ <host>OC2</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>10</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2>
+
+ <ONOS3>
+ <host>OC3</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>11</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3>
+
+ <ONOS4>
+ <host>OC4</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>12</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS4>
+
+
+ <ONOS5>
+ <host>OC5</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>13</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS5>
+
+ <ONOS6>
+ <host>OC6</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>14</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS6>
+
+ <ONOS7>
+ <host>OC7</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>15</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS7>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SCPFintentRerouteLatWithFlowObj/__init__.py b/TestON/tests/SCPFintentRerouteLatWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFintentRerouteLatWithFlowObj/__init__.py
diff --git a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
index 68b040f..830fbf2 100644
--- a/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPFscaleTopo/SCPFscaleTopo.py
@@ -341,7 +341,7 @@
def CASE100( self, main ):
'''
- Balance masters, ping and bring third ONOS node down
+ Bring Down node 3
'''
main.case("Balancing Masters and bring ONOS node 3 down: TORUS %sx%s" % (main.currScale, main.currScale))
@@ -360,7 +360,10 @@
main.log.info( "Removing dead node from list of active nodes" )
main.activeNodes.pop( main.deadNode )
-
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully bring down node 3",
+ onfail="Failed to bring down node 3" )
def CASE200( self, main ):
'''
diff --git a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 03d6c56..27bc5c2 100644
--- a/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -402,6 +402,8 @@
offtmp = 0
main.step( "Pushing intents" )
stepResult = main.TRUE
+ # temp variable to contain the number of flows
+ flowsNum = 0
for i in range(limit):
@@ -457,9 +459,8 @@
break
intentVerify = main.FALSE
k = k+1
-
if not intentVerify:
- # If some intents are not installed, finished this test case
+ # If some intents are not installed, grep the previous flows list, and finished this test case
main.log.warn( "Some intens did not install" )
# We don't want to check flows if intents not installed, because onos will drop flows
if currFlows == 0:
@@ -471,13 +472,16 @@
main.log.info("Verify Flows states")
k = 1
flowsVerify = main.TRUE
-
while k <= main.verifyAttempts:
# while loop for check flows by using REST api
time.sleep(3)
temp = 0
flowsStateCount = []
flowsState = json.loads( main.ONOSrest1.flows() )
+ main.log.info("Total flows now: {}".format(len(flowsState)))
+ if ( flowsNum < len(flowsState) ):
+ flowsNum = len(flowsState)
+ print(flowsNum)
for f in flowsState:
# get PENDING_ADD flows
if f.get("state") == "PENDING_ADD":
@@ -531,7 +535,7 @@
# we need the total intents before crash
totalIntents = len(intentsState)
- totalFlows = len(flowsState)
+ totalFlows = flowsNum
main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py
new file mode 100755
index 0000000..774f12f
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/rerouteTopo.py
@@ -0,0 +1,74 @@
+#!/usr/bin/python
+
+"""
+Custom topology for Mininet
+"""
+from mininet.topo import Topo
+from mininet.net import Mininet
+from mininet.node import Host, RemoteController
+from mininet.node import Node
+from mininet.link import TCLink
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.util import dumpNodeConnections
+from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
+class MyTopo( Topo ):
+
+ def __init__( self ):
+ # Initialize topology
+ Topo.__init__( self )
+
+ host1 = self.addHost('h1', ip='10.1.0.1/24')
+ host2 = self.addHost('h2', ip='10.1.0.2/24')
+ host3 = self.addHost('h3', ip='10.1.0.3/24')
+ host4 = self.addHost('h4', ip='10.1.0.4/24')
+ host5 = self.addHost('h5', ip='10.1.0.5/24')
+ host6 = self.addHost('h6', ip='10.1.0.6/24')
+ host7 = self.addHost('h7', ip='10.1.0.7/24')
+
+ s1 = self.addSwitch( 's1' )
+ s2 = self.addSwitch( 's2' )
+ s3 = self.addSwitch( 's3' )
+ s4 = self.addSwitch( 's4' )
+ s5 = self.addSwitch( 's5' )
+ s6 = self.addSwitch( 's6' )
+ s7 = self.addSwitch( 's7' )
+ s8 = self.addSwitch( 's8' )
+
+
+ self.addLink(s1, host1)
+ self.addLink(s2, host2)
+ self.addLink(s3, host3)
+ self.addLink(s4, host4)
+ self.addLink(s5, host5)
+ self.addLink(s6, host6)
+ self.addLink(s7, host7)
+
+
+
+ self.addLink(s1,s2)
+ self.addLink(s2,s3)
+ self.addLink(s3,s4)
+ self.addLink(s4,s5)
+ self.addLink(s5,s6)
+ self.addLink(s6,s7)
+ self.addLink(s4,s8)
+ self.addLink(s8,s5)
+
+ topos = { 'mytopo': ( lambda: MyTopo() ) }
+
+# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
+def setupNetwork():
+ "Create network"
+ topo = MyTopo()
+ network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network.start()
+ CLI( network )
+ network.stop()
+
+if __name__ == '__main__':
+ setLogLevel('info')
+ #setLogLevel('debug')
+ setupNetwork()
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py
new file mode 100644
index 0000000..bf2a2b6
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/Dependency/startUp.py
@@ -0,0 +1,38 @@
+"""
+ 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" )
+
+ # Maven clean install
+ buildResult = main.ONOSbench.cleanInstall()
+
+ return buildResult
+
+
+
+
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README
new file mode 100644
index 0000000..0c16859
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/README
@@ -0,0 +1,11 @@
+Summary:
+ This is a performance test suit, designed to test the upper limits
+ of onos and ovsdb with respect to installing intents.
+ In this test, CASE10 set up null provoder, CASE 11 set up ovs. Start from
+ 1 node, and scale to 7 nodes.
+ We push intents to every node by using Thread, and when the intents number
+ reach to the minimun number, we will verify intents and flows. If intents are
+ not installed correctly, test will stop pushing and finish this case.
+NOTE:
+ This test is largely based on the hardware used to run onos and mininet.
+ Therefore, results will very test station to test station.
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
new file mode 100644
index 0000000..a6a3377
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.params
@@ -0,0 +1,99 @@
+<PARAMS>
+
+ # 0-init
+ # 1-setup
+ # 2-Install
+ # 10-null provider setup
+ # 20-pushing intents, and rerouting intents if reroute is true
+ # 0,1,2,10,20,1,2,10,20,1,2,10,20
+ <testcases>0,1,2,11,20,1,2,11,20,1,2,11,20,1,2,11,20</testcases>
+
+ <reroute>False</reroute>
+
+ <SCALE>1,3,5,7</SCALE>
+
+ <DEPENDENCY>
+ <path>/tests/SCPFscalingMaxIntents/Dependency/</path>
+ <wrapper1>startUp</wrapper1>
+ <topology>rerouteTopo.py</topology>
+ </DEPENDENCY>
+
+ <ENV>
+ <cellName>productionCell</cellName>
+ <cellApps>drivers</cellApps>
+ </ENV>
+
+ <GIT>
+ <pull>False</pull>
+ <branch>master</branch>
+ </GIT>
+
+ <CTRL>
+ <port>6653</port>
+ </CTRL>
+
+ <SLEEP>
+ <startup>10</startup>
+ <install>10</install>
+ <verify>15</verify>
+ <reroute>3</reroute>
+ # timeout for pexpect
+ <timeout>300</timeout>
+ </SLEEP>
+
+ <ATTEMPTS>
+ <verify>3</verify>
+ <push>3</push>
+ </ATTEMPTS>
+
+ <DATABASE>
+ <file>/tmp/ScalingMaxIntentDBWFO</file>
+ <nic>1gig</nic>
+ <node>baremetal</node>
+ </DATABASE>
+
+ <LINK>
+ <ingress>0000000000000001/5</ingress>
+ <egress>0000000000000007/5</egress>
+ </LINK>
+
+ # CASE10
+ <NULL>
+ # CASE20
+ <PUSH>
+ <batch_size>100</batch_size>
+ <min_intents>100</min_intents>
+ <max_intents>100000</max_intents>
+ <check_interval>100</check_interval>
+ </PUSH>
+
+ # if reroute is true
+ <REROUTE>
+ <batch_size>1000</batch_size>
+ <min_intents>10000</min_intents>
+ <max_intents>1000000</max_intents>
+ <check_interval>100000</check_interval>
+ </REROUTE>
+ </NULL>
+
+ # CASE11
+ <OVS>
+ # CASE20
+ <PUSH>
+ <batch_size>1000</batch_size>
+ <min_intents>10000</min_intents>
+ <max_intents>500000</max_intents>
+ <check_interval>10000</check_interval>
+ </PUSH>
+
+ # if reroute is true
+ <REROUTE>
+ <batch_size>1000</batch_size>
+ <min_intents>10000</min_intents>
+ <max_intents>500000</max_intents>
+ <check_interval>10000</check_interval>
+ </REROUTE>
+ </OVS>
+
+
+</PARAMS>
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
new file mode 100644
index 0000000..e405fd3
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.py
@@ -0,0 +1,561 @@
+import sys
+import json
+import time
+import os
+'''
+SCPFscalingMaxIntentsWithFlowObj
+Push test Intents to onos
+CASE10: set up Null Provider
+CASE11: set up Open Flows
+Scale up when reach the Limited
+Start from 1 nodes, 8 devices. Then Scale up to 3,5,7 nodes
+Recommand batch size: 100, check interval: 100
+'''
+class SCPFscalingMaxIntentsWithFlowObj:
+ def __init__( self ):
+ self.default = ''
+
+ def CASE0( self, main):
+ import sys
+ import json
+ import time
+ import os
+ import imp
+
+ main.case( "Constructing test variables and building ONOS package" )
+ main.step( "Constructing test variables" )
+ stepResult = main.FALSE
+
+ # Test variables
+ main.testOnDirectory = os.path.dirname( os.getcwd ( ) )
+ main.dependencyPath = main.testOnDirectory + \
+ main.params['DEPENDENCY']['path']
+ main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+ main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+ main.scale = ( main.params[ 'SCALE' ] ).split( "," )
+ main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
+ main.timeout = int(main.params['SLEEP']['timeout'])
+ main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+ main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
+ main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] )
+ main.rerouteSleep = int ( main.params['SLEEP']['reroute'] )
+ main.verifyAttempts = int( main.params['ATTEMPTS']['verify'] )
+ main.ingress = main.params['LINK']['ingress']
+ main.egress = main.params['LINK']['egress']
+ main.dbFileName = main.params['DATABASE']['file']
+ main.cellData = {} # for creating cell file
+ main.reroute = main.params['reroute']
+ main.threadID = 0
+
+ if main.reroute == "True":
+ main.reroute = True
+ else:
+ main.reroute = False
+
+ main.CLIs = []
+ main.ONOSip = []
+ main.maxNumBatch = 0
+ main.ONOSip = main.ONOSbench.getOnosIps()
+ main.log.info(main.ONOSip)
+ main.setupSkipped = False
+
+ wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+ gitBranch = main.params[ 'GIT' ][ 'branch' ]
+ gitPull = main.params[ 'GIT' ][ 'pull' ]
+ nic = main.params['DATABASE']['nic']
+ node = main.params['DATABASE']['node']
+ nic = main.params['DATABASE']['nic']
+ node = main.params['DATABASE']['node']
+ stepResult = main.TRUE
+
+ main.log.info("Cresting DB file")
+ with open(main.dbFileName, "w+") as dbFile:
+ dbFile.write("")
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="environment set up successfull",
+ onfail="environment set up Failed" )
+
+ def CASE1( self ):
+ # main.scale[ 0 ] determines the current number of ONOS controller
+ main.CLIs = []
+ main.numCtrls = int( main.scale[ 0 ] )
+ main.log.info( "Creating list of ONOS cli handles" )
+ for i in range(main.numCtrls):
+ main.CLIs.append( getattr( main, 'ONOScli%s' % (i+1) ) )
+
+ main.log.info(main.CLIs)
+ if not main.CLIs:
+ main.log.error( "Failed to create the list of ONOS cli handles" )
+ main.cleanup()
+ main.exit()
+
+ main.log.info( "Loading wrapper files" )
+ main.startUp = imp.load_source( wrapperFile1,
+ main.dependencyPath +
+ wrapperFile1 +
+ ".py" )
+
+ copyResult = main.ONOSbench.copyMininetFile( main.topology,
+ main.dependencyPath,
+ main.Mininet1.user_name,
+ main.Mininet1.ip_address )
+
+ commit = main.ONOSbench.getVersion(report=True)
+ commit = commit.split(" ")[1]
+
+ if gitPull == 'True':
+ if not main.startUp.onosBuild( main, gitBranch ):
+ main.log.error( "Failed to build ONOS" )
+ main.cleanup()
+ main.exit()
+ else:
+ main.log.warn( "Did not pull new code so skipping mvn " +
+ "clean install" )
+ with open(main.dbFileName, "a") as dbFile:
+ temp = "'" + commit + "',"
+ temp += "'" + nic + "',"
+ dbFile.write(temp)
+
+ def CASE2( self, main ):
+ """
+ - Uninstall ONOS cluster
+ - Verify ONOS start up
+ - Install ONOS cluster
+ - Connect to cli
+ """
+ main.log.info( "Starting up %s node(s) ONOS cluster" % main.numCtrls)
+ main.log.info( "Safety check, killing all ONOS processes" +
+ " before initiating environment setup" )
+
+ for i in range( main.numCtrls ):
+ main.ONOSbench.onosDie( main.ONOSip[ i ] )
+
+ main.log.info( "NODE COUNT = %s" % main.numCtrls)
+
+ tempOnosIp = []
+ for i in range( main.numCtrls ):
+ tempOnosIp.append( main.ONOSip[i] )
+
+ main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
+ "temp",
+ main.Mininet1.ip_address,
+ main.apps,
+ tempOnosIp )
+
+ main.step( "Apply cell to environment" )
+ cellResult = main.ONOSbench.setCell( "temp" )
+ verifyResult = main.ONOSbench.verifyCell()
+ stepResult = cellResult and verifyResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully applied cell to " + \
+ "environment",
+ onfail="Failed to apply cell to environment " )
+
+ main.step( "Creating ONOS package" )
+ packageResult = main.ONOSbench.onosPackage()
+ stepResult = packageResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully created ONOS package",
+ onfail="Failed to create ONOS package" )
+
+ main.step( "Uninstall ONOS package on all Nodes" )
+ uninstallResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "Uninstalling package on ONOS Node IP: " + main.ONOSip[i] )
+ u_result = main.ONOSbench.onosUninstall( main.ONOSip[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=u_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ uninstallResult = ( uninstallResult and u_result )
+
+ main.step( "Install ONOS package on all Nodes" )
+ installResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "Installing package on ONOS Node IP: " + main.ONOSip[i] )
+ i_result = main.ONOSbench.onosInstall( node=main.ONOSip[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=i_result,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ installResult = installResult and i_result
+
+ main.step( "Verify ONOS nodes UP status" )
+ statusResult = main.TRUE
+ for i in range( int( main.numCtrls ) ):
+ main.log.info( "ONOS Node " + main.ONOSip[i] + " status:" )
+ onos_status = main.ONOSbench.onosStatus( node=main.ONOSip[i] )
+ utilities.assert_equals( expect=main.TRUE, actual=onos_status,
+ onpass="Test step PASS",
+ onfail="Test step FAIL" )
+ statusResult = ( statusResult and onos_status )
+
+ main.step( "Start ONOS CLI on all nodes" )
+ cliResult = main.TRUE
+ main.log.step(" Start ONOS cli using thread ")
+ startCliResult = main.TRUE
+ pool = []
+
+ for i in range( int( main.numCtrls) ):
+ t = main.Thread( target=main.CLIs[i].startOnosCli,
+ threadID=main.threadID,
+ name="startOnosCli",
+ args=[ main.ONOSip[i] ],
+ kwargs = {"onosStartTimeout":main.timeout} )
+ pool.append(t)
+ t.start()
+ main.threadID = main.threadID + 1
+ for t in pool:
+ t.join()
+ startCliResult = startCliResult and t.result
+ time.sleep( main.startUpSleep )
+
+ def CASE10( self, main ):
+ """
+ Setting up null-provider
+ """
+ import json
+ # Activate apps
+ main.step("Activating null-provider")
+ appStatus = utilities.retry( main.CLIs[0].activateApp,
+ main.FALSE,
+ ['org.onosproject.null'],
+ sleep=main.verifySleep,
+ attempts=main.verifyAttempts )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=appStatus,
+ onpass="Successfully activated null-provider",
+ onfail="Failed activate null-provider" )
+
+ # Setup the null-provider
+ main.step("Configuring null-provider")
+ cfgStatus = utilities.retry( main.ONOSbench.onosCfgSet,
+ main.FALSE,
+ [ main.ONOSip[0],
+ 'org.onosproject.provider.nil.NullProviders', 'deviceCount 8'],
+ sleep=main.verifySleep,
+ attempts = main.verifyAttempts )
+ cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
+ main.FALSE,
+ [ main.ONOSip[0],
+ 'org.onosproject.provider.nil.NullProviders', 'topoShape reroute'],
+ sleep=main.verifySleep,
+ attempts = main.verifyAttempts )
+
+ cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
+ main.FALSE,
+ [ main.ONOSip[0],
+ 'org.onosproject.provider.nil.NullProviders', 'enabled true'],
+ sleep=main.verifySleep,
+ attempts = main.verifyAttempts )
+
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=cfgStatus,
+ onpass="Successfully configured null-provider",
+ onfail="Failed to configure null-provider" )
+
+ # give onos some time to settle
+ time.sleep(main.startUpSleep)
+
+ main.log.info("Setting default flows to zero")
+ main.defaultFlows = 0
+
+ main.step("Check status of null-provider setup")
+ caseResult = appStatus and cfgStatus
+ utilities.assert_equals( expect=main.TRUE,
+ actual=caseResult,
+ onpass="Setting up null-provider was successfull",
+ onfail="Failed to setup null-provider" )
+
+ # This tells the following cases if we are using the null-provider or ovs
+ main.switchType = "null:"
+
+ # If the null-provider setup was unsuccessfull, then there is no point to
+ # run the subsequent cases
+
+ time.sleep(main.startUpSleep)
+ main.step( "Balancing Masters" )
+
+ stepResult = main.FALSE
+ stepResult = utilities.retry( main.CLIs[0].balanceMasters,
+ main.FALSE,
+ [],
+ sleep=3,
+ attempts=3 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Balance masters was successfull",
+ onfail="Failed to balance masters")
+
+ time.sleep( 5 )
+ if not caseResult:
+ main.setupSkipped = True
+
+ def CASE11( self, main):
+ '''
+ Setting up mininet
+ '''
+ import json
+ import time
+
+ time.sleep(main.startUpSleep)
+
+ main.step("Activating openflow")
+ appStatus = utilities.retry( main.ONOSrest1.activateApp,
+ main.FALSE,
+ ['org.onosproject.openflow'],
+ sleep=3,
+ attempts=3 )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=appStatus,
+ onpass="Successfully activated openflow",
+ onfail="Failed activate openflow" )
+
+ time.sleep(main.startUpSleep)
+ main.log.info("Set Intent Compiler use Flow Object")
+ main.CLIs[0].setCfg( "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator", "useFlowObjectives", "true" )
+
+ main.step('Starting mininet topology')
+ mnStatus = main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
+ utilities.assert_equals( expect=main.TRUE,
+ actual=mnStatus,
+ onpass="Successfully started Mininet",
+ onfail="Failed to activate Mininet" )
+
+ main.step("Assinging masters to switches")
+ switches = main.Mininet1.getSwitches()
+ swStatus = main.Mininet1.assignSwController( sw=switches.keys(), ip=main.ONOSip )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=swStatus,
+ onpass="Successfully assigned switches to masters",
+ onfail="Failed assign switches to masters" )
+
+ time.sleep(main.startUpSleep)
+
+ main.log.info("Getting default flows")
+ jsonSum = json.loads(main.CLIs[0].summary())
+ main.defaultFlows = jsonSum["flows"]
+
+ main.step("Check status of Mininet setup")
+ caseResult = appStatus and mnStatus and swStatus
+ utilities.assert_equals( expect=main.TRUE,
+ actual=caseResult,
+ onpass="Successfully setup Mininet",
+ onfail="Failed setup Mininet" )
+
+ # This tells the following cases if we are using the null-provider or ovs
+ main.switchType = "of:"
+
+ time.sleep(main.startUpSleep)
+ main.step( "Balancing Masters" )
+
+ stepResult = main.FALSE
+ stepResult = utilities.retry( main.CLIs[0].balanceMasters,
+ main.FALSE,
+ [],
+ sleep=3,
+ attempts=3 )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Balance masters was successfull",
+ onfail="Failed to balance masters")
+
+ time.sleep(5)
+ if not caseResult:
+ main.setupSkipped = True
+
+
+
+ def CASE20( self, main ):
+ if main.reroute:
+ main.minIntents = int(main.params['NULL']['REROUTE']['min_intents'])
+ main.maxIntents = int(main.params['NULL']['REROUTE']['max_intents'])
+ main.checkInterval = int(main.params['NULL']['REROUTE']['check_interval'])
+ main.batchSize = int(main.params['NULL']['REROUTE']['batch_size'])
+ else:
+ main.minIntents = int(main.params['NULL']['PUSH']['min_intents'])
+ main.maxIntents = int(main.params['NULL']['PUSH']['max_intents'])
+ main.checkInterval = int(main.params['NULL']['PUSH']['check_interval'])
+ main.batchSize = int(main.params['NULL']['PUSH']['batch_size'])
+
+ # check if the case needs to be skipped
+ if main.setupSkipped:
+ main.setupSkipped = False
+ main.skipCase()
+
+ # the index where the next intents will be installed
+ offfset = 0
+ # keeps track of how many intents have been installed
+ currIntents = 0
+ # keeps track of how many flows have been installed, set to 0 at start
+ currFlows = 0
+ # limit for the number of intents that can be installed
+ limit = main.maxIntents / main.batchSize
+ # total intents installed
+ totalIntents = 0
+
+ intentsState = None
+
+ offtmp = 0
+ main.step( "Pushing intents" )
+ stepResult = main.TRUE
+ # temp variable to contain the number of flows
+ flowsNum = 0
+
+ for i in range(limit):
+
+ # Threads pool
+ pool = []
+
+ for j in range( int( main.numCtrls) ):
+ if main.numCtrls > 1:
+ time.sleep( 1 )
+ offtmp = offfset + main.maxIntents * j
+ # Push intents by using threads
+ t = main.Thread( target=main.CLIs[j].pushTestIntents,
+ threadID=main.threadID,
+ name="Push-Test-Intents",
+ args=[ main.switchType + main.ingress,
+ main.switchType + main.egress,
+ main.batchSize ],
+ kwargs={ "offset": offtmp,
+ "options": "-i",
+ "timeout": main.timeout,
+ "background":False } )
+ pool.append(t)
+ t.start()
+ main.threadID = main.threadID + 1
+ for t in pool:
+ t.join()
+ stepResult = stepResult and t.result
+ offfset = offfset + main.batchSize
+
+ totalIntents = main.batchSize * main.numCtrls + totalIntents
+ if totalIntents >= main.minIntents and totalIntents % main.checkInterval == 0:
+ # if reach to minimum number and check interval, verify Intetns and flows
+ time.sleep( main.verifySleep * main.numCtrls )
+
+ main.log.info("Verify Intents states")
+ # k is a control variable for verify retry attempts
+ k = 1
+ intentVerify = main.FALSE
+
+ while k <= main.verifyAttempts:
+ # while loop for check intents by using REST api
+ time.sleep(5)
+ temp = 0
+ intentsState = json.loads( main.ONOSrest1.intents() )
+ for f in intentsState:
+ # get INSTALLED intents number
+ if f.get("state") == "INSTALLED":
+ temp = temp + 1
+
+ main.log.info("Total Intents: {} INSTALLED: {}".format(totalIntents, temp))
+ if totalIntents == temp:
+ intentVerify = main.TRUE
+ break
+ intentVerify = main.FALSE
+ k = k+1
+ if not intentVerify:
+ # If some intents are not installed, grep the previous flows list, and finished this test case
+ main.log.warn( "Some intens did not install" )
+ # We don't want to check flows if intents not installed, because onos will drop flows
+ if currFlows == 0:
+ # If currFlows equal 0, which means we failed to install intents at first, or we didn't get
+ # the correct number, so we need get flows here.
+ flowsState = json.loads( main.ONOSrest1.flows() )
+ break
+
+ main.log.info("Verify Flows states")
+ k = 1
+ flowsVerify = main.TRUE
+ while k <= main.verifyAttempts:
+ # while loop for check flows by using REST api
+ time.sleep(3)
+ temp = 0
+ flowsStateCount = []
+ flowsState = json.loads( main.ONOSrest1.flows() )
+ main.log.info("Total flows now: {}".format(len(flowsState)))
+ if ( flowsNum < len(flowsState) ):
+ flowsNum = len(flowsState)
+ print(flowsNum)
+ for f in flowsState:
+ # get PENDING_ADD flows
+ if f.get("state") == "PENDING_ADD":
+ temp = temp + 1
+
+ flowsStateCount.append(temp)
+ temp = 0
+
+ for f in flowsState:
+ # get PENDING_REMOVE flows
+ if f.get("state") == "PENDING_REMOVE":
+ temp = temp + 1
+
+ flowsStateCount.append(temp)
+ temp = 0
+
+ for f in flowsState:
+ # get REMOVED flows
+ if f.get("state") == "REMOVED":
+ temp = temp + 1
+
+ flowsStateCount.append(temp)
+ temp = 0
+
+ for f in flowsState:
+ # get FAILED flwos
+ if f.get("state") == "FAILED":
+ temp = temp + 1
+
+ flowsStateCount.append(temp)
+ temp = 0
+ k = k + 1
+ for c in flowsStateCount:
+ if int(c) > 0:
+ flowsVerify = main.FALSE
+
+ main.log.info( "Check flows States:" )
+ main.log.info( "PENDING_ADD: {}".format( flowsStateCount[0]) )
+ main.log.info( "PENDING_REMOVE: {}".format( flowsStateCount[1]) )
+ main.log.info( "REMOVED: {}".format( flowsStateCount[2]) )
+ main.log.info( "FAILED: {}".format( flowsStateCount[3]) )
+
+ if flowsVerify == main.TRUE:
+ break
+
+ del main.scale[0]
+ utilities.assert_equals( expect = main.TRUE,
+ actual = intentVerify,
+ onpass = "Successfully pushed and verified intents",
+ onfail = "Failed to push and verify intents" )
+
+ # we need the total intents before crash
+ totalIntents = len(intentsState)
+ totalFlows = flowsNum
+
+ main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
+ main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )
+
+ main.step('clean up Mininet')
+ main.Mininet1.stopNet()
+
+ main.log.info("Writing results to DS file")
+ with open(main.dbFileName, "a") as dbFile:
+ # Scale number
+ temp = str(main.numCtrls)
+ temp += ",'" + "baremetal1" + "'"
+ # how many intents we installed before crash
+ temp += "," + str(totalIntents)
+ # how many flows we installed before crash
+ temp += "," + str(totalFlows)
+ # other columns in database, but we didn't use in this test
+ temp += "," + "0,0,0,0,0,0"
+ temp += "\n"
+ dbFile.write( temp )
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
new file mode 100755
index 0000000..fd28336
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/SCPFscalingMaxIntentsWithFlowObj.topo
@@ -0,0 +1,101 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <home>~/onos</home>
+ <nodes>7</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOSrest1>
+ <host>OC1</host>
+ <port>8181</port>
+ <user>onos</user>
+ <password>rocks</password>
+ <type>OnosRestDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS>
+ </COMPONENTS>
+ </ONOSrest1>
+ <ONOScli1>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli1>
+
+ <ONOScli2>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli2>
+
+ <ONOScli3>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>4</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli3>
+
+ <ONOScli4>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli4>
+
+ <ONOScli5>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>6</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli5>
+
+ <ONOScli6>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>7</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli6>
+
+ <ONOScli7>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>8</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli7>
+
+ <Mininet1>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>MininetCliDriver</type>
+ <connect_order>5</connect_order>
+ <COMPONENTS>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/SCPFscalingMaxIntentsWithFlowObj/__init__.py
diff --git a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index 8e601a3..58fce87 100644
--- a/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -328,7 +328,7 @@
onfail="MultiPointToSinglePoint Intent Num is wrong!" )
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -405,7 +405,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -479,7 +479,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -551,7 +551,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -595,7 +595,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -647,7 +647,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
@@ -703,7 +703,7 @@
main.exit()
main.step( "Check whether all flow status are ADDED" )
- flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
+ flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
index aef817d..3fccbe2 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.params
@@ -8,7 +8,7 @@
</ENV>
<CTRL>
- <numCtrl>1</numCtrl>
+ <numCtrl>3</numCtrl>
<ip1>OC1</ip1>
<ip2>OC2</ip2>
<ip3>OC3</ip3>
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index 42b4bc8..7593368 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.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' ]
@@ -34,7 +34,6 @@
sw = "sw%s" % ( i )
swResult = swResult and main.Mininet.assignSwController( sw,
[ONOS1Ip, ONOS2Ip, ONOS3Ip] )
-
utilities.assert_equals( expect=main.TRUE,
actual=swResult,
onpass="Successfully connect all switches to ONOS",
@@ -158,6 +157,7 @@
onpass="ONOS CLIs are ready",
onfail="ONOS CLIs are not ready" )
+ main.step( "Checking if ONOS CLI is ready for issuing commands" )
for i in range( 10 ):
ready = True
for cli in main.CLIs:
@@ -181,16 +181,21 @@
main.log.info( "waiting link discovery......" )
time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
- main.log.info( "Get links in the network" )
+ main.step( "Get links in the network" )
summaryResult = main.ONOScli1.summary()
linkNum = json.loads( summaryResult )[ "links" ]
- listResult = main.ONOScli1.links( jsonFormat=False )
- main.log.info( listResult )
+ main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
if linkNum < 100:
- main.log.error( "Link number is wrong!" )
+ main.log.error( "Link number is wrong! Retrying..." )
time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
- listResult = main.ONOScli1.links( jsonFormat=False )
- main.log.info( listResult )
+ summaryResult = main.ONOScli1.summary()
+ linkNum = json.loads( summaryResult )[ "links" ]
+ main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
+ utilities.assert_equals( expect=100,
+ actual=linkNum,
+ onpass="ONOS correctly discovered all links",
+ onfail="ONOS Failed to discover all links" )
+ if linkNum < 100:
main.cleanup()
main.exit()
@@ -237,7 +242,7 @@
ping test from 3 bgp peers to BGP speaker
'''
- main.case( "Ping tests between BGP peers and speakers" )
+ main.case( "Ping between BGP peers and speakers" )
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
peers=["peer64514", "peer64515", "peer64516"],
expectAllSuccess=True )
@@ -261,18 +266,17 @@
bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6 * 2
if bgpIntentsActualNum != bgpIntentsExpectedNum:
time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
bgpIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
main.log.info( "bgpIntentsExpected num is:" )
main.log.info( bgpIntentsExpectedNum )
main.log.info( "bgpIntentsActual num is:" )
main.log.info( bgpIntentsActualNum )
- utilities.assertEquals( \
- expect=True,
- actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
- onpass="PointToPointIntent Intent Num is correct!",
- onfail="PointToPointIntent Intent Num is wrong!" )
-
+ utilities.assert_equals( expect=bgpIntentsExpectedNum,
+ actual=bgpIntentsActualNum,
+ onpass="PointToPointIntent Intent Num is correct!",
+ onfail="PointToPointIntent Intent Num is wrong!" )
def CASE3( self, main ):
'''
@@ -281,6 +285,7 @@
import time
main.case( "Check routes and M2S intents to all BGP peers" )
+ main.step( "Check routes installed" )
allRoutesExpected = []
allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
@@ -297,15 +302,14 @@
main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
main.log.info( "Routes expected:" )
main.log.info( allRoutesStrExpected )
main.log.info( "Routes get from ONOS CLI:" )
main.log.info( allRoutesStrActual )
- utilities.assertEquals( \
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="Routes are correct!",
- onfail="Routes are wrong!" )
+ utilities.assert_equals( expect=allRoutesStrExpected,
+ actual=allRoutesStrActual,
+ onpass="Routes are correct!",
+ onfail="Routes are wrong!" )
main.step( "Check M2S intents installed" )
getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
@@ -314,6 +318,7 @@
routeIntentsExpectedNum = 3
if routeIntentsActualNum != routeIntentsExpectedNum:
time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+ getIntentsResult = main.ONOScli1.intents( jsonFormat=True )
routeIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
@@ -321,22 +326,20 @@
main.log.info( routeIntentsExpectedNum )
main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
main.log.info( routeIntentsActualNum )
- utilities.assertEquals( \
- expect=routeIntentsExpectedNum,
- actual=routeIntentsActualNum,
- onpass="MultiPointToSinglePoint Intent Num is correct!",
- onfail="MultiPointToSinglePoint Intent Num is wrong!" )
+ utilities.assert_equals( expect=routeIntentsExpectedNum,
+ actual=routeIntentsActualNum,
+ onpass="MultiPointToSinglePoint Intent Num is correct!",
+ onfail="MultiPointToSinglePoint Intent Num is wrong!" )
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.ONOScli1.checkFlowsState,
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
def CASE4( self, main ):
@@ -358,10 +361,10 @@
main.step( "Bring down the link between sw32 and peer64514" )
linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
OPTION="down" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult1,
- onpass="Bring down link succeeded!",
- onfail="Bring down link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult1,
+ onpass="Bring down link succeeded!",
+ onfail="Bring down link failed!" )
if linkResult1 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -375,10 +378,10 @@
main.step( "Bring down the link between sw8 and peer64515" )
linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
OPTION="down" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult2,
- onpass="Bring down link succeeded!",
- onfail="Bring down link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult2,
+ onpass="Bring down link succeeded!",
+ onfail="Bring down link failed!" )
if linkResult2 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 1 )
@@ -391,10 +394,10 @@
main.step( "Bring down the link between sw28 and peer64516" )
linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
OPTION="down" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult3,
- onpass="Bring down link succeeded!",
- onfail="Bring down link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult3,
+ onpass="Bring down link succeeded!",
+ onfail="Bring down link failed!" )
if linkResult3 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 0 )
@@ -409,11 +412,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -423,7 +425,6 @@
hosts=["host64514", "host64515", "host64516"],
expectAllSuccess=False )
-
def CASE6( self, main ):
'''
Recover links to peers one by one, check routes/intents
@@ -433,10 +434,10 @@
main.step( "Bring up the link between sw32 and peer64514" )
linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
OPTION="up" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult1,
- onpass="Bring up link succeeded!",
- onfail="Bring up link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult1,
+ onpass="Bring up link succeeded!",
+ onfail="Bring up link failed!" )
if linkResult1 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 1 )
@@ -449,10 +450,10 @@
main.step( "Bring up the link between sw8 and peer64515" )
linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
OPTION="up" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult2,
- onpass="Bring up link succeeded!",
- onfail="Bring up link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult2,
+ onpass="Bring up link succeeded!",
+ onfail="Bring up link failed!" )
if linkResult2 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 2 )
@@ -465,10 +466,10 @@
main.step( "Bring up the link between sw28 and peer64516" )
linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
OPTION="up" )
- utilities.assertEquals( expect=main.TRUE,
- actual=linkResult3,
- onpass="Bring up link succeeded!",
- onfail="Bring up link failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=linkResult3,
+ onpass="Bring up link succeeded!",
+ onfail="Bring up link failed!" )
if linkResult3 == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 3 )
@@ -483,11 +484,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -497,7 +497,6 @@
hosts=["host64514", "host64515", "host64516"],
expectAllSuccess=True )
-
def CASE7( self, main ):
'''
Shut down a edge switch, check P-2-P and M-2-S intents, ping test
@@ -506,9 +505,9 @@
main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
main.step( "Stop sw32" )
result = main.Mininet.switch( SW="sw32", OPTION="stop" )
- utilities.assertEquals( expect=main.TRUE, actual=result,
- onpass="Stopping switch succeeded!",
- onfail="Stopping switch failed!" )
+ utilities.assert_equals( expect=main.TRUE, actual=result,
+ onpass="Stopping switch succeeded!",
+ onfail="Stopping switch failed!" )
if result == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -571,12 +570,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
-
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
def CASE8( self, main ):
'''
@@ -587,18 +584,16 @@
main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
main.step( "Start sw32" )
result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=result1,
- onpass="Starting switch succeeded!",
- onfail="Starting switch failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=result1,
+ onpass="Starting switch succeeded!",
+ onfail="Starting switch failed!" )
result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=result2,
- onpass="Connect switch to ONOS succeeded!",
- onfail="Connect switch to ONOS failed!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=result2,
+ onpass="Connect switch to ONOS succeeded!",
+ onfail="Connect switch to ONOS failed!" )
if result1 and result2:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -615,11 +610,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -632,7 +626,6 @@
hosts=["host64514", "host64515", "host64516"],
expectAllSuccess=True )
-
def CASE9( self, main ):
'''
Bring down a switch in best path, check:
@@ -651,9 +644,9 @@
main.step( "Stop sw11" )
result = main.Mininet.switch( SW="sw11", OPTION="stop" )
- utilities.assertEquals( expect=main.TRUE, actual=result,
- onpass="Stopping switch succeeded!",
- onfail="Stopping switch failed!" )
+ utilities.assert_equals( expect=main.TRUE, actual=result,
+ onpass="Stopping switch succeeded!",
+ onfail="Stopping switch failed!" )
if result:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
@@ -670,11 +663,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
peers=["peer64514", "peer64515", "peer64516"],
@@ -703,13 +695,13 @@
main.step( "Start sw11" )
result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
- utilities.assertEquals( expect=main.TRUE, actual=result1,
- onpass="Starting switch succeeded!",
- onfail="Starting switch failed!" )
+ utilities.assert_equals( expect=main.TRUE, actual=result1,
+ onpass="Starting switch succeeded!",
+ onfail="Starting switch failed!" )
result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
- utilities.assertEquals( expect=main.TRUE, actual=result2,
- onpass="Connect switch to ONOS succeeded!",
- onfail="Connect switch to ONOS failed!" )
+ utilities.assert_equals( expect=main.TRUE, actual=result2,
+ onpass="Connect switch to ONOS succeeded!",
+ onfail="Connect switch to ONOS failed!" )
if result1 and result2:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 3 )
@@ -729,11 +721,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
peers=["peer64514", "peer64515", "peer64516"],
@@ -759,11 +750,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
peers=["peer64514", "peer64515", "peer64516"],
@@ -810,11 +800,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
'''
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
@@ -871,11 +860,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
else:
main.Functions.checkRouteNum( main, 3 )
main.Functions.checkM2SintentNum( main, 3 )
@@ -886,11 +874,10 @@
main.FALSE,
kwargs={'isPENDING':False},
attempts=10 )
- utilities.assertEquals( \
- expect=main.TRUE,
- actual=flowCheck,
- onpass="Flow status is correct!",
- onfail="Flow status is wrong!" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=flowCheck,
+ onpass="Flow status is correct!",
+ onfail="Flow status is wrong!" )
main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
peers=["peer64514", "peer64515", "peer64516"],
diff --git a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
index f3c9b5f..a10527a 100644
--- a/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
+++ b/TestON/tests/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.topo
@@ -26,6 +26,14 @@
<connect_order>3</connect_order>
<COMPONENTS> </COMPONENTS>
</ONOScli2>
+ <ONOScli3>
+ <host>127.0.0.1</host>
+ <user>admin</user>
+ <password></password>
+ <type>OnosCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOScli3>
<QuaggaCliSpeaker1>
<host>127.0.0.1</host>
@@ -49,4 +57,3 @@
</COMPONENT>
</TOPOLOGY>
-
diff --git a/TestON/tests/USECASE_SegmentRouting/2x2.json b/TestON/tests/USECASE_SegmentRouting/2x2.json
new file mode 100644
index 0000000..31b2cc8
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/2x2.json
@@ -0,0 +1,104 @@
+{
+ "ports" : {
+ "of:0000000000000001/3" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.1.254/24" ]
+ }
+ ]
+ },
+ "of:0000000000000001/4" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.1.254/24" ]
+ }
+ ]
+ },
+ "of:0000000000000002/3" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.2.254/24" ]
+ }
+ ]
+ },
+ "of:0000000000000002/4" : {
+ "interfaces" : [
+ {
+ "ips" : [ "10.0.2.254/24" ]
+ }
+ ]
+ }
+ },
+ "devices" : {
+ "of:0000000000000001" : {
+ "basic":{ "driver" : "ofdpa-cpqd" },
+ "segmentrouting" : {
+ "name" : "Leaf-R1",
+ "nodeSid" : 1,
+ "routerIp" : "192.168.0.1",
+ "routerMac" : "00:00:00:00:00:01",
+ "isEdgeRouter" : true,
+ "adjacencySids" : []
+ }
+ },
+ "of:0000000000000002" : {
+ "basic":{ "driver" : "ofdpa-cpqd" },
+ "segmentrouting" : {
+ "name" : "Leaf-R2",
+ "nodeSid" : 2,
+ "routerIp" : "192.168.0.2",
+ "routerMac" : "00:00:00:00:00:02",
+ "isEdgeRouter" : true,
+ "adjacencySids" : []
+ }
+ },
+ "of:0000000000000101" : {
+ "basic":{ "driver" : "ofdpa-cpqd" },
+ "segmentrouting" : {
+ "name" : "Spine-R1",
+ "nodeSid" : 101,
+ "routerIp" : "192.168.0.101",
+ "routerMac" : "00:00:00:00:01:01",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ }
+ },
+ "of:0000000000000102" : {
+ "basic":{ "driver" : "ofdpa-cpqd" },
+ "segmentrouting" : {
+ "name" : "Spine-R2",
+ "nodeSid" : 102,
+ "routerIp" : "192.168.0.102",
+ "routerMac" : "00:00:00:00:01:02",
+ "isEdgeRouter" : false,
+ "adjacencySids" : []
+ }
+ }
+ },
+ "hosts" : {
+ "00:00:00:00:00:01/-1" : {
+ "basic": {
+ "ips": ["10.0.1.1"],
+ "location": "of:0000000000000001/3"
+ }
+ },
+ "00:00:00:00:00:02/-1" : {
+ "basic": {
+ "ips": ["10.0.1.2"],
+ "location": "of:0000000000000001/4"
+ }
+ },
+ "00:00:00:00:00:03/-1" : {
+ "basic": {
+ "ips": ["10.0.2.1"],
+ "location": "of:0000000000000002/3"
+ }
+ },
+ "00:00:00:00:00:04/-1" : {
+ "basic": {
+ "ips": ["10.0.2.2"],
+ "location": "of:0000000000000002/4"
+ }
+ }
+ }
+}
diff --git a/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
new file mode 100755
index 0000000..a2a8a8e
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/Dependency/cord_fabric.py
@@ -0,0 +1,93 @@
+#!/usr/bin/python
+
+import os
+from optparse import OptionParser
+
+from mininet.net import Mininet
+from mininet.topo import Topo
+from mininet.node import RemoteController, UserSwitch, Host
+from mininet.link import TCLink
+from mininet.log import setLogLevel
+from mininet.cli import CLI
+
+# Parse command line options and dump results
+def parseOptions():
+ """Parse command line options"""
+ parser = OptionParser()
+ parser.add_option('--spine', dest='spine', type='int', default=2,
+ help='number of spine switches, default=2')
+ parser.add_option('--leaf', dest='leaf', type='int', default=2,
+ help='number of leaf switches, default=2')
+ parser.add_option('--fanout', dest='fanout', type='int', default=2,
+ help='number of hosts per leaf switch, default=2')
+ parser.add_option('--onos', dest='onos', type='int', default=0,
+ help='number of ONOS Instances, default=0, 0 means localhost, 1 will use OC1 and so on')
+
+ (options, args) = parser.parse_args()
+ return options, args
+
+opts, args = parseOptions()
+
+class LeafAndSpine(Topo):
+ def __init__(self, spine=2, leaf=2, fanout=2, **opts):
+ "Create Leaf and Spine Topo."
+
+ Topo.__init__(self, **opts)
+
+ # Add spine switches
+ spines = {}
+ for s in range(spine):
+ spines[s] = self.addSwitch('spine10%s' % (s + 1), dpid="00000000010%s" % (s + 1))
+ # Set link speeds to 100Mb/s
+ linkopts = dict(bw=100)
+
+ # Add Leaf switches
+ for ls in range(leaf):
+ leafSwitch = self.addSwitch('leaf%s' % (ls + 1), dpid="00000000000%s" % (1+ls))
+ # Connect leaf to all spines
+ for s in range(spine):
+ switch = spines[s]
+ self.addLink(leafSwitch, switch, **linkopts)
+ # Add hosts under a leaf, fanout hosts per leaf switch
+ for f in range(fanout):
+ host = self.addHost('h%s' % (ls * fanout + f + 1),
+ cls=IpHost,
+ ip='10.0.%s.%s/24' % ((ls + 1), (f + 1)),
+ gateway='10.0.%s.254' % (ls + 1))
+ self.addLink(host, leafSwitch, **linkopts)
+
+class IpHost(Host):
+ def __init__(self, name, gateway, *args, **kwargs):
+ super(IpHost, self).__init__(name, *args, **kwargs)
+ self.gateway = gateway
+
+ def config(self, **kwargs):
+ Host.config(self, **kwargs)
+ mtu = "ifconfig "+self.name+"-eth0 mtu 1490"
+ self.cmd(mtu)
+ self.cmd('ip route add default via %s' % self.gateway)
+
+def config(opts):
+ spine = opts.spine
+ leaf = opts.leaf
+ fanout = opts.fanout
+ controllers= [ os.environ['OC%s' % i] for i in range(1,opts.onos+1) ] if (opts.onos) else ['127.0.0.1']
+ topo = LeafAndSpine(spine=spine, leaf=leaf, fanout=fanout)
+ net = Mininet(topo=topo, link=TCLink, build=False,
+ switch=UserSwitch,
+ controller = None,
+ autoSetMacs = True)
+ i = 0
+ for ip in controllers:
+ net.addController( "c%s" % (i), controller=RemoteController, ip=ip)
+ i += 1;
+ net.build()
+ net.start()
+ CLI(net)
+ net.stop()
+
+if __name__ == '__main__':
+ setLogLevel('info')
+ config(opts)
+ os.system('sudo mn -c')
+
diff --git a/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py b/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py
new file mode 100644
index 0000000..bf2a2b6
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/Dependency/startUp.py
@@ -0,0 +1,38 @@
+"""
+ 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" )
+
+ # Maven clean install
+ buildResult = main.ONOSbench.cleanInstall()
+
+ return buildResult
+
+
+
+
diff --git a/TestON/tests/USECASE_SegmentRouting/README.md b/TestON/tests/USECASE_SegmentRouting/README.md
new file mode 100644
index 0000000..da75079
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/README.md
@@ -0,0 +1,18 @@
+This test is designed to verify basic connectivity the SegmentRouting application.
+
+It consists of
+
+1) Installing and Starting ONOS
+2) Starting Mininet and testing connectivity
+
+Requirements
+
+ - A single ONOS instance is required for the test, the application is currently not stable in a cluster.
+ - An updated version of the CPQD switch has to be running to make sure it supports group chaining.
+
+Step 1:
+In this step we copy the proper config file to ONOS, next we package ONOS and install it in the target machine.
+
+Step 2:
+
+In this step we start a 2x2 leaf-spine topology, connect to ONOS, and next we send several pings between hosts to test connectivity.
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
new file mode 100755
index 0000000..dfa3d5f
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.params
@@ -0,0 +1,36 @@
+<PARAMS>
+
+ <testcases>1,2,11,9, 2,11,9</testcases>
+
+ <SCALE>
+ <size>1</size>
+ <max>1</max>
+ </SCALE>
+
+ <DEPENDENCY>
+ <path>/tests/USECASE_SegmentRouting/Dependency/</path>
+ <wrapper1>startUp</wrapper1>
+ <topology>cord_fabric.py</topology>
+ </DEPENDENCY>
+
+ <ENV>
+ <cellName>productionCell</cellName>
+ <cellApps>drivers,segmentrouting</cellApps>
+ <diffApps>openflow-base,netcfghostprovider,netcfglinksprovider;openflow</diffApps>
+ <cellUser>sdn</cellUser>
+ </ENV>
+
+ <GIT>
+ <pull>False</pull>
+ <branch>master</branch>
+ </GIT>
+
+ <CTRL>
+ <port>6653</port>
+ </CTRL>
+
+ <SLEEP>
+ <startup>10</startup>
+ </SLEEP>
+
+</PARAMS>
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
new file mode 100644
index 0000000..7ec23af
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.py
@@ -0,0 +1,250 @@
+
+# This test is to determine if the Segment Routing application is working properly
+
+class USECASE_SegmentRouting:
+
+ def __init__( self ):
+ self.default = ''
+
+ def CASE1( self, main ):
+ import time
+ import os
+ import imp
+ import re
+
+ """
+ - Construct tests variables
+ - GIT ( optional )
+ - Checkout ONOS master branch
+ - Pull latest ONOS code
+ - Building ONOS ( optional )
+ - Install ONOS package
+ - Build ONOS package
+ """
+
+ main.case( "Constructing test variables and building ONOS" )
+ main.step( "Constructing test variables" )
+ stepResult = main.FALSE
+
+ # Test variables
+ main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
+ main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+ main.diff = ( main.params[ 'ENV' ][ 'diffApps' ] ).split(";")
+ gitBranch = main.params[ 'GIT' ][ 'branch' ]
+ main.dependencyPath = main.testOnDirectory + \
+ main.params[ 'DEPENDENCY' ][ 'path' ]
+ main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+ #main.json = ["4x4"]
+ main.json = ["2x2", "2x2"]
+ main.args = [" ", " "]
+ #main.args = [" --spine 4 --leaf 4 "]
+ main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
+ main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
+ main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
+ wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+ main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+ gitPull = main.params[ 'GIT' ][ 'pull' ]
+ main.cellData = {} # for creating cell file
+ main.CLIs = []
+ main.ONOSip = []
+
+ main.ONOSip = main.ONOSbench.getOnosIps()
+
+ # Assigning ONOS cli handles to a list
+ for i in range( 1, main.maxNodes + 1 ):
+ main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
+
+ # -- INIT SECTION, ONLY RUNS ONCE -- #
+ main.startUp = imp.load_source( wrapperFile1,
+ main.dependencyPath +
+ wrapperFile1 +
+ ".py" )
+
+ copyResult1 = main.ONOSbench.scp( main.Mininet1,
+ main.dependencyPath +
+ main.topology,
+ main.Mininet1.home,
+ direction="to" )
+ if main.CLIs:
+ stepResult = main.TRUE
+ else:
+ main.log.error( "Did not properly created list of ONOS CLI handle" )
+ stepResult = main.FALSE
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully construct " +
+ "test variables ",
+ onfail="Failed to construct test variables" )
+
+ if gitPull == 'True':
+ main.step( "Building ONOS in " + gitBranch + " branch" )
+ onosBuildResult = main.startUp.onosBuild( main, gitBranch )
+ stepResult = onosBuildResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully compiled " +
+ "latest ONOS",
+ onfail="Failed to compile " +
+ "latest ONOS" )
+ else:
+ main.log.warn( "Did not pull new code so skipping mvn " +
+ "clean install" )
+
+ def CASE2( self, main ):
+ """
+ - Set up cell
+ - Create cell file
+ - Set cell file
+ - Verify cell file
+ - Kill ONOS process
+ - Uninstall ONOS cluster
+ - Verify ONOS start up
+ - Install ONOS cluster
+ - Connect to cli
+ """
+
+ # main.scale[ 0 ] determines the current number of ONOS controller
+ main.numCtrls = int( main.scale[ 0 ] )
+
+ main.case( "Package and start ONOS")
+
+ #kill off all onos processes
+ main.log.info( "Safety check, killing all ONOS processes" +
+ " before initiating environment setup" )
+
+ for i in range( main.maxNodes ):
+ main.ONOSbench.onosDie( main.ONOSip[ i ] )
+
+ print "NODE COUNT = ", main.numCtrls
+
+ 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.ONOSbench.createCellFile( main.ONOSbench.ip_address,
+ "temp",
+ main.Mininet1.ip_address,
+ apps,
+ tempOnosIp )
+
+ main.step( "Apply cell to environment" )
+ cellResult = main.ONOSbench.setCell( "temp" )
+ verifyResult = main.ONOSbench.verifyCell()
+ stepResult = cellResult and verifyResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully applied cell to " + \
+ "environment",
+ 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")
+ packageResult = main.ONOSbench.onosPackage()
+ stepResult = packageResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully created ONOS package",
+ onfail="Failed to create ONOS package" )
+
+ time.sleep( main.startUpSleep )
+
+ main.step( "Installing ONOS package" )
+ onosInstallResult = main.TRUE
+ for i in range( main.numCtrls ):
+ onosInstallResult = onosInstallResult and \
+ main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
+ stepResult = onosInstallResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully installed ONOS package",
+ onfail="Failed to install ONOS package" )
+
+ main.step( "Starting ONOS service" )
+ stopResult = main.TRUE
+ startResult = main.TRUE
+ onosIsUp = main.TRUE
+
+ for i in range( main.numCtrls ):
+ onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
+ if onosIsUp == main.TRUE:
+ main.log.report( "ONOS instance is up and ready" )
+ else:
+ main.log.report( "ONOS instance may not be up, stop and " +
+ "start ONOS again " )
+ for i in range( main.numCtrls ):
+ stopResult = stopResult and \
+ main.ONOSbench.onosStop( main.ONOSip[ i ] )
+ for i in range( main.numCtrls ):
+ startResult = startResult and \
+ main.ONOSbench.onosStart( main.ONOSip[ i ] )
+ stepResult = onosIsUp and stopResult and startResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="ONOS service is ready",
+ onfail="ONOS service did not start properly" )
+ time.sleep( 2*main.startUpSleep )
+
+ def CASE9( self, main ):
+ '''
+ Report errors/warnings/exceptions
+ '''
+ main.log.case( "Logging test" )
+ #main.ONOSbench.logReport( main.ONOSip[ 0 ],
+ # [ "INFO" ],
+ # "a" )
+ #main.log.info("Error report: \n" )
+ main.ONOSbench.logReport( main.ONOSip[ 0 ],
+ [ "INFO",
+ "FOLLOWER",
+ "WARN",
+ "flow",
+ "ERROR",
+ "Except" ],
+ "s" )
+
+ def CASE11( self, main ):
+ """
+ Start mininet
+ """
+ main.log.case( "Start Leaf-Spine 2x2 Mininet Topology" )
+ main.log.report( "Start Mininet topology" )
+
+ main.step( "Starting Mininet Topology" )
+ args,topo=" "," "
+ #if main.topology:
+ # topo = main.topology.pop(0)
+ #else: main.log.error( "Topo list is empty" )
+ if main.args:
+ args = "--onos 1 " + main.args.pop(0)
+ else: main.log.error( "Argument list is empty" )
+
+ topoResult = main.Mininet1.startNet( topoFile= main.dependencyPath + main.topology, args=args )
+ stepResult = topoResult
+ utilities.assert_equals( expect=main.TRUE,
+ actual=stepResult,
+ onpass="Successfully loaded topology",
+ onfail="Failed to load topology" )
+ # Exit if topology did not load properly
+ if not topoResult:
+ main.cleanup()
+ main.exit()
+ main.step("Waiting for switch initialization and configuration")
+ time.sleep( 3*main.startUpSleep)
+ pa = main.Mininet1.pingall()
+ utilities.assert_equals( expect=main.TRUE, actual=pa,
+ onpass="Full connectivity successfully tested",
+ onfail="Full connectivity failed" )
+ # cleanup mininet
+ main.ONOSbench.onosStop( main.ONOSip[0] )
+ main.Mininet1.stopNet()
+
+
+
+
+
diff --git a/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo
new file mode 100755
index 0000000..0484c01
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/USECASE_SegmentRouting.topo
@@ -0,0 +1,37 @@
+<TOPOLOGY>
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS>
+ <nodes>1</nodes>
+ </COMPONENTS>
+ </ONOSbench>
+
+ <ONOScli1>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS>
+ </COMPONENTS>
+ </ONOScli1>
+
+ <Mininet1>
+ <host>OCN</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>MininetCliDriver</type>
+ <connect_order>3</connect_order>
+ <COMPONENTS>
+ <home>~/mininet/custom/</home>
+ </COMPONENTS>
+ </Mininet1>
+
+ </COMPONENT>
+</TOPOLOGY>
diff --git a/TestON/tests/USECASE_SegmentRouting/__init__.py b/TestON/tests/USECASE_SegmentRouting/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TestON/tests/USECASE_SegmentRouting/__init__.py