Merge branch 'master' of https://github.com/opennetworkinglab/ONLabTest into devl/newOnosCHO
diff --git a/TestON/tests/OnosCHO/OnosCHO.params b/TestON/tests/OnosCHO/OnosCHO.params
index 9066177..0c13009 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
+ #CHO sequence : 1,20,[3,40,5,60,70,80,10,90,71,81,10]*50,22,[3,41,5,61,72,82,10,91,73,83,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,93</testcases>
<ENV>
<cellName>choTest5</cellName>
</ENV>
@@ -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,7 +72,16 @@
<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>
diff --git a/TestON/tests/OnosCHO/OnosCHO.py b/TestON/tests/OnosCHO/OnosCHO.py
index 7c09872..1155fa4 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
@@ -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" )
@@ -354,7 +523,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)
"""
@@ -620,7 +789,6 @@
utilities.assert_equals( expect=main.TRUE, actual=case4Result,
onpass="Reactive Mode Pingall test PASS",
onfail="Reactive Mode Pingall test FAIL" )
-
def CASE5( self, main ):
"""
Compare current ONOS topology with reference data
@@ -716,7 +884,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 +899,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 +909,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 +916,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,
@@ -776,14 +939,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)
+ 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)
+ 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 +1078,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)" )
@@ -868,11 +1154,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" )
@@ -930,39 +1216,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 ( Host 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 (Host Intents-Att Topo)" )
+ main.log.report( "___________________________________________________________________________" )
+ main.case( "Host 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 +1264,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 +1277,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)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1004,28 +1288,28 @@
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" )
def CASE81( self, main ):
"""
- 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 ( 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 (Point Intents-Att Topo" )
+ "Bring the core links up that are down and verify ping all (Host Intents-Att Topo" )
main.log.report(
- "___________________________________________________________________" )
+ "__________________________________________________________________" )
main.case(
- "Point intents - Bring the core links up that are down and verify ping all" )
+ "Host intents - Bring the core links up that are down and verify ping all" )
main.step( "Bring randomly cut links on Core devices up" )
for i in range( int( switchLinksToToggle ) ):
main.Mininet1.link(
@@ -1058,7 +1342,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)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1127,8 +1411,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 +1455,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)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1186,24 +1470,154 @@
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 links down and verify ping all ( Host Intents-Chordal Topo)
+ """
+ import random
+ import itertools
+ link_sleep = 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( "___________________________________________________________________________" )
+ main.case( "Host 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")
+ time.sleep( link_sleep )
+
+ topology_output = main.ONOScli2.topology()
+ linkDown = main.ONOSbench.checkStatus(
+ topology_output, main.numMNswitches, str(
+ 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( link_sleep ) +
+ " seconds" )
+
+ main.step( "Verify Ping across all hosts" )
+ pingResultLinkDown = main.FALSE
+ time1 = time.time()
+ pingResultLinkDown = 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=pingResultLinkDown,
+ onpass="PING ALL PASS",
+ onfail="PING ALL FAIL" )
+
+ 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 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-Chordal Topo" )
+ main.log.report(
+ "__________________________________________________________________" )
+ main.case(
+ "Host 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.randomLinks:
+ main.Mininet1.link(
+ END1=switch[0],
+ END2=switch[1],
+ 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)
+ 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" )
+
+ caseResult83 = linkUp and pingResultLinkUp
+ 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.pingTimeout = 600
+ 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
+
main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
main.log.report( "___________________________________________________________________________" )
-
- main.someLinks = [('s1','s9'),('s3','s9'),('s6','s10'),('s8','s10')]
- for switch in main.someLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="down" )
+
+ 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()
@@ -1232,17 +1646,18 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- caseResult73 = linkDown and pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult73,
+ 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 CASE83( self, main ):
+ 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" )
@@ -1251,13 +1666,12 @@
main.case(
"Host intents - Bring the core links up that are down and verify ping all" )
- for switch in main.someLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="up")
+ #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,
@@ -1274,7 +1688,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)
time2 = time.time()
timeDiff = round( ( time2 - time1 ), 2 )
main.log.report(
@@ -1285,12 +1699,12 @@
onpass="PING ALL PASS",
onfail="PING ALL FAIL" )
- caseResult83 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult83,
+ caseResult84 = linkUp and pingResultLinkUp
+ utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
onpass="Link Up Test PASS",
onfail="Link Up Test FAIL" )
-
- def CASE9( self ):
+
+ def CASE90( self ):
"""
Install 600 point intents and verify ping all (Att Topology)
"""
@@ -1305,11 +1719,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:
@@ -1350,16 +1759,258 @@
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)
+ 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)
+ 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))
+ time.sleep(5)
+ 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" )
+
+ 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 spine 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)
+ 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 CASE96( self ):
"""
Install single-multi point intents and verify Ping all works
for att topology
@@ -1427,7 +2078,7 @@
onpass="Ping all test after Point intents addition successful",
onfail="Ping all test after Point intents addition failed" )
- def CASE91( self ):
+ def CASE97( self ):
"""
Install single-multi point intents and verify Ping all works
"""
@@ -1494,73 +2145,6 @@
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" )
-
def CASE10( self ):
import time
"""
@@ -1587,6 +2171,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 +2204,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 +2231,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 +2337,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..d215937 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>