Merge pull request #110 from opennetworkinglab/devl/startNet
Devl/start net
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 3a83283..2d7c0a5 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -246,51 +246,95 @@
topoDict = self.numSwitchesNlinks( *topoArgList )
return topoDict
- def pingall( self, timeout=300 ):
+ def pingall( self, timeout=300, shortCircuit=False, acceptableFailed=0):
"""
Verifies the reachability of the hosts using pingall command.
Optional parameter timeout allows you to specify how long to
wait for pingall to complete
+ Optional:
+ timeout(seconds) - This is the pexpect timeout; The function will
+ timeout if the amount of time between failed
+ pings exceedes this time and pingall is still
+ running
+ shortCircuit - Break the pingall based on the number of failed hosts
+ ping
+ acceptableFailed - Set the number of acceptable failed pings for the
+ function to still return main.TRUE
Returns:
main.TRUE if pingall completes with no pings dropped
otherwise main.FALSE"""
- if self.handle:
- main.log.info(
- self.name +
- ": Checking reachabilty to the hosts using pingall" )
- try:
- response = self.execute(
- cmd="pingall",
- prompt="mininet>",
- timeout=int( timeout ) )
- except pexpect.EOF:
- main.log.error( self.name + ": EOF exception found" )
- main.log.error( self.name + ": " + self.handle.before )
+ try:
+ if self.handle:
+ main.log.info(
+ self.name +
+ ": Checking reachabilty to the hosts using pingall" )
+ response = ""
+ failedPings = 0
+ returnValue = main.TRUE
+ self.handle.sendline( "pingall" )
+ while True:
+ i = self.handle.expect( [ "mininet>","X",
+ pexpect.EOF,
+ pexpect.TIMEOUT ],
+ timeout )
+ if i == 0:
+ main.log.info( self.name + ": pingall finished")
+ response += self.handle.before
+ break
+ elif i == 1:
+ response += self.handle.before + self.handle.after
+ failedPings = failedPings + 1
+ if failedPings > acceptableFailed:
+ returnValue = main.FALSE
+ if shortCircuit:
+ main.log.error( self.name +
+ ": Aborting pingall - "
+ + str( failedPings ) +
+ " pings failed" )
+ break
+ elif i == 2:
+ main.log.error( self.name +
+ ": EOF exception found" )
+ main.log.error( self.name + ": " +
+ self.handle.before )
+ main.cleanup()
+ main.exit()
+ elif i == 3:
+ response += self.handle.before
+ main.log.error( self.name +
+ ": TIMEOUT exception found" )
+ main.log.error( self.name +
+ ": " +
+ str( response ) )
+ # NOTE: Send ctrl-c to make sure pingall is done
+ self.handle.sendline( "\x03" )
+ self.handle.expect( "Interrupt" )
+ self.handle.expect( "mininet>" )
+ break
+ pattern = "Results\:"
+ main.log.info( "Pingall output: " + str( response ) )
+ if re.search( pattern, response ):
+ main.log.info( self.name + ": Pingall finished with "
+ + str( failedPings ) + " failed pings" )
+ return returnValue
+ else:
+ # NOTE: Send ctrl-c to make sure pingall is done
+ self.handle.sendline( "\x03" )
+ self.handle.expect( "Interrupt" )
+ self.handle.expect( "mininet>" )
+ return main.FALSE
+ else:
+ main.log.error( self.name + ": Connection failed to the host" )
main.cleanup()
main.exit()
- except pexpect.TIMEOUT:
- # We may not want to kill the test if pexpect times out
- main.log.error( self.name + ": TIMEOUT exception found" )
- main.log.error( self.name +
- ": " +
- str( self.handle.before ) )
- # NOTE: mininet's pingall rounds, so we will check the number of
- # passed and number of failed
- pattern = "Results\:\s0\%\sdropped\s\(" +\
- "(?P<passed>[\d]+)/(?P=passed)"
- if re.search( pattern, response ):
- main.log.info( self.name + ": All hosts are reachable" )
- return main.TRUE
- else:
- main.log.error( self.name + ": Unable to reach all the hosts" )
+ except pexpect.TIMEOUT:
+ if response:
main.log.info( "Pingall output: " + str( response ) )
- # NOTE: Send ctrl-c to make sure pingall is done
- self.handle.send( "\x03" )
- self.handle.expect( "Interrupt" )
- self.handle.expect( "mininet>" )
- return main.FALSE
- else:
- main.log.error( self.name + ": Connection failed to the host" )
+ main.log.error( self.name + ": pexpect.TIMEOUT found" )
+ return main.FALSE
+ except pexpect.EOF:
+ main.log.error( self.name + ": EOF exception found" )
+ main.log.error( self.name + ": " + self.handle.before )
main.cleanup()
main.exit()
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index f4e5f0b..d815e4c 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1291,7 +1291,9 @@
cmd += " " + \
str( ingressDevice ) + "/" +\
str( portIngress ) + " "
-
+ else:
+ main.log.error( "Device list and port list does not have the same length" )
+ return main.FALSE
if "/" in egressDevice:
cmd += " " + str( egressDevice )
else:
@@ -1312,10 +1314,162 @@
"intent" )
return None
else:
- # TODO: print out all the options in this message?
- main.log.info( "Multipoint-to-singlepoint intent installed" +
- " failed " )
+ match = re.search('id=0x([\da-f]+),', handle)
+ if match:
+ return match.group()[3:-1]
+ else:
+ main.log.error( "Error, intent ID not found" )
+ return None
+ except TypeError:
+ main.log.exception( self.name + ": Object not as expected" )
+ return None
+ except pexpect.EOF:
+ main.log.error( self.name + ": EOF exception found" )
+ main.log.error( self.name + ": " + self.handle.before )
+ main.cleanup()
+ main.exit()
+ except Exception:
+ main.log.exception( self.name + ": Uncaught exception!" )
+ main.cleanup()
+ main.exit()
+
+ def addSinglepointToMultipointIntent(
+ self,
+ ingressDevice,
+ egressDeviceList,
+ portIngress="",
+ portEgressList=None,
+ ethType="",
+ ethSrc="",
+ ethDst="",
+ bandwidth="",
+ lambdaAlloc=False,
+ ipProto="",
+ ipSrc="",
+ ipDst="",
+ tcpSrc="",
+ tcpDst="",
+ setEthSrc="",
+ setEthDst="" ):
+ """
+ Note:
+ This function assumes the format of all egress devices
+ is same. That is, all egress devices include port numbers
+ with a "/" or all egress devices could specify device
+ ids and port numbers seperately.
+ Required:
+ * EgressDeviceList: List of device ids of egress device
+ ( Atleast 2 eress devices required in the list )
+ * ingressDevice: device id of ingress device
+ Optional:
+ * ethType: specify ethType
+ * ethSrc: specify ethSrc ( i.e. src mac addr )
+ * ethDst: specify ethDst ( i.e. dst mac addr )
+ * bandwidth: specify bandwidth capacity of link
+ * lambdaAlloc: if True, intent will allocate lambda
+ for the specified intent
+ * ipProto: specify ip protocol
+ * ipSrc: specify ip source address
+ * ipDst: specify ip destination address
+ * tcpSrc: specify tcp source port
+ * tcpDst: specify tcp destination port
+ * setEthSrc: action to Rewrite Source MAC Address
+ * setEthDst: action to Rewrite Destination MAC Address
+ Description:
+ Adds a singlepoint-to-multipoint intent ( uni-directional ) by
+ specifying device id's and optional fields
+ Returns:
+ A string of the intent id or None on error
+
+ NOTE: This function may change depending on the
+ options developers provide for singlepoint-to-multipoint
+ intent via cli
+ """
+ try:
+ # If there are no optional arguments
+ if not ethType and not ethSrc and not ethDst\
+ and not bandwidth and not lambdaAlloc\
+ and not ipProto and not ipSrc and not ipDst\
+ and not tcpSrc and not tcpDst and not setEthSrc\
+ and not setEthDst:
+ cmd = "add-single-to-multi-intent"
+
+ else:
+ cmd = "add-single-to-multi-intent"
+
+ if ethType:
+ cmd += " --ethType " + str( ethType )
+ if ethSrc:
+ cmd += " --ethSrc " + str( ethSrc )
+ if ethDst:
+ cmd += " --ethDst " + str( ethDst )
+ if bandwidth:
+ cmd += " --bandwidth " + str( bandwidth )
+ if lambdaAlloc:
+ cmd += " --lambda "
+ if ipProto:
+ cmd += " --ipProto " + str( ipProto )
+ if ipSrc:
+ cmd += " --ipSrc " + str( ipSrc )
+ if ipDst:
+ cmd += " --ipDst " + str( ipDst )
+ if tcpSrc:
+ cmd += " --tcpSrc " + str( tcpSrc )
+ if tcpDst:
+ cmd += " --tcpDst " + str( tcpDst )
+ if setEthSrc:
+ cmd += " --setEthSrc " + str( setEthSrc )
+ if setEthDst:
+ cmd += " --setEthDst " + str( setEthDst )
+
+ # Check whether the user appended the port
+ # or provided it as an input
+
+ if "/" in ingressDevice:
+ cmd += " " + str( ingressDevice )
+ else:
+ if not portIngress:
+ main.log.error( "You must specify " +
+ "the Ingress port" )
+ return main.FALSE
+
+ cmd += " " +\
+ str( ingressDevice ) + "/" +\
+ str( portIngress )
+
+ if portEgressList is None:
+ for egressDevice in egressDeviceList:
+ if "/" in egressDevice:
+ cmd += " " + str( egressDevice )
+ else:
+ main.log.error( "You must specify " +
+ "the egress port" )
+ # TODO: perhaps more meaningful return
+ return main.FALSE
+ else:
+ if len( egressDeviceList ) == len( portEgressList ):
+ for egressDevice, portEgress in zip( egressDeviceList, portEgressList ):
+ cmd += " " + \
+ str( egressDevice ) + "/" +\
+ str( portEgress )
+ else:
+ main.log.error( "Device list and port list does not have the same length" )
+ return main.FALSE
+
+ print "cmd= ", cmd
+ handle = self.sendline( cmd )
+ # If error, return error message
+ if re.search( "Error", handle ):
+ main.log.error( "Error in adding singlepoint-to-multipoint " +
+ "intent" )
return None
+ else:
+ match = re.search('id=0x([\da-f]+),', handle)
+ if match:
+ return match.group()[3:-1]
+ else:
+ main.log.error( "Error, intent ID not found" )
+ return None
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
return None
diff --git a/TestON/tests/OnosCHO/OnosCHO.params b/TestON/tests/OnosCHO/OnosCHO.params
index 9066177..a91e17c 100644
--- a/TestON/tests/OnosCHO/OnosCHO.params
+++ b/TestON/tests/OnosCHO/OnosCHO.params
@@ -1,5 +1,5 @@
<PARAMS>
- #CHO sequence : 1,2,3,[4,5,6,5,70,80,5,10,5,9,5,71,81,5,10,5]*100
+ # 1,20,3,[40,5,60,70,80,10,90,71,81,10,93,10]*50,22,3,[41,5,61,72,82,10,91,73,83,10,94,10]*50,22,3,[42,5,62,10,92,10]*50
# 1. ONOS brinup Test case
# 2. Assign and Balance all Mininet switches across controllers
# 3. Collect reference toplogy for topo compare
@@ -10,10 +10,8 @@
# 8. Bring core links Up that were down and verify pingall
# 9. Install 300 point intents and verify ping all
# 10. Remove all intents on ONOS
- # 1,2,3,[4,5,6,5,70,80,5,10,5,9,5,71,81,5,10,5]*100
- # 1,2,3,4,5,6,10,12,3,4,5,6,10,13,3,4,5,6,10 [2,3,4,5,6,70,80,10,9,10]*25
- <testcases>1,2,[3,4,5,6,70,80,10,9,71,81,10]*25,12,[3,41,5,72,82,14,10]*25,13,[3,42,5,73,83,15,10]*25</testcases>
+ <testcases>1,20,3,[40,5,60,70,80,10,90,71,81,10,93,10]*50,22,3,[41,5,61,72,82,10,91,73,83,10,94,10]*50,22,3,[42,5,62,10,92,10]*50</testcases>
<ENV>
<cellName>choTest5</cellName>
</ENV>
@@ -23,7 +21,7 @@
<branch>master</branch>
</GIT>-t
<TOPO1>
- <topo>~/mininet/custom/topoAtt.py</topo>t
+ <topo>~/mininet/custom/topoAtt.py</topo>
<numSwitches>25</numSwitches>
<numHosts>25</numHosts>
<numLinks>114</numLinks>
@@ -45,22 +43,22 @@
</TOPO3>
<CTRL>
<numCtrl>5</numCtrl>
- <ip1>10.128.40.41</ip1>
+ <ip1>10.128.10.21</ip1>
<port1>6633</port1>
- <ip2>10.128.40.42</ip2>
+ <ip2>10.128.10.22</ip2>
<port2>6633</port2>
- <ip3>10.128.40.43</ip3>
+ <ip3>10.128.10.23</ip3>
<port3>6633</port3>
- <ip4>10.128.40.44</ip4>
+ <ip4>10.128.10.24</ip4>
<port4>6633</port4>
- <ip5>10.128.40.45</ip5>
+ <ip5>10.128.10.25</ip5>
<port5>6633</port5>
</CTRL>
<HOSTS>
<startMAC>00:00:00:00:00:01</startMAC>
<endMAC>00:00:00:00:00:19</endMAC>
</HOSTS>
- <CORELINKS>
+ <ATTCORELINKS>
<toggleLinks>3</toggleLinks>
<linkS3a>s3</linkS3a>
@@ -74,11 +72,20 @@
<linkS18a>s18</linkS18a>
<linkS18b>s14,s16,s17,s19,s20,s21,s22,s23</linkS18b>
#######s3,s14,s16,s17,s19,s20,s21,s22,s23########
- </CORELINKS>
+ </ATTCORELINKS>
+
+ <SPINECORELINKS>
+ <linkS9>s9</linkS9>
+ <linkS9top>s1,s3,s5,s7</linkS9top>
+ <linkS9bot>s11,s12</linkS9bot>
+ <linkS10>s10</linkS10>
+ <linkS10top>s2,s4,s6,s8</linkS10top>
+ <linkS10bot>s13,s14</linkS10bot>
+ </SPINECORELINKS>
<timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>31</SwitchDiscovery>
+ <LinkDiscovery>1</LinkDiscovery>
+ <SwitchDiscovery>1</SwitchDiscovery>
</timers>
</PARAMS>
diff --git a/TestON/tests/OnosCHO/OnosCHO.py b/TestON/tests/OnosCHO/OnosCHO.py
index 7c09872..cd70c80 100644
--- a/TestON/tests/OnosCHO/OnosCHO.py
+++ b/TestON/tests/OnosCHO/OnosCHO.py
@@ -1,4 +1,4 @@
-import time
+
import sys
import os
import re
@@ -141,7 +141,7 @@
t = main.Thread( target=main.CLIs[i].startOnosCli,
threadID=main.threadID,
name="startOnosCli",
- args=[ main.nodes[i].ip_address ] )
+ args=[ main.nodes[i].ip_address, karafTimeout ] )
pool.append(t)
t.start()
main.threadID = main.threadID + 1
@@ -163,9 +163,8 @@
utilities.assert_equals( expect=main.TRUE, actual=case1Result,
onpass="Set up test environment PASS",
onfail="Set up test environment FAIL" )
- time.sleep(30)
- def CASE2( self, main ):
+ def CASE20( self, main ):
"""
This test script Loads a new Topology (Att) on CHO setup and balances all switches
"""
@@ -221,7 +220,98 @@
main.log.report( "Controller assignment successfull" )
else:
main.log.report( "Controller assignment failed" )
+
+ """topoFailed = main.FALSE
+ checkCount = 0
+ while(topoFailed == main.FALSE):
+ topology_output = main.ONOScli1.topology()
+ topology_result = main.ONOSbench.getTopology( topology_output )
+ numOnosDevices = topology_result[ 'deviceCount' ]
+ numOnosLinks = topology_result[ 'linkCount' ]
+ if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks >= int(numOnosLinks) ) ):
+ main.log.info("Att topology is now ready!")
+ break
+ else:
+ main.log.info("Att topology is not ready yet!")
+ checkCount = checkCount + 1
+ time.sleep(2)
+ if checkCount == 10:
+ topoFailed = main.TRUE
+ if topoFailed:
+ main.log.info("Att topology failed to start correctly")
+ """
+ time.sleep(15)
+ #Don't balance master for now..
+ main.step( "Balance devices across controllers" )
+ for i in range( int( main.numCtrls ) ):
+ balanceResult = main.ONOScli1.balanceMasters()
+ # giving some breathing time for ONOS to complete re-balance
+ time.sleep( 3 )
+ topology_output = main.ONOScli1.topology()
+ topology_result = main.ONOSbench.getTopology( topology_output )
+ case2Result = ( switch_mastership and startStatus )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case2Result,
+ onpass="Starting new Att topology test PASS",
+ onfail="Starting new Att topology test FAIL" )
+
+ def CASE21( self, main ):
+ """
+ This test script Loads a new Topology (Chordal) on CHO setup and balances all switches
+ """
+ import re
+ import time
+ import copy
+
+ 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 = 120
+ main.log.report(
+ "Load Chordal topology and Balance all Mininet switches across controllers" )
+ main.log.report(
+ "________________________________________________________________________" )
+ main.case(
+ "Assign and Balance all Mininet switches across controllers" )
+ main.step( "Stop any previous Mininet network topology" )
+ stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" )
+ #time.sleep(10)
+ main.step( "Start Mininet with Chordal topology" )
+ startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+ time.sleep(15)
+ main.step( "Assign switches to controllers" )
+ for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
+ main.Mininet1.assignSwController(
+ sw=str( i ),
+ count=int( main.numCtrls ),
+ ip1=main.ONOS1_ip,
+ port1=main.ONOS1_port,
+ ip2=main.ONOS2_ip,
+ port2=main.ONOS2_port,
+ ip3=main.ONOS3_ip,
+ port3=main.ONOS3_port,
+ ip4=main.ONOS4_ip,
+ port4=main.ONOS4_port,
+ ip5=main.ONOS5_ip,
+ port5=main.ONOS5_port )
+
+ switch_mastership = main.TRUE
+ for i in range( 1, ( main.numMNswitches + 1 ) ):
+ response = main.Mininet1.getSwController( "s" + str( i ) )
+ print( "Response is " + str( response ) )
+ if re.search( "tcp:" + main.ONOS1_ip, response ):
+ switch_mastership = switch_mastership and main.TRUE
+ else:
+ switch_mastership = main.FALSE
+
+ if switch_mastership == main.TRUE:
+ main.log.report( "Controller assignment successfull" )
+ else:
+ main.log.report( "Controller assignment failed" )
time.sleep( 5 )
+
#Don't balance master for now..
"""
main.step( "Balance devices across controllers" )
@@ -230,13 +320,91 @@
# giving some breathing time for ONOS to complete re-balance
time.sleep( 3 )
"""
- case2Result = ( switch_mastership and startStatus )
- time.sleep(45)
+ case21Result = switch_mastership
+ time.sleep(30)
utilities.assert_equals(
expect=main.TRUE,
- actual=case2Result,
- onpass="Starting new Att topology test PASS",
- onfail="Starting new Att topology test FAIL" )
+ actual=case21Result,
+ onpass="Starting new Chordal topology test PASS",
+ onfail="Starting new Chordal topology test FAIL" )
+
+ def CASE22( self, main ):
+ """
+ This test script Loads a new Topology (Spine) on CHO setup and balances all switches
+ """
+ import re
+ import time
+ import copy
+
+ 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 = 400
+
+ main.log.report(
+ "Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
+ main.log.report(
+ "________________________________________________________________________" )
+ # need to wait here for sometime until ONOS bootup
+ main.case(
+ "Assign and Balance all Mininet switches across controllers" )
+ main.step( "Stop any previous Mininet network topology" )
+ stopStatus = main.Mininet1.stopNet(fileName = "topoSpine" )
+ main.step( "Start Mininet with Spine topology" )
+ startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
+ time.sleep(20)
+ main.step( "Assign switches to controllers" )
+ for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
+ main.Mininet1.assignSwController(
+ sw=str( i ),
+ count= 1,
+ ip1=main.ONOS1_ip,
+ port1=main.ONOS1_port,
+ ip2=main.ONOS2_ip,
+ port2=main.ONOS2_port,
+ ip3=main.ONOS3_ip,
+ port3=main.ONOS3_port,
+ ip4=main.ONOS4_ip,
+ port4=main.ONOS4_port,
+ ip5=main.ONOS5_ip,
+ port5=main.ONOS5_port )
+
+ switch_mastership = main.TRUE
+ for i in range( 1, ( main.numMNswitches + 1 ) ):
+ response = main.Mininet1.getSwController( "s" + str( i ) )
+ print( "Response is " + str( response ) )
+ if re.search( "tcp:" + main.ONOS1_ip, response ):
+ switch_mastership = switch_mastership and main.TRUE
+ else:
+ switch_mastership = main.FALSE
+
+ if switch_mastership == main.TRUE:
+ main.log.report( "Controller assignment successfull" )
+ else:
+ main.log.report( "Controller assignment failed" )
+ time.sleep( 5 )
+ """
+ main.step( "Balance devices across controllers" )
+
+ for i in range( int( main.numCtrls ) ):
+ balanceResult = main.ONOScli1.balanceMasters()
+ # giving some breathing time for ONOS to complete re-balance
+ time.sleep( 3 )
+
+ main.step( "Balance devices across controllers" )
+ for i in range( int( main.numCtrls ) ):
+ balanceResult = main.ONOScli1.balanceMasters()
+ # giving some breathing time for ONOS to complete re-balance
+ time.sleep( 3 )
+ """
+ case22Result = switch_mastership
+ time.sleep(30)
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case22Result,
+ onpass="Starting new Spine topology test PASS",
+ onfail="Starting new Spine topology test FAIL" )
def CASE3( self, main ):
"""
@@ -274,7 +442,8 @@
main.hostMACs.append( "00:00:00:00:00:" + format( i, '02x' ) + "/-1" )
print "Host MACs in Store: \n", str( main.hostMACs )
main.MACsDict = {}
- for i in range(len(main.deviceDPIDs)):
+ print "Creating dictionary of DPID and HostMacs"
+ for i in range(len(main.hostMACs)):
main.MACsDict[main.deviceDPIDs[i]] = main.hostMACs[i].split('/')[0]
print main.MACsDict
main.step( "Collect and store all Devices Links" )
@@ -295,6 +464,8 @@
for i in xrange(1,(main.numMNswitches + 1), int( main.numCtrls ) ):
pool = []
for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
dpid = "of:00000000000000" + format( i,'02x' )
t = main.Thread(target = cli.getDevicePortsEnabledCount,threadID = main.threadID, name = "getDevicePortsEnabledCount",args = [dpid])
t.start()
@@ -317,6 +488,8 @@
for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ):
pool = []
for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
dpid = "of:00000000000000" + format( i,'02x' )
t = main.Thread( target = cli.getDeviceLinksActiveCount,
threadID = main.threadID,
@@ -332,7 +505,7 @@
linkCountTemp = re.split( r'\t+', linkCountResult )
linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
main.deviceActiveLinksCount.append( linkCount )
- print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount )
+ print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount )
time2 = time.time()
main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
@@ -354,7 +527,7 @@
onpass="Saving ONOS topology data test PASS",
onfail="Saving ONOS topology data test FAIL" )
- def CASE4( self, main ):
+ def CASE40( self, main ):
"""
Verify Reactive forwarding (Att Topology)
"""
@@ -366,39 +539,32 @@
main.case( "Enable Reactive forwarding and Verify ping all" )
main.step( "Enable Reactive forwarding" )
installResult = main.TRUE
- feature = "onos-app-fwd"
-
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+ appCheck = main.TRUE
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureInstall,
- threadID=main.threadID,
- name="featureInstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
-
- installResult = main.TRUE
for t in pool:
t.join()
- installResult = installResult and t.result
- time2 = time.time()
-
- if not installResult:
- main.log.info("Did not install onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:install onos-app-fwd")
- main.log.info("Time for feature:install onos-app-fwd: %2f seconds" %(time2-time1))
-
- time.sleep( 5 )
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ time.sleep( 10 )
main.step( "Verify Pingall" )
ping_result = main.FALSE
time1 = time.time()
- ping_result = main.Mininet1.pingall(timeout=main.pingTimeout)
+ ping_result = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -412,34 +578,31 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
- uninstallResult = main.TRUE
+
+ main.log.info( "Uninstall reactive forwarding app" )
+ appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureUninstall,
- threadID=main.threadID,
- name="featureUninstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
+
for t in pool:
t.join()
- uninstallResult = uninstallResult and t.result
- time2 = time.time()
-
- if not uninstallResult:
- main.log.info("Did not uninstall onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:uninstall onos-app-fwd")
- main.log.info("Time for feature:uninstall onos-app-fwd: %2f seconds" %(time2-time1))
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
# Waiting for reative flows to be cleared.
- time.sleep( 20 )
- case4Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case4Result,
+ time.sleep( 10 )
+ case40Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case40Result,
onpass="Reactive Mode Pingall test PASS",
onfail="Reactive Mode Pingall test FAIL" )
@@ -455,39 +618,33 @@
main.case( "Enable Reactive forwarding and Verify ping all" )
main.step( "Enable Reactive forwarding" )
installResult = main.TRUE
- feature = "onos-app-fwd"
-
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+ appCheck = main.TRUE
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureInstall,
- threadID=main.threadID,
- name="featureInstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
-
- installResult = main.TRUE
for t in pool:
t.join()
- installResult = installResult and t.result
- time2 = time.time()
-
- if not installResult:
- main.log.info("Did not install onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:install onos-app-fwd")
- main.log.info("Time for feature:install onos-app-fwd: %2f seconds" %(time2-time1))
-
- time.sleep( 5 )
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ time.sleep( 10 )
main.step( "Verify Pingall" )
ping_result = main.FALSE
time1 = time.time()
- ping_result = main.Mininet1.pingall(timeout=main.pingTimeout)
+ ping_result = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -501,34 +658,31 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
- uninstallResult = main.TRUE
+
+ main.log.info( "Uninstall reactive forwarding app" )
+ appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureUninstall,
- threadID=main.threadID,
- name="featureUninstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
+
for t in pool:
t.join()
- uninstallResult = uninstallResult and t.result
- time2 = time.time()
-
- if not uninstallResult:
- main.log.info("Did not uninstall onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:uninstall onos-app-fwd")
- main.log.info("Time for feature:uninstall onos-app-fwd: %2f seconds" %(time2-time1))
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
# Waiting for reative flows to be cleared.
- time.sleep( 20 )
- case4Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case4Result,
+ time.sleep( 10 )
+ case41Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case41Result,
onpass="Reactive Mode Pingall test PASS",
onfail="Reactive Mode Pingall test FAIL" )
@@ -544,39 +698,33 @@
main.case( "Enable Reactive forwarding and Verify ping all" )
main.step( "Enable Reactive forwarding" )
installResult = main.TRUE
- feature = "onos-app-fwd"
-
+ # Activate fwd app
+ appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
+
+ appCheck = main.TRUE
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureInstall,
- threadID=main.threadID,
- name="featureInstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
-
- installResult = main.TRUE
for t in pool:
t.join()
- installResult = installResult and t.result
- time2 = time.time()
-
- if not installResult:
- main.log.info("Did not install onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:install onos-app-fwd")
- main.log.info("Time for feature:install onos-app-fwd: %2f seconds" %(time2-time1))
-
- time.sleep( 5 )
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
+
+ time.sleep( 10 )
main.step( "Verify Pingall" )
ping_result = main.FALSE
time1 = time.time()
- ping_result = main.Mininet1.pingall(timeout=main.pingTimeout)
+ ping_result = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -590,34 +738,31 @@
main.log.report( "Pingall Test in Reactive mode failed" )
main.step( "Disable Reactive forwarding" )
- uninstallResult = main.TRUE
+
+ main.log.info( "Uninstall reactive forwarding app" )
+ appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
pool = []
- time1 = time.time()
for cli in main.CLIs:
- t = main.Thread( target=cli.featureUninstall,
- threadID=main.threadID,
- name="featureUninstall",
- args=['onos-app-fwd'])
- pool.append(t)
+ t = main.Thread( target=cli.appToIDCheck,
+ name="appToIDCheck-" + str( i ),
+ args=[] )
+ pool.append( t )
t.start()
- main.threadID = main.threadID + 1
+
for t in pool:
t.join()
- uninstallResult = uninstallResult and t.result
- time2 = time.time()
-
- if not uninstallResult:
- main.log.info("Did not uninstall onos-app-fwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:uninstall onos-app-fwd")
- main.log.info("Time for feature:uninstall onos-app-fwd: %2f seconds" %(time2-time1))
+ appCheck = appCheck and t.result
+ utilities.assert_equals( expect=main.TRUE, actual=appCheck,
+ onpass="App Ids seem to be correct",
+ onfail="Something is wrong with app Ids" )
+ if appCheck != main.TRUE:
+ main.log.warn( main.CLIs[0].apps() )
+ main.log.warn( main.CLIs[0].appIDs() )
# Waiting for reative flows to be cleared.
- time.sleep( 20 )
- case4Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case4Result,
+ time.sleep( 10 )
+ case42Result = installResult and uninstallResult and ping_result
+ utilities.assert_equals( expect=main.TRUE, actual=case42Result,
onpass="Reactive Mode Pingall test PASS",
onfail="Reactive Mode Pingall test FAIL" )
@@ -643,6 +788,8 @@
for i in xrange( 1,(main.numMNswitches + 1), int( main.numCtrls ) ):
pool = []
for cli in main.CLIs:
+ if i >= main.numMNswitches + 1:
+ break
dpid = "of:00000000000000" + format( i,'02x' )
t = main.Thread(target = cli.getDevicePortsEnabledCount,
threadID = main.threadID,
@@ -716,7 +863,7 @@
onpass="Compare Topology test PASS",
onfail="Compare Topology test FAIL" )
- def CASE6( self ):
+ def CASE60( self ):
"""
Install 300 host intents and verify ping all (Att Topology)
"""
@@ -731,11 +878,6 @@
intentIdList = []
time1 = time.time()
- """
- for i in xrange(0 ,len(hostCombos)):
- tempId = ONOScli1.addHostIntent( hostCombos[i][0],hostCombos[i][1]] )
- intentIdList.append(hostCombos[i][0],hostCombos[i][1]])
- """
for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -746,7 +888,6 @@
name="addHostIntent",
args=[hostCombos[i][0],hostCombos[i][1]])
pool.append(t)
- #time.sleep(1)
t.start()
i = i + 1
main.threadID = main.threadID + 1
@@ -754,7 +895,8 @@
thread.join()
intentIdList.append(thread.result)
time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+ main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
+
intentResult = main.TRUE
intentsJson = main.ONOScli2.intents()
getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
@@ -765,7 +907,7 @@
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -776,14 +918,137 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- case6Result = ( intentResult and pingResult )
+ case60Result = ( intentResult and pingResult )
utilities.assert_equals(
expect=main.TRUE,
- actual=case6Result,
+ actual=case60Result,
onpass="Install 300 Host Intents and Ping All test PASS",
onfail="Install 300 Host Intents and Ping All test FAIL" )
+ def CASE61( self ):
+ """
+ Install 600 host intents and verify ping all for Chordal Topology
+ """
+ main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+
+ main.case( "Install 600 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))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case14Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case14Result,
+ onpass="Install 300 Host Intents and Ping All test PASS",
+ onfail="Install 300 Host Intents and Ping All test FAIL" )
+
+ def CASE62( self ):
+ """
+ Install 2278 host intents and verify ping all for Spine Topology
+ """
+ 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))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case15Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case15Result,
+ onpass="Install 2278 Host Intents and Ping All test PASS",
+ onfail="Install 2278 Host Intents and Ping All test FAIL" )
+
def CASE70( self, main ):
"""
Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
@@ -792,13 +1057,13 @@
main.randomLink1 = []
main.randomLink2 = []
main.randomLink3 = []
- link1End1 = main.params[ 'CORELINKS' ][ 'linkS3a' ]
- link1End2 = main.params[ 'CORELINKS' ][ 'linkS3b' ].split( ',' )
- link2End1 = main.params[ 'CORELINKS' ][ 'linkS14a' ]
- link2End2 = main.params[ 'CORELINKS' ][ 'linkS14b' ].split( ',' )
- link3End1 = main.params[ 'CORELINKS' ][ 'linkS18a' ]
- link3End2 = main.params[ 'CORELINKS' ][ 'linkS18b' ].split( ',' )
- switchLinksToToggle = main.params[ 'CORELINKS' ][ 'toggleLinks' ]
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+ 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)" )
@@ -847,7 +1112,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkDown = main.FALSE
time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -868,11 +1133,11 @@
Bring the core links up that are down and verify ping all ( Host Intents-Att Topo )
"""
import random
- link1End1 = main.params[ 'CORELINKS' ][ 'linkS3a' ]
- link2End1 = main.params[ 'CORELINKS' ][ 'linkS14a' ]
- link3End1 = main.params[ 'CORELINKS' ][ 'linkS18a' ]
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- switchLinksToToggle = main.params[ 'CORELINKS' ][ 'toggleLinks' ]
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
main.log.report(
"Bring the core links up that are down and verify ping all (Host Intents-Att Topo" )
@@ -912,7 +1177,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkUp = main.FALSE
time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall()
+ pingResultLinkUp = main.Mininet1.pingall( timeout=main.pingTimeout,shortCircuit=True )
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -930,39 +1195,37 @@
def CASE71( self, main ):
"""
- Randomly bring some core links down and verify ping all ( Point Intents-Att Topo )
+ Randomly bring some core links down and verify ping all ( Point Intents-Att Topo)
"""
import random
main.randomLink1 = []
main.randomLink2 = []
main.randomLink3 = []
- link1End1 = main.params[ 'CORELINKS' ][ 'linkS3a' ]
- link1End2 = main.params[ 'CORELINKS' ][ 'linkS3b' ].split( ',' )
- link2End1 = main.params[ 'CORELINKS' ][ 'linkS14a' ]
- link2End2 = main.params[ 'CORELINKS' ][ 'linkS14b' ].split( ',' )
- link3End1 = main.params[ 'CORELINKS' ][ 'linkS18a' ]
- link3End2 = main.params[ 'CORELINKS' ][ 'linkS18b' ].split( ',' )
- switchLinksToToggle = main.params[ 'CORELINKS' ][ 'toggleLinks' ]
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
+ 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 (Point Intents-Att Topo" )
- main.log.report( "__________________________________________________________________" )
- main.case( "Point Intents - Randomly bring some core links down and verify ping all" )
+ main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
+ main.log.report( "___________________________________________________________________________" )
+ main.case( "Point intents - Randomly bring some core links down and verify ping all" )
main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
if ( int( switchLinksToToggle ) ==
0 or int( switchLinksToToggle ) > 5 ):
- main.log.info(
- "Please check you PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
+ main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
#main.cleanup()
#main.exit()
else:
- main.log.info(
- "User provided Core switch links range to toggle is correct, proceeding to run the test" )
+ main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
main.step( "Cut links on Core devices using user provided range" )
- randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
- randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
- randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
+ main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
+ main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
+ main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
for i in range( int( switchLinksToToggle ) ):
main.Mininet1.link(
END1=link1End1,
@@ -980,8 +1243,8 @@
topology_output = main.ONOScli2.topology()
linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numSwitches, str(
- int( main.numLinks ) - int( switchLinksToToggle ) * 6 ) )
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
utilities.assert_equals(
expect=main.TRUE,
actual=linkDown,
@@ -993,7 +1256,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkDown = main.FALSE
time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1004,8 +1267,8 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- caseResult7 = linkDown and pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult7,
+ caseResult71 = linkDown and pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
onpass="Random Link cut Test PASS",
onfail="Random Link cut Test FAIL" )
@@ -1014,16 +1277,16 @@
Bring the core links up that are down and verify ping all ( Point Intents-Att Topo )
"""
import random
- link1End1 = main.params[ 'CORELINKS' ][ 'linkS3a' ]
- link2End1 = main.params[ 'CORELINKS' ][ 'linkS14a' ]
- link3End1 = main.params[ 'CORELINKS' ][ 'linkS18a' ]
+ link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
+ link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
+ link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- switchLinksToToggle = main.params[ 'CORELINKS' ][ 'toggleLinks' ]
+ switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
main.log.report(
- "Bring the core links up that are down and verify ping all (Point Intents-Att Topo" )
+ "Bring the core links up that are down and verify ping all ( Point Intents-Att Topo" )
main.log.report(
- "___________________________________________________________________" )
+ "__________________________________________________________________" )
main.case(
"Point intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on Core devices up" )
@@ -1058,7 +1321,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkUp = main.FALSE
time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall()
+ pingResultLinkUp = main.Mininet1.pingall(timeout = main.pingTimeout, shortCircuit = True )
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1116,7 +1379,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkDown = main.FALSE
time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1127,8 +1390,8 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- caseResult72 = pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult72,
+ caseResult71 = pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
onpass="Random Link cut Test PASS",
onfail="Random Link cut Test FAIL" )
@@ -1171,7 +1434,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkUp = main.FALSE
time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1186,30 +1449,38 @@
utilities.assert_equals( expect=main.TRUE, actual=caseResult82,
onpass="Link Up Test PASS",
onfail="Link Up Test FAIL" )
-
+
def CASE73( self, main ):
"""
- Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo)
+ Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
"""
import random
- main.pingTimeout = 600
+ import itertools
link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
+
+ main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
main.log.report( "___________________________________________________________________________" )
-
- main.someLinks = [('s1','s9'),('s3','s9'),('s6','s10'),('s8','s10')]
- for switch in main.someLinks:
+ main.case( "Point intents - Randomly bring some core links down and verify ping all" )
+ switches = []
+ switchesComb = []
+ for i in range( main.numMNswitches ):
+ switches.append('s%d'%(i+1))
+ switchesLinksComb = list(itertools.combinations(switches,2))
+ main.randomLinks = random.sample(switchesLinksComb, 5 )
+ print main.randomLinks
+ main.step( "Cut links on random devices" )
+
+ for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
END2=switch[1],
- OPTION="down" )
+ OPTION="down")
time.sleep( link_sleep )
topology_output = main.ONOScli2.topology()
linkDown = main.ONOSbench.checkStatus(
topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 8 ))
+ int( main.numMNlinks ) - 5 * 2 ) )
utilities.assert_equals(
expect=main.TRUE,
actual=linkDown,
@@ -1221,7 +1492,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkDown = main.FALSE
time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1232,30 +1503,32 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- caseResult73 = linkDown and pingResultLinkDown
+ caseResult73 = pingResultLinkDown
utilities.assert_equals( expect=main.TRUE, actual=caseResult73,
onpass="Random Link cut Test PASS",
onfail="Random Link cut Test FAIL" )
def CASE83( self, main ):
"""
- Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo )
+ 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.log.report(
- "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
+ "Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
main.log.report(
"__________________________________________________________________" )
main.case(
- "Host intents - Bring the core links up that are down and verify ping all" )
+ "Point intents - Bring the core links up that are down and verify ping all" )
+ main.step( "Bring randomly cut links on devices up" )
- for switch in main.someLinks:
+ for switch in main.randomLinks:
main.Mininet1.link(
END1=switch[0],
END2=switch[1],
OPTION="up")
+
time.sleep( link_sleep )
topology_output = main.ONOScli2.topology()
@@ -1274,7 +1547,7 @@
main.step( "Verify Ping across all hosts" )
pingResultLinkUp = main.FALSE
time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1289,8 +1562,128 @@
utilities.assert_equals( expect=main.TRUE, actual=caseResult83,
onpass="Link Up Test PASS",
onfail="Link Up Test FAIL" )
+
+ def CASE74( self, main ):
+ """
+ Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo)
+ """
+ import random
+ main.randomLink1 = []
+ main.randomLink2 = []
+ main.randomLink3 = []
+ main.randomLink4 = []
+ link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+ link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' )
+ link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' )
+ 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
- def CASE9( self ):
+ main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
+ main.log.report( "___________________________________________________________________________" )
+
+ linkIndex = range(4)
+ linkIndexS9 = random.sample(linkIndex,1)[0]
+ linkIndex.remove(linkIndexS9)
+ linkIndexS10 = random.sample(linkIndex,1)[0]
+ main.randomLink1 = link1End2top[linkIndexS9]
+ main.randomLink2 = link2End2top[linkIndexS10]
+ main.randomLink3 = random.sample(link1End2bot,1)[0]
+ main.randomLink4 = random.sample(link2End2bot,1)[0]
+ # 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" )
+ main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
+
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ int( main.numMNlinks ) - 8 ))
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkDown,
+ onpass="Link Down discovered properly",
+ onfail="Link down was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult74 = linkDown and pingResultLinkDown
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult74,
+ onpass="Random Link cut Test PASS",
+ onfail="Random Link cut Test FAIL" )
+
+ def CASE84( self, main ):
+ """
+ Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo )
+ """
+ import random
+ link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
+ link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
+ link_sleep = 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(
+ "__________________________________________________________________" )
+ main.case(
+ "Host intents - Bring the core links up that are down and verify ping all" )
+
+ #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" )
+ main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
+
+ time.sleep( link_sleep )
+ topology_output = main.ONOScli2.topology()
+ linkUp = main.ONOSbench.checkStatus(
+ topology_output,
+ main.numMNswitches,
+ str( main.numMNlinks ) )
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=linkUp,
+ onpass="Link up discovered properly",
+ onfail="Link up was not discovered in " +
+ str( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkUp = main.FALSE
+ time1 = time.time()
+ pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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=pingResultLinkUp,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ caseResult84 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
+ onpass="Link Up Test PASS",
+ onfail="Link Up Test FAIL" )
+
+ def CASE90( self ):
"""
Install 600 point intents and verify ping all (Att Topology)
"""
@@ -1305,11 +1698,6 @@
intentIdList = []
time1 = time.time()
- """
- for i in xrange(0 ,len(hostCombos)):
- tempId = ONOScli1.addHostIntent( hostCombos[i][0],hostCombos[i][1]] )
- intentIdList.append(hostCombos[i][0],hostCombos[i][1]])
- """
for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
pool = []
for cli in main.CLIs:
@@ -1339,7 +1727,7 @@
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1350,16 +1738,260 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- case6Result = ( intentResult and pingResult )
+ case90Result = ( intentResult and pingResult )
utilities.assert_equals(
expect=main.TRUE,
- actual=case6Result,
+ actual=case90Result,
onpass="Install 600 point Intents and Ping All test PASS",
onfail="Install 600 point Intents and Ping All test FAIL" )
- main.cleanup()
- main.exit()
- def CASE90( self ):
+
+ def CASE91( self ):
+ """
+ Install ###$$$ point intents and verify ping all (Chordal Topology)
+ """
+ main.log.report( "Add ###$$$ point intents and verify pingall (Chordal Topology)" )
+ main.log.report( "_______________________________________" )
+ import itertools
+ import time
+ main.case( "Install ###$$$ 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,"IPV4","",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))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep(30)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case91Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case91Result,
+ onpass="Install ###$$$ point Intents and Ping All test PASS",
+ onfail="Install ###$$$ point Intents and Ping All test FAIL" )
+
+ def CASE92( self ):
+ """
+ Install 4556 point intents and verify ping all (Spine Topology)
+ """
+ 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,"IPV4","",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))
+ intentResult = main.TRUE
+ intentsJson = main.ONOScli2.intents()
+ getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
+ intentsJson = intentsJson)
+ #print getIntentStateResult
+ # Takes awhile for all the onos to get the intents
+ time.sleep(60)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ 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,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ case92Result = ( intentResult and pingResult )
+
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case92Result,
+ onpass="Install 4556 point Intents and Ping All test PASS",
+ onfail="Install 4556 point Intents and Ping All test FAIL" )
+
+ def CASE93( self ):
+ """
+ Install multi-single point intents and verify Ping all works
+ for att topology
+ """
+ import copy
+ import time
+ main.log.report( "Install multi-single point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install multi-single point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ egressDevice = deviceDPIDsCopy[i]
+ ingressDeviceList = copy.copy(deviceDPIDsCopy)
+ ingressDeviceList.remove(egressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+ threadID=main.threadID,
+ name="addMultipointToSinglepointIntent",
+ args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+ 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))
+ print intentIdList
+ time.sleep(5)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case93Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case93Result,
+ onpass="Install 25 multi to single point Intents and Ping All test PASS",
+ onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
+
+ def CASE94( self ):
+ """
+ Install multi-single point intents and verify Ping all works
+ for Chordal topology
+ """
+ import copy
+ import time
+ main.log.report( "Install multi-single point intents and verify Ping all" )
+ main.log.report( "___________________________________________" )
+ main.case( "Install multi-single point intents and Ping all" )
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
+ intentIdList = []
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ egressDevice = deviceDPIDsCopy[i]
+ ingressDeviceList = copy.copy(deviceDPIDsCopy)
+ ingressDeviceList.remove(egressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addMultipointToSinglepointIntent,
+ threadID=main.threadID,
+ name="addMultipointToSinglepointIntent",
+ args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
+ 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))
+ time.sleep(5)
+ main.step( "Verify Ping across all hosts" )
+ pingResult = main.FALSE
+ time1 = time.time()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
+ time2 = time.time()
+ timeDiff = round( ( time2 - time1 ), 2 )
+ main.log.report(
+ "Time taken for Ping All: " +
+ str( timeDiff ) +
+ " seconds" )
+
+ case94Result = pingResult
+ utilities.assert_equals(
+ expect=main.TRUE,
+ actual=case94Result,
+ onpass="Install 25 multi to single point Intents and Ping All test PASS",
+ onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
+
+ #def CASE95 multi-single point intent for Spine
+
+ def CASE96( self ):
"""
Install single-multi point intents and verify Ping all works
for att topology
@@ -1368,198 +2000,106 @@
main.log.report( "Install single-multi point intents and verify Ping all" )
main.log.report( "___________________________________________" )
main.case( "Install single-multi point intents and Ping all" )
- deviceLinksCopy = copy.copy( main.deviceLinks )
- main.step( "Install single-multi point intents" )
- for i in range( len( deviceLinksCopy ) ):
- pointLink = str(
- deviceLinksCopy[ i ] ).replace(
- "src=",
- "" ).replace(
- "dst=",
- "" ).split( ',' )
- point1 = pointLink[ 0 ].split( '/' )
- point2 = pointLink[ 1 ].split( '/' )
- installResult = main.ONOScli1.addPointIntent(
- point1[ 0 ], point2[ 0 ], int(
- point1[ 1 ] ), int(
- point2[ 1 ] ) )
- if installResult == main.TRUE:
- print "Installed Point intent between :", point1[ 0 ], int( point1[ 1 ] ), point2[ 0 ], int( point2[ 1 ] )
-
- main.step( "Obtain the intent id's" )
- intentsList = main.ONOScli1.getAllIntentIds()
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- intentsList = ansi_escape.sub( '', intentsList )
- intentsList = intentsList.replace(
- " onos:intents | grep id=",
- "" ).replace(
- "id=",
- "" ).replace(
- "\r\r",
- "" )
- intentsList = intentsList.splitlines()
- intentsList = intentsList[ 1: ]
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
intentIdList = []
- for i in range( len( intentsList ) ):
- intentsTemp = intentsList[ i ].split( ',' )
- intentIdList.append( intentsTemp[ 0 ] )
- print "Intent IDs: ", intentIdList
- print "Total Intents installed: ", len( intentIdList )
-
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ ingressDevice = deviceDPIDsCopy[i]
+ egressDeviceList = copy.copy(deviceDPIDsCopy)
+ egressDeviceList.remove(ingressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+ threadID=main.threadID,
+ name="addSinglepointToMultipointIntent",
+ args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice)])
+ 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))
+ time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
time1 = time.time()
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
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,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
- case8_result = installResult and pingResult
+ case96Result = pingResult
utilities.assert_equals(
expect=main.TRUE,
- actual=case8_result,
- onpass="Ping all test after Point intents addition successful",
- onfail="Ping all test after Point intents addition failed" )
+ actual=case96Result,
+ onpass="Install 25 single to multi point Intents and Ping All test PASS",
+ onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
- def CASE91( self ):
+ def CASE97( self ):
"""
Install single-multi point intents and verify Ping all works
+ for Chordal topology
"""
import copy
main.log.report( "Install single-multi point intents and verify Ping all" )
main.log.report( "___________________________________________" )
main.case( "Install single-multi point intents and Ping all" )
- deviceLinksCopy = copy.copy( main.deviceLinks )
- main.step( "Install single-multi point intents" )
- for i in range( len( deviceLinksCopy ) ):
- pointLink = str(
- deviceLinksCopy[ i ] ).replace(
- "src=",
- "" ).replace(
- "dst=",
- "" ).split( ',' )
- point1 = pointLink[ 0 ].split( '/' )
- point2 = pointLink[ 1 ].split( '/' )
- installResult = main.ONOScli1.addPointIntent(
- point1[ 0 ], point2[ 0 ], int(
- point1[ 1 ] ), int(
- point2[ 1 ] ) )
- if installResult == main.TRUE:
- print "Installed Point intent between :", point1[ 0 ], int( point1[ 1 ] ), point2[ 0 ], int( point2[ 1 ] )
-
- main.step( "Obtain the intent id's" )
- intentsList = main.ONOScli1.getAllIntentIds()
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- intentsList = ansi_escape.sub( '', intentsList )
- intentsList = intentsList.replace(
- " onos:intents | grep id=",
- "" ).replace(
- "id=",
- "" ).replace(
- "\r\r",
- "" )
- intentsList = intentsList.splitlines()
- intentsList = intentsList[ 1: ]
+ deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
+ portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
intentIdList = []
- for i in range( len( intentsList ) ):
- intentsTemp = intentsList[ i ].split( ',' )
- intentIdList.append( intentsTemp[ 0 ] )
- print "Intent IDs: ", intentIdList
- print "Total Intents installed: ", len( intentIdList )
-
+ print "MACsDict", main.MACsDict
+ time1 = time.time()
+ for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
+ pool = []
+ for cli in main.CLIs:
+ ingressDevice = deviceDPIDsCopy[i]
+ egressDeviceList = copy.copy(deviceDPIDsCopy)
+ egressDeviceList.remove(ingressDevice)
+ if i >= len( deviceDPIDsCopy ):
+ break
+ t = main.Thread( target=cli.addSinglepointToMultipointIntent,
+ threadID=main.threadID,
+ name="addSinglepointToMultipointIntent",
+ args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice),''])
+ 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))
+ time.sleep(5)
main.step( "Verify Ping across all hosts" )
pingResult = main.FALSE
time1 = time.time()
- pingResult = main.Mininet1.pingall()
+ pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=True)
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,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
- case8_result = installResult and pingResult
+ case97Result = pingResult
utilities.assert_equals(
expect=main.TRUE,
- actual=case8_result,
- onpass="Ping all test after Point intents addition successful",
- onfail="Ping all test after Point intents addition failed" )
-
- def CASE92( self ):
- """
- Install 114 point intents and verify Ping all works
- """
- import copy
- main.log.report( "Install 114 point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install 114 point intents and Ping all" )
- deviceLinksCopy = copy.copy( main.deviceLinks )
- main.step( "Install 114 point intents" )
- for i in range( len( deviceLinksCopy ) ):
- pointLink = str(
- deviceLinksCopy[ i ] ).replace(
- "src=",
- "" ).replace(
- "dst=",
- "" ).split( ',' )
- point1 = pointLink[ 0 ].split( '/' )
- point2 = pointLink[ 1 ].split( '/' )
- installResult = main.ONOScli1.addPointIntent(
- point1[ 0 ], point2[ 0 ], int(
- point1[ 1 ] ), int(
- point2[ 1 ] ) )
- if installResult == main.TRUE:
- print "Installed Point intent between :", point1[ 0 ], int( point1[ 1 ] ), point2[ 0 ], int( point2[ 1 ] )
-
- main.step( "Obtain the intent id's" )
- intentsList = main.ONOScli1.getAllIntentIds()
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- intentsList = ansi_escape.sub( '', intentsList )
- intentsList = intentsList.replace(
- " onos:intents | grep id=",
- "" ).replace(
- "id=",
- "" ).replace(
- "\r\r",
- "" )
- intentsList = intentsList.splitlines()
- intentsList = intentsList[ 1: ]
- intentIdList = []
- for i in range( len( intentsList ) ):
- intentsTemp = intentsList[ i ].split( ',' )
- intentIdList.append( intentsTemp[ 0 ] )
- print "Intent IDs: ", intentIdList
- print "Total Intents installed: ", len( intentIdList )
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- 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,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case8_result = installResult and pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case8_result,
- onpass="Ping all test after Point intents addition successful",
- onfail="Ping all test after Point intents addition failed" )
+ actual=case97Result,
+ onpass="Install 25 single to multi point Intents and Ping All test PASS",
+ onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
def CASE10( self ):
import time
@@ -1587,6 +2127,7 @@
step1Result = main.TRUE
moreIntents = main.TRUE
removeIntentCount = 0
+ intentsCount = len(intentsList)
print "Current number of intents" , len(intentsList)
if ( len( intentsList ) > 1 ):
results = main.TRUE
@@ -1619,8 +2160,25 @@
intentIdList1.append( intentsTemp1[ 0 ].split('=')[1] )
print "Leftover Intent IDs: ", intentIdList1
print len(intentIdList1)
- for intent in intentIdList1:
- main.CLIs[0].removeIntent(intent,'org.onosproject.cli',True,False)
+ time1 = time.time()
+ for i in xrange( 0, len( intentIdList1 ), int(main.numCtrls) ):
+ pool = []
+ for cli in main.CLIs:
+ if i >= len( intentIdList1 ):
+ break
+ t = main.Thread( target=cli.removeIntent,
+ threadID=main.threadID,
+ name="removeIntent",
+ args=[intentIdList1[i],'org.onosproject.cli',True,False])
+ 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 removing host intents: %2f seconds" %(time2-time1))
time.sleep(10)
else:
time.sleep(15)
@@ -1629,14 +2187,13 @@
break
else:
- print "There are no more intents that need to be removed"
+ print "Removed %d intents" %(intentsCount)
step1Result = main.TRUE
else:
print "No Intent IDs found in Intents list: ", intentsList
step1Result = main.FALSE
print main.ONOScli1.intents()
- # time.sleep(300)
caseResult10 = step1Result
utilities.assert_equals( expect=main.TRUE, actual=caseResult10,
onpass="Intent removal test successful",
@@ -1736,279 +2293,6 @@
onpass="Intent based Reactive forwarding Pingall test PASS",
onfail="Intent based Reactive forwarding Pingall test FAIL" )
- def CASE12( self, main ):
- """
- This test script Loads a new Topology (Chordal) on CHO setup and balances all switches
- """
- import re
- import time
- import copy
-
- 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 = 120
- main.log.report(
- "Load Chordal topology and Balance all Mininet switches across controllers" )
- main.log.report(
- "________________________________________________________________________" )
- main.case(
- "Assign and Balance all Mininet switches across controllers" )
- main.step( "Stop any previous Mininet network topology" )
- stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" )
- time.sleep(10)
- main.step( "Start Mininet with Chordal topology" )
- startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
- time.sleep(15)
- main.step( "Assign switches to controllers" )
- for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw=str( i ),
- count=int( main.numCtrls ),
- ip1=main.ONOS1_ip,
- port1=main.ONOS1_port,
- ip2=main.ONOS2_ip,
- port2=main.ONOS2_port,
- ip3=main.ONOS3_ip,
- port3=main.ONOS3_port,
- ip4=main.ONOS4_ip,
- port4=main.ONOS4_port,
- ip5=main.ONOS5_ip,
- port5=main.ONOS5_port )
-
- switch_mastership = main.TRUE
- for i in range( 1, ( main.numMNswitches + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOS1_ip, response ):
- switch_mastership = switch_mastership and main.TRUE
- else:
- switch_mastership = main.FALSE
-
- if switch_mastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- time.sleep( 5 )
-
- #Don't balance master for now..
- """
- main.step( "Balance devices across controllers" )
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 3 )
- """
- case12Result = switch_mastership
- time.sleep(30)
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case12Result,
- onpass="Starting new Chordal topology test PASS",
- onfail="Starting new Chordal topology test FAIL" )
-
- def CASE13( self, main ):
- """
- This test script Loads a new Topology (Spine) on CHO setup and balances all switches
- """
- import re
- import time
- import copy
-
- 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.log.report(
- "Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
- main.log.report(
- "________________________________________________________________________" )
- # need to wait here for sometime until ONOS bootup
- main.case(
- "Assign and Balance all Mininet switches across controllers" )
- main.step( "Stop any previous Mininet network topology" )
- stopStatus = main.Mininet1.stopNet(fileName = "topoSpine" )
- main.step( "Start Mininet with Spine topology" )
- startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
- time.sleep(20)
- main.step( "Assign switches to controllers" )
- for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw=str( i ),
- count= 1,
- ip1=main.ONOS1_ip,
- port1=main.ONOS1_port,
- ip2=main.ONOS2_ip,
- port2=main.ONOS2_port,
- ip3=main.ONOS3_ip,
- port3=main.ONOS3_port,
- ip4=main.ONOS4_ip,
- port4=main.ONOS4_port,
- ip5=main.ONOS5_ip,
- port5=main.ONOS5_port )
-
- switch_mastership = main.TRUE
- for i in range( 1, ( main.numMNswitches + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOS1_ip, response ):
- switch_mastership = switch_mastership and main.TRUE
- else:
- switch_mastership = main.FALSE
-
- if switch_mastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- time.sleep( 5 )
- """
- main.step( "Balance devices across controllers" )
-
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 3 )
-
- main.step( "Balance devices across controllers" )
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 3 )
- """
- case13Result = switch_mastership
- time.sleep(30)
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case13Result,
- onpass="Starting new Spine topology test PASS",
- onfail="Starting new Spine topology test FAIL" )
-
- def CASE14( self ):
- """
- Install 300 host intents and verify ping all for Chordal Topology
- """
- 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))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- 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,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case14Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case14Result,
- onpass="Install 300 Host Intents and Ping All test PASS",
- onfail="Install 300 Host Intents and Ping All test FAIL" )
-
- def CASE15( self ):
- """
- Install 2278 host intents and verify ping all for Spine Topology
- """
- 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))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout)
- 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,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case15Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case15Result,
- onpass="Install 2278 Host Intents and Ping All test PASS",
- onfail="Install 2278 Host Intents and Ping All test FAIL" )
-
def CASE99(self):
import time
# WORK AROUND FOR ONOS-581. STOP ONOS BEFORE ASSIGNING CONTROLLERS AT MININET & START ONCE DONE
diff --git a/TestON/tests/OnosCHO/OnosCHO.topo b/TestON/tests/OnosCHO/OnosCHO.topo
index 161b89c..9b0c3e7 100644
--- a/TestON/tests/OnosCHO/OnosCHO.topo
+++ b/TestON/tests/OnosCHO/OnosCHO.topo
@@ -2,7 +2,7 @@
<COMPONENT>
<ONOSbench>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosDriver</type>
@@ -13,7 +13,7 @@
</ONOSbench>
<ONOScli1>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -22,7 +22,7 @@
</ONOScli1>
<ONOScli2>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -31,7 +31,7 @@
</ONOScli2>
<ONOScli3>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -40,7 +40,7 @@
</ONOScli3>
<ONOScli4>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -49,7 +49,7 @@
</ONOScli4>
<ONOScli5>
- <host>10.128.40.40</host>
+ <host>10.128.10.20</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -58,7 +58,7 @@
</ONOScli5>
<ONOS1>
- <host>10.128.40.41</host>
+ <host>10.128.10.21</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -67,7 +67,7 @@
</ONOS1>
<ONOS2>
- <host>10.128.40.42</host>
+ <host>10.128.10.22</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -76,7 +76,7 @@
</ONOS2>
<ONOS3>
- <host>10.128.40.43</host>
+ <host>10.128.10.23</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -85,7 +85,7 @@
</ONOS3>
<ONOS4>
- <host>10.128.40.44</host>
+ <host>10.128.10.24</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -94,7 +94,7 @@
</ONOS4>
<ONOS5>
- <host>10.128.40.45</host>
+ <host>10.128.10.25</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
@@ -116,20 +116,6 @@
<controller> remote </controller>
</COMPONENTS>
</Mininet1>
-
- <Mininet2>
- <host>10.128.40.50</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/att-mpls-topo.py </arg1>
- <arg2> --topo att </arg2>
- <arg3> --link tc --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
</COMPONENT>
+
</TOPOLOGY>