blob: 50501cf74f9b95e8903b0d097d8b18982481c4ad [file] [log] [blame]
pingping-lin28e7b212015-09-10 10:14:58 -07001# Testing the functionality of SDN-IP with single ONOS instance
pingping-lin5bb663b2015-09-24 11:47:50 -07002class USECASE_SdnipFunction:
pingping-lin28e7b212015-09-10 10:14:58 -07003
4 def __init__( self ):
5 self.default = ''
6 global branchName
7
pingping-linb702c602015-09-10 17:00:29 -07008 def CASE100( self, main ):
9 """
10 Start mininet
11 """
12 import os
pingping-lin4f80c492015-09-15 14:34:42 -070013 import imp
Jon Hall70b768c2016-04-19 08:38:29 -070014 main.case( "Setup the Mininet testbed" )
pingping-linb702c602015-09-10 17:00:29 -070015 main.dependencyPath = main.testDir + \
16 main.params[ 'DEPENDENCY' ][ 'path' ]
17 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
18
19 main.step( "Starting Mininet Topology" )
20 topology = main.dependencyPath + main.topology
Jon Hall6e9897d2016-02-29 14:41:32 -080021 topoResult = main.Mininet.startNet( topoFile=topology )
22 utilities.assert_equals( expect=main.TRUE,
23 actual=topoResult,
24 onpass="Successfully loaded topology",
25 onfail="Failed to load topology" )
pingping-linb702c602015-09-10 17:00:29 -070026 # Exit if topology did not load properly
27 if not topoResult:
28 main.cleanup()
29 main.exit()
pingping-lin5bb663b2015-09-24 11:47:50 -070030 main.step( "Connect switches to controller" )
31
32 global ONOS1Ip
33 ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
34 # connect all switches to controller
35 swResult = main.TRUE
36 for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
37 sw = "sw%s" % ( i )
38 swResult = swResult and main.Mininet.assignSwController( sw, ONOS1Ip )
Jon Hall6e9897d2016-02-29 14:41:32 -080039 utilities.assert_equals( expect=main.TRUE,
40 actual=swResult,
41 onpass="Successfully connect all switches to ONOS",
42 onfail="Failed to connect all switches to ONOS" )
pingping-lin5bb663b2015-09-24 11:47:50 -070043 if not swResult:
44 main.cleanup()
45 main.exit()
46
47 main.step( "Set up tunnel from Mininet node to onos node" )
48 forwarding1 = '%s:2000:%s:2000' % ( '1.1.1.2', ONOS1Ip )
49 command = 'ssh -nNT -o "PasswordAuthentication no" \
50 -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding1, ONOS1Ip )
51
52 tunnelResult = main.TRUE
53 tunnelResult = main.Mininet.node( "root", command )
Jon Hall6e9897d2016-02-29 14:41:32 -080054 utilities.assert_equals( expect=True,
55 actual=( "PasswordAuthentication" in tunnelResult ),
56 onpass="Created tunnel succeeded",
57 onfail="Create tunnel failed" )
pingping-linb3ebd3f2015-09-28 22:17:05 -070058 if ("PasswordAuthentication" not in tunnelResult) :
pingping-lin5bb663b2015-09-24 11:47:50 -070059 main.cleanup()
60 main.exit()
pingping-lin5bb663b2015-09-24 11:47:50 -070061
pingping-linb702c602015-09-10 17:00:29 -070062 def CASE101( self, main ):
pingping-lin28e7b212015-09-10 10:14:58 -070063 """
pingping-linea32cf82015-10-08 22:37:37 -070064 Package ONOS and install it
pingping-lin28e7b212015-09-10 10:14:58 -070065 Startup sequence:
66 cell <name>
67 onos-verify-cell
pingping-lin28e7b212015-09-10 10:14:58 -070068 onos-package
69 onos-install -f
70 onos-wait-for-start
71 """
72 import json
73 import time
Jon Hall6e9897d2016-02-29 14:41:32 -080074 import os
pingping-lin28e7b212015-09-10 10:14:58 -070075 from operator import eq
76
Jon Hall6e9897d2016-02-29 14:41:32 -080077 main.case( "Setting up ONOS environment" )
pingping-lin28e7b212015-09-10 10:14:58 -070078
79 cellName = main.params[ 'ENV' ][ 'cellName' ]
Jon Hall6e9897d2016-02-29 14:41:32 -080080 global ONOS1Ip
81 ONOS1Ip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
82 ipList = [ ONOS1Ip ]
83
Jon Hall70b768c2016-04-19 08:38:29 -070084 main.step( "Copying config files" )
85 src = os.path.dirname( main.testFile ) + "/network-cfg.json"
86 dst = main.ONOSbench.home + "/tools/package/config/network-cfg.json"
87 status = main.ONOSbench.scp( main.ONOSbench, src, dst, direction="to" )
88 utilities.assert_equals( expect=main.TRUE,
89 actual=status,
90 onpass="Copy config file succeeded",
91 onfail="Copy config file failed" )
92
Jon Hall6e9897d2016-02-29 14:41:32 -080093 main.step( "Create cell file" )
94 cellAppString = main.params[ 'ENV' ][ 'appString' ]
95 main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
96 main.Mininet.ip_address,
97 cellAppString, ipList )
pingping-lin28e7b212015-09-10 10:14:58 -070098
99 main.step( "Applying cell variable to environment" )
100 cellResult = main.ONOSbench.setCell( cellName )
Jon Hall6e9897d2016-02-29 14:41:32 -0800101 utilities.assert_equals( expect=main.TRUE,
102 actual=cellResult,
103 onpass="Set cell succeeded",
104 onfail="Set cell failed" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700105
Jon Hall70b768c2016-04-19 08:38:29 -0700106 main.step( "Verify cell connectivity" )
pingping-lin28e7b212015-09-10 10:14:58 -0700107 verifyResult = main.ONOSbench.verifyCell()
Jon Hall6e9897d2016-02-29 14:41:32 -0800108 utilities.assert_equals( expect=main.TRUE,
109 actual=verifyResult,
110 onpass="Verify cell succeeded",
111 onfail="Verify cell failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700112
113 branchName = main.ONOSbench.getBranchName()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700114 main.log.report( "ONOS is on branch: " + branchName )
pingping-lin28e7b212015-09-10 10:14:58 -0700115
Jon Hall6509dbf2016-06-21 17:01:17 -0700116 main.step( "Uninstalling ONOS" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700117 uninstallResult = main.ONOSbench.onosUninstall( ONOS1Ip )
Jon Hall6e9897d2016-02-29 14:41:32 -0800118 utilities.assert_equals( expect=main.TRUE,
119 actual=uninstallResult,
120 onpass="Uninstall ONOS succeeded",
121 onfail="Uninstall ONOS failed" )
pingping-linaede0312015-09-30 17:53:19 -0700122 '''
pingping-lin28e7b212015-09-10 10:14:58 -0700123 main.step( "Git pull" )
124 gitPullResult = main.ONOSbench.gitPull()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700125 main.log.info( "gitPullResult" )
126 main.log.info( gitPullResult )
127 gitPullResult2 = ( gitPullResult == main.TRUE ) or ( gitPullResult == 3 )
Jon Hall6e9897d2016-02-29 14:41:32 -0800128 utilities.assert_equals( expect=True,
129 actual=gitPullResult2,
130 onpass="Git pull ONOS succeeded",
131 onfail="Git pull ONOS failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700132
133 main.step( "Using mvn clean install" )
134 if gitPullResult == main.TRUE:
Jon Hall6e9897d2016-02-29 14:41:32 -0800135 mciResult = main.ONOSbench.cleanInstall( mciTimeout=1000 )
136 utilities.assert_equals( expect=main.TRUE,
137 actual=mciResult,
138 onpass="Maven clean install ONOS succeeded",
139 onfail="Maven clean install ONOS failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700140 else:
141 main.log.warn( "Did not pull new code so skipping mvn " +
142 "clean install" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700143 mciResult = main.TRUE
pingping-linaede0312015-09-30 17:53:19 -0700144 '''
pingping-lin28e7b212015-09-10 10:14:58 -0700145
Jon Hall6e9897d2016-02-29 14:41:32 -0800146 main.ONOSbench.getVersion( report=True )
pingping-lin28e7b212015-09-10 10:14:58 -0700147
148 main.step( "Creating ONOS package" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800149 packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
150 utilities.assert_equals( expect=main.TRUE,
151 actual=packageResult,
152 onpass="Package ONOS succeeded",
153 onfail="Package ONOS failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700154
155 main.step( "Installing ONOS package" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800156 onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
157 node=ONOS1Ip )
158 utilities.assert_equals( expect=main.TRUE,
159 actual=onos1InstallResult,
160 onpass="Install ONOS succeeded",
161 onfail="Install ONOS failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700162
163 main.step( "Checking if ONOS is up yet" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800164 onos1UpResult = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
165 utilities.assert_equals( expect=main.TRUE,
166 actual=onos1UpResult,
167 onpass="ONOS is up",
168 onfail="ONOS is NOT up" )
pingping-lin28e7b212015-09-10 10:14:58 -0700169
pingping-linb3ebd3f2015-09-28 22:17:05 -0700170 main.step( "Checking if ONOS CLI is ready" )
pingping-lin28e7b212015-09-10 10:14:58 -0700171 cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
Jon Hall6e9897d2016-02-29 14:41:32 -0800172 commandlineTimeout=100, onosStartTimeout=600 )
173 utilities.assert_equals( expect=main.TRUE,
174 actual=cliResult,
175 onpass="ONOS CLI is ready",
176 onfail="ONOS CLI is not ready" )
pingping-lin28e7b212015-09-10 10:14:58 -0700177
Jon Hall6e9897d2016-02-29 14:41:32 -0800178 for i in range( 10 ):
179 ready = True
180 output = main.ONOScli.summary()
181 if not output:
182 ready = False
183 if ready:
184 break
185 time.sleep( 30 )
186 utilities.assert_equals( expect=True, actual=ready,
187 onpass="ONOS summary command succeded",
188 onfail="ONOS summary command failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700189
Jon Hall6e9897d2016-02-29 14:41:32 -0800190 if not ready:
191 main.log.error( "ONOS startup failed!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700192 main.cleanup()
193 main.exit()
194
Jon Hall6e9897d2016-02-29 14:41:32 -0800195 def CASE200( self, main ):
196 main.case( "Activate sdn-ip application" )
197 main.log.info( "waiting link discovery......" )
198 time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
199
pingping-linb3ebd3f2015-09-28 22:17:05 -0700200 main.log.info( "Get links in the network" )
pingping-lin3f091d62015-09-29 12:00:05 -0700201 summaryResult = main.ONOScli.summary()
202 linkNum = json.loads( summaryResult )[ "links" ]
Jon Hall6e9897d2016-02-29 14:41:32 -0800203 listResult = main.ONOScli.links( jsonFormat=False )
204 main.log.info( listResult )
pingping-lin3f091d62015-09-29 12:00:05 -0700205 if linkNum < 100:
Jon Hall6e9897d2016-02-29 14:41:32 -0800206 main.log.error( "Link number is wrong!" )
207 time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
208 listResult = main.ONOScli.links( jsonFormat=False )
pingping-lin3f091d62015-09-29 12:00:05 -0700209 main.log.info( listResult )
210 main.cleanup()
211 main.exit()
212
pingping-linb3ebd3f2015-09-28 22:17:05 -0700213 main.step( "Activate sdn-ip application" )
214 activeSDNIPresult = main.ONOScli.activateApp( "org.onosproject.sdnip" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800215 utilities.assert_equals( expect=main.TRUE,
216 actual=activeSDNIPresult,
217 onpass="Activate SDN-IP succeeded",
218 onfail="Activate SDN-IP failed" )
pingping-lin3f091d62015-09-29 12:00:05 -0700219 if not activeSDNIPresult:
220 main.log.info( "Activate SDN-IP failed!" )
221 main.cleanup()
222 main.exit()
223
pingping-linb3ebd3f2015-09-28 22:17:05 -0700224
225 main.log.info( "Wait SDN-IP to finish installing connectivity intents \
pingping-linb702c602015-09-10 17:00:29 -0700226 and the BGP paths in data plane are ready..." )
pingping-lin28e7b212015-09-10 10:14:58 -0700227 time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) )
pingping-linb702c602015-09-10 17:00:29 -0700228 main.log.info( "Wait Quagga to finish delivery all routes to each \
229 other and to sdn-ip, plus finish installing all intents..." )
pingping-lin28e7b212015-09-10 10:14:58 -0700230 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
231 time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
232
233
pingping-lin4f80c492015-09-15 14:34:42 -0700234 def CASE102( self, main ):
235 '''
236 This test case is to load the methods from other Python files.
237 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700238 main.case( "Loading methods from other Python file" )
pingping-lin4f80c492015-09-15 14:34:42 -0700239 # load the methods from other file
240 wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
241 main.Functions = imp.load_source( wrapperFile,
242 main.dependencyPath +
243 wrapperFile +
244 ".py" )
245
246
pingping-lin0ce60622015-09-10 14:37:33 -0700247 def CASE1( self, main ):
248 '''
249 ping test from 3 bgp peers to BGP speaker
250 '''
pingping-lin950b50d2015-09-14 12:00:08 -0700251
pingping-linb3ebd3f2015-09-28 22:17:05 -0700252 main.case( "Ping tests between BGP peers and speakers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800253 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
254 peers=["peer64514", "peer64515", "peer64516"],
255 expectAllSuccess=True )
pingping-lin0ce60622015-09-10 14:37:33 -0700256
pingping-lin950b50d2015-09-14 12:00:08 -0700257
pingping-lin0ce60622015-09-10 14:37:33 -0700258 def CASE2( self, main ):
259 '''
260 point-to-point intents test for each BGP peer and BGP speaker pair
261 '''
Jon Hall6e9897d2016-02-29 14:41:32 -0800262 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700263 main.case( "Check point-to-point intents" )
pingping-lin0ce60622015-09-10 14:37:33 -0700264 main.log.info( "There are %s BGP peers in total "
265 % main.params[ 'config' ][ 'peerNum' ] )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700266 main.step( "Check P2P intents number from ONOS CLI" )
pingping-lin0ce60622015-09-10 14:37:33 -0700267
Jon Hall6e9897d2016-02-29 14:41:32 -0800268 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin0ce60622015-09-10 14:37:33 -0700269 bgpIntentsActualNum = \
270 main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
271 bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
Jon Hall6e9897d2016-02-29 14:41:32 -0800272 if bgpIntentsActualNum != bgpIntentsExpectedNum:
273 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700274 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800275 bgpIntentsActualNum = \
276 main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
pingping-lin0ce60622015-09-10 14:37:33 -0700277 main.log.info( "bgpIntentsExpected num is:" )
278 main.log.info( bgpIntentsExpectedNum )
279 main.log.info( "bgpIntentsActual num is:" )
280 main.log.info( bgpIntentsActualNum )
281 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800282 expect=True,
283 actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
284 onpass="PointToPointIntent Intent Num is correct!",
285 onfail="PointToPointIntent Intent Num is wrong!" )
pingping-lin0ce60622015-09-10 14:37:33 -0700286
287
288 def CASE3( self, main ):
289 '''
290 routes and intents check to all BGP peers
291 '''
Jon Hall6e9897d2016-02-29 14:41:32 -0800292 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700293 main.case( "Check routes and M2S intents to all BGP peers" )
pingping-lin0ce60622015-09-10 14:37:33 -0700294
pingping-lin28e7b212015-09-10 10:14:58 -0700295 allRoutesExpected = []
296 allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
297 allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
298 allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
299
Jon Hall6e9897d2016-02-29 14:41:32 -0800300 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-lin28e7b212015-09-10 10:14:58 -0700301 allRoutesActual = \
302 main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
303 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
304 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800305 if allRoutesStrActual != allRoutesStrExpected:
306 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700307 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800308 allRoutesActual = \
309 main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
310 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
pingping-lin28e7b212015-09-10 10:14:58 -0700311
312 main.step( "Check routes installed" )
313 main.log.info( "Routes expected:" )
314 main.log.info( allRoutesStrExpected )
315 main.log.info( "Routes get from ONOS CLI:" )
316 main.log.info( allRoutesStrActual )
317 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800318 expect=allRoutesStrExpected, actual=allRoutesStrActual,
319 onpass="Routes are correct!",
320 onfail="Routes are wrong!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700321
pingping-linb3ebd3f2015-09-28 22:17:05 -0700322 main.step( "Check M2S intents installed" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800323 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin28e7b212015-09-10 10:14:58 -0700324 routeIntentsActualNum = \
325 main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
326 routeIntentsExpectedNum = 3
Jon Hall6e9897d2016-02-29 14:41:32 -0800327 if routeIntentsActualNum != routeIntentsExpectedNum:
328 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700329 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800330 routeIntentsActualNum = \
331 main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
pingping-lin28e7b212015-09-10 10:14:58 -0700332
333 main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
334 main.log.info( routeIntentsExpectedNum )
335 main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
336 main.log.info( routeIntentsActualNum )
337 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800338 expect=routeIntentsExpectedNum,
339 actual=routeIntentsActualNum,
340 onpass="MultiPointToSinglePoint Intent Num is correct!",
341 onfail="MultiPointToSinglePoint Intent Num is wrong!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700342
pingping-linbab7f8a2015-09-21 17:33:36 -0700343 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700344 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800345 main.FALSE,
346 kwargs={'isPENDING':False},
347 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700348 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800349 expect=main.TRUE,
350 actual=flowCheck,
351 onpass="Flow status is correct!",
352 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700353
pingping-lin950b50d2015-09-14 12:00:08 -0700354
355 def CASE4( self, main ):
356 '''
357 Ping test in data plane for each route
358 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700359 main.case( "Ping test for each route, all hosts behind BGP peers" )
pingping-lin829428d2015-09-22 20:50:00 -0700360 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800361 hosts=["host64514", "host64515", "host64516"],
362 expectAllSuccess=True )
pingping-lin4f80c492015-09-15 14:34:42 -0700363
364
365 def CASE5( self, main ):
366 '''
367 Cut links to peers one by one, check routes/intents
368 '''
369 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700370 main.case( "Bring down links and check routes/intents" )
pingping-lin4f80c492015-09-15 14:34:42 -0700371 main.step( "Bring down the link between sw32 and peer64514" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800372 linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
373 OPTION="down" )
374 utilities.assertEquals( expect=main.TRUE,
375 actual=linkResult1,
376 onpass="Bring down link succeeded!",
377 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700378
379 if linkResult1 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700380 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
381 main.Functions.checkRouteNum( main, 2 )
382 main.Functions.checkM2SintentNum( main, 2 )
383 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800384 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700385 main.cleanup()
386 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700387
388 main.step( "Bring down the link between sw8 and peer64515" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800389 linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
390 OPTION="down" )
391 utilities.assertEquals( expect=main.TRUE,
392 actual=linkResult2,
393 onpass="Bring down link succeeded!",
394 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700395 if linkResult2 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700396 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
397 main.Functions.checkRouteNum( main, 1 )
398 main.Functions.checkM2SintentNum( main, 1 )
399 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800400 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700401 main.cleanup()
402 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700403
404 main.step( "Bring down the link between sw28 and peer64516" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800405 linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
406 OPTION="down" )
407 utilities.assertEquals( expect=main.TRUE,
408 actual=linkResult3,
409 onpass="Bring down link succeeded!",
410 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700411 if linkResult3 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700412 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
413 main.Functions.checkRouteNum( main, 0 )
414 main.Functions.checkM2SintentNum( main, 0 )
415 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800416 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700417 main.cleanup()
418 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700419
pingping-linbab7f8a2015-09-21 17:33:36 -0700420 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700421 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800422 main.FALSE,
423 kwargs={'isPENDING':False},
424 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700425 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800426 expect=main.TRUE,
427 actual=flowCheck,
428 onpass="Flow status is correct!",
429 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700430
pingping-lin829428d2015-09-22 20:50:00 -0700431 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800432 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
433 peers=["peer64514", "peer64515", "peer64516"],
434 expectAllSuccess=False )
pingping-lin829428d2015-09-22 20:50:00 -0700435 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800436 hosts=["host64514", "host64515", "host64516"],
437 expectAllSuccess=False )
pingping-lin4f80c492015-09-15 14:34:42 -0700438
pingping-lin829428d2015-09-22 20:50:00 -0700439
440 def CASE6( self, main ):
pingping-lin4f80c492015-09-15 14:34:42 -0700441 '''
442 Recover links to peers one by one, check routes/intents
443 '''
444 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700445 main.case( "Bring up links and check routes/intents" )
pingping-lin4f80c492015-09-15 14:34:42 -0700446 main.step( "Bring up the link between sw32 and peer64514" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800447 linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
448 OPTION="up" )
449 utilities.assertEquals( expect=main.TRUE,
450 actual=linkResult1,
451 onpass="Bring up link succeeded!",
452 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700453 if linkResult1 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700454 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
455 main.Functions.checkRouteNum( main, 1 )
456 main.Functions.checkM2SintentNum( main, 1 )
457 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800458 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700459 main.cleanup()
460 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700461
462 main.step( "Bring up the link between sw8 and peer64515" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800463 linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
464 OPTION="up" )
465 utilities.assertEquals( expect=main.TRUE,
466 actual=linkResult2,
467 onpass="Bring up link succeeded!",
468 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700469 if linkResult2 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700470 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
471 main.Functions.checkRouteNum( main, 2 )
472 main.Functions.checkM2SintentNum( main, 2 )
473 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800474 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700475 main.cleanup()
476 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700477
478 main.step( "Bring up the link between sw28 and peer64516" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800479 linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
480 OPTION="up" )
481 utilities.assertEquals( expect=main.TRUE,
482 actual=linkResult3,
483 onpass="Bring up link succeeded!",
484 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700485 if linkResult3 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700486 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
487 main.Functions.checkRouteNum( main, 3 )
488 main.Functions.checkM2SintentNum( main, 3 )
489 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800490 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700491 main.cleanup()
492 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700493
494 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700495 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800496 main.FALSE,
497 kwargs={'isPENDING':False},
498 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700499 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800500 expect=main.TRUE,
501 actual=flowCheck,
502 onpass="Flow status is correct!",
503 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700504
505 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800506 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
507 peers=["peer64514", "peer64515", "peer64516"],
508 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700509 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800510 hosts=["host64514", "host64515", "host64516"],
511 expectAllSuccess=True )
pingping-lin8244a3b2015-09-16 13:36:56 -0700512
513
pingping-lin829428d2015-09-22 20:50:00 -0700514 def CASE7( self, main ):
pingping-lin8244a3b2015-09-16 13:36:56 -0700515 '''
pingping-lin829428d2015-09-22 20:50:00 -0700516 Shut down a edge switch, check P-2-P and M-2-S intents, ping test
pingping-lin8244a3b2015-09-16 13:36:56 -0700517 '''
518 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700519 main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
pingping-lin8244a3b2015-09-16 13:36:56 -0700520 main.step( "Stop sw32" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800521 result = main.Mininet.switch( SW="sw32", OPTION="stop" )
522 utilities.assertEquals( expect=main.TRUE, actual=result,
523 onpass="Stopping switch succeeded!",
524 onfail="Stopping switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700525
pingping-lin8244a3b2015-09-16 13:36:56 -0700526 if result == main.TRUE:
527 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
528 main.Functions.checkRouteNum( main, 2 )
529 main.Functions.checkM2SintentNum( main, 2 )
530 main.Functions.checkP2PintentNum( main, 12 )
531 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800532 main.log.error( "Stopping switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700533 main.cleanup()
534 main.exit()
pingping-lin8244a3b2015-09-16 13:36:56 -0700535
pingping-lin829428d2015-09-22 20:50:00 -0700536 main.step( "Check ping between hosts behind BGP peers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800537 result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
538 result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
539 result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
pingping-lin829428d2015-09-22 20:50:00 -0700540
541 pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
542 and ( result3 == main.FALSE )
Jon Hall6e9897d2016-02-29 14:41:32 -0800543 utilities.assert_equals( expect=True, actual=pingResult1,
544 onpass="Ping test result is correct",
545 onfail="Ping test result is wrong" )
pingping-lin829428d2015-09-22 20:50:00 -0700546
547 if pingResult1 == False:
548 main.cleanup()
549 main.exit()
550
551 main.step( "Check ping between BGP peers and speakers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800552 result4 = main.Mininet.pingHost( src="speaker1", target="peer64514" )
553 result5 = main.Mininet.pingHost( src="speaker1", target="peer64515" )
554 result6 = main.Mininet.pingHost( src="speaker1", target="peer64516" )
pingping-lin829428d2015-09-22 20:50:00 -0700555
556 pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
557 and ( result6 == main.TRUE )
Jon Hall6e9897d2016-02-29 14:41:32 -0800558 utilities.assert_equals( expect=True, actual=pingResult2,
559 onpass="Speaker1 ping peers successful",
560 onfail="Speaker1 ping peers NOT successful" )
pingping-lin829428d2015-09-22 20:50:00 -0700561
562 if pingResult2 == False:
563 main.cleanup()
564 main.exit()
565
pingping-linbab7f8a2015-09-21 17:33:36 -0700566 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700567 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800568 main.FALSE,
569 kwargs={'isPENDING':False},
570 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700571 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800572 expect=main.TRUE,
573 actual=flowCheck,
574 onpass="Flow status is correct!",
575 onfail="Flow status is wrong!" )
pingping-lin8244a3b2015-09-16 13:36:56 -0700576
pingping-lind791d342015-09-17 18:34:31 -0700577
pingping-lin8244a3b2015-09-16 13:36:56 -0700578 def CASE8( self, main ):
pingping-lind791d342015-09-17 18:34:31 -0700579 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700580 Bring up the edge switch (sw32) which was shut down in CASE7,
pingping-lind791d342015-09-17 18:34:31 -0700581 check P-2-P and M-2-S intents, ping test
582 '''
583 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700584 main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
pingping-lind791d342015-09-17 18:34:31 -0700585 main.step( "Start sw32" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800586 result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700587 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800588 expect=main.TRUE,
589 actual=result1,
590 onpass="Starting switch succeeded!",
591 onfail="Starting switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700592
pingping-lind791d342015-09-17 18:34:31 -0700593 result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700594 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800595 expect=main.TRUE,
596 actual=result2,
597 onpass="Connect switch to ONOS succeeded!",
598 onfail="Connect switch to ONOS failed!" )
pingping-lind791d342015-09-17 18:34:31 -0700599
600 if result1 and result2:
601 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
602 main.Functions.checkRouteNum( main, 3 )
603 main.Functions.checkM2SintentNum( main, 3 )
604 main.Functions.checkP2PintentNum( main, 18 )
605 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800606 main.log.error( "Starting switch failed!" )
pingping-lind791d342015-09-17 18:34:31 -0700607 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700608 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700609
pingping-linbab7f8a2015-09-21 17:33:36 -0700610 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700611 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800612 main.FALSE,
613 kwargs={'isPENDING':False},
614 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700615 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800616 expect=main.TRUE,
617 actual=flowCheck,
618 onpass="Flow status is correct!",
619 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700620
pingping-lin829428d2015-09-22 20:50:00 -0700621 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800622 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
623 peers=["peer64514", "peer64515", "peer64516"],
624 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700625 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800626 hosts=["host64514", "host64515", "host64516"],
627 expectAllSuccess=True )
pingping-linbab7f8a2015-09-21 17:33:36 -0700628
pingping-lin829428d2015-09-22 20:50:00 -0700629
630 def CASE9( self, main ):
pingping-linbab7f8a2015-09-21 17:33:36 -0700631 '''
632 Bring down a switch in best path, check:
633 route number, P2P intent number, M2S intent number, ping test
634 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700635 main.case( "Stop sw11 located in best path, \
pingping-linbab7f8a2015-09-21 17:33:36 -0700636 check route number, P2P intent number, M2S intent number, ping test" )
637
pingping-lin581a3662015-09-29 17:43:39 -0700638 main.log.info( "Check the flow number correctness before stopping sw11" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700639 main.Functions.checkFlowNum( main, "sw11", 13 )
640 main.Functions.checkFlowNum( main, "sw1", 3 )
641 main.Functions.checkFlowNum( main, "sw7", 3 )
Jon Hall6e9897d2016-02-29 14:41:32 -0800642 main.log.debug( main.Mininet.checkFlows( "sw11" ) )
643 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
644 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700645
646 main.step( "Stop sw11" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800647 result = main.Mininet.switch( SW="sw11", OPTION="stop" )
648 utilities.assertEquals( expect=main.TRUE, actual=result,
649 onpass="Stopping switch succeeded!",
650 onfail="Stopping switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700651 if result:
652 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700653 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700654 main.Functions.checkRouteNum( main, 3 )
655 main.Functions.checkM2SintentNum( main, 3 )
656 main.Functions.checkP2PintentNum( main, 18 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700657 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800658 main.log.error( "Stopping switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700659 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700660 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700661
662 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700663 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800664 main.FALSE,
665 kwargs={'isPENDING':False},
666 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700667 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800668 expect=main.TRUE,
669 actual=flowCheck,
670 onpass="Flow status is correct!",
671 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700672 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800673 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
674 peers=["peer64514", "peer64515", "peer64516"],
675 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700676 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800677 hosts=["host64514", "host64515", "host64516"],
678 expectAllSuccess=True )
pingping-linbab7f8a2015-09-21 17:33:36 -0700679
680
681 def CASE10( self, main ):
682 '''
683 Bring up the switch which was stopped in CASE9, check:
684 route number, P2P intent number, M2S intent number, ping test
685 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700686 main.case( "Start sw11 which was stopped in CASE9, \
pingping-linbab7f8a2015-09-21 17:33:36 -0700687 check route number, P2P intent number, M2S intent number, ping test" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700688
pingping-lin581a3662015-09-29 17:43:39 -0700689 main.log.info( "Check the flow status before starting sw11" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700690 main.Functions.checkFlowNum( main, "sw1", 11 )
691 main.Functions.checkFlowNum( main, "sw7", 5 )
Jon Hall6e9897d2016-02-29 14:41:32 -0800692 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
693 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700694
pingping-linbab7f8a2015-09-21 17:33:36 -0700695 main.step( "Start sw11" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800696 result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
697 utilities.assertEquals( expect=main.TRUE, actual=result1,
698 onpass="Starting switch succeeded!",
699 onfail="Starting switch failed!" )
pingping-lin0351dee2015-09-28 13:26:35 -0700700 result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
Jon Hall6e9897d2016-02-29 14:41:32 -0800701 utilities.assertEquals( expect=main.TRUE, actual=result2,
702 onpass="Connect switch to ONOS succeeded!",
703 onfail="Connect switch to ONOS failed!" )
pingping-lin0351dee2015-09-28 13:26:35 -0700704 if result1 and result2:
pingping-linbab7f8a2015-09-21 17:33:36 -0700705 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
706 main.Functions.checkRouteNum( main, 3 )
707 main.Functions.checkM2SintentNum( main, 3 )
708 main.Functions.checkP2PintentNum( main, 18 )
709
pingping-lin3f091d62015-09-29 12:00:05 -0700710 main.log.debug( main.Mininet.checkFlows( "sw11" ) )
711 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
712 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700713 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800714 main.log.error( "Starting switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700715 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700716 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700717
718 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700719 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800720 main.FALSE,
721 kwargs={'isPENDING':False},
722 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700723 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800724 expect=main.TRUE,
725 actual=flowCheck,
726 onpass="Flow status is correct!",
727 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700728 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800729 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
730 peers=["peer64514", "peer64515", "peer64516"],
731 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700732 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800733 hosts=["host64514", "host64515", "host64516"],
734 expectAllSuccess=True )