blob: f1ace78d7e95a7b8365ac6ab59054e9ccd08c984 [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 Hallbd60ea02016-08-23 10:03:59 -0700149 packageResult = main.ONOSbench.buckBuild()
Jon Hall6e9897d2016-02-29 14:41:32 -0800150 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
Chiyu Chengef109502016-11-21 15:51:38 -0800170 main.step( "Set up ONOS secure SSH" )
171 secureSshResult = main.ONOSbench.onosSecureSSH( node=ONOS1Ip )
172 utilities.assert_equals( expect=main.TRUE,
173 actual=secureSshResult,
174 onpass="Set up ONOS secure SSH succeeded",
175 onfail="Set up ONOS secure SSH failed " )
176
pingping-linb3ebd3f2015-09-28 22:17:05 -0700177 main.step( "Checking if ONOS CLI is ready" )
pingping-lin28e7b212015-09-10 10:14:58 -0700178 cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
Jon Hall6e9897d2016-02-29 14:41:32 -0800179 commandlineTimeout=100, onosStartTimeout=600 )
180 utilities.assert_equals( expect=main.TRUE,
181 actual=cliResult,
182 onpass="ONOS CLI is ready",
183 onfail="ONOS CLI is not ready" )
pingping-lin28e7b212015-09-10 10:14:58 -0700184
Jon Hall6e9897d2016-02-29 14:41:32 -0800185 for i in range( 10 ):
186 ready = True
187 output = main.ONOScli.summary()
188 if not output:
189 ready = False
190 if ready:
191 break
192 time.sleep( 30 )
193 utilities.assert_equals( expect=True, actual=ready,
194 onpass="ONOS summary command succeded",
195 onfail="ONOS summary command failed" )
pingping-lin28e7b212015-09-10 10:14:58 -0700196
Jon Hall6e9897d2016-02-29 14:41:32 -0800197 if not ready:
198 main.log.error( "ONOS startup failed!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700199 main.cleanup()
200 main.exit()
201
Jon Hall6e9897d2016-02-29 14:41:32 -0800202 def CASE200( self, main ):
203 main.case( "Activate sdn-ip application" )
204 main.log.info( "waiting link discovery......" )
205 time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
206
pingping-linb3ebd3f2015-09-28 22:17:05 -0700207 main.log.info( "Get links in the network" )
pingping-lin3f091d62015-09-29 12:00:05 -0700208 summaryResult = main.ONOScli.summary()
209 linkNum = json.loads( summaryResult )[ "links" ]
Jon Hall6e9897d2016-02-29 14:41:32 -0800210 listResult = main.ONOScli.links( jsonFormat=False )
211 main.log.info( listResult )
pingping-lin3f091d62015-09-29 12:00:05 -0700212 if linkNum < 100:
Jon Hall6e9897d2016-02-29 14:41:32 -0800213 main.log.error( "Link number is wrong!" )
214 time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
215 listResult = main.ONOScli.links( jsonFormat=False )
pingping-lin3f091d62015-09-29 12:00:05 -0700216 main.log.info( listResult )
217 main.cleanup()
218 main.exit()
219
pingping-linb3ebd3f2015-09-28 22:17:05 -0700220 main.step( "Activate sdn-ip application" )
221 activeSDNIPresult = main.ONOScli.activateApp( "org.onosproject.sdnip" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800222 utilities.assert_equals( expect=main.TRUE,
223 actual=activeSDNIPresult,
224 onpass="Activate SDN-IP succeeded",
225 onfail="Activate SDN-IP failed" )
pingping-lin3f091d62015-09-29 12:00:05 -0700226 if not activeSDNIPresult:
227 main.log.info( "Activate SDN-IP failed!" )
228 main.cleanup()
229 main.exit()
230
pingping-linb3ebd3f2015-09-28 22:17:05 -0700231
232 main.log.info( "Wait SDN-IP to finish installing connectivity intents \
pingping-linb702c602015-09-10 17:00:29 -0700233 and the BGP paths in data plane are ready..." )
pingping-lin28e7b212015-09-10 10:14:58 -0700234 time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) )
pingping-linb702c602015-09-10 17:00:29 -0700235 main.log.info( "Wait Quagga to finish delivery all routes to each \
236 other and to sdn-ip, plus finish installing all intents..." )
pingping-lin28e7b212015-09-10 10:14:58 -0700237 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
238 time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
239
240
pingping-lin4f80c492015-09-15 14:34:42 -0700241 def CASE102( self, main ):
242 '''
243 This test case is to load the methods from other Python files.
244 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700245 main.case( "Loading methods from other Python file" )
pingping-lin4f80c492015-09-15 14:34:42 -0700246 # load the methods from other file
247 wrapperFile = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
248 main.Functions = imp.load_source( wrapperFile,
249 main.dependencyPath +
250 wrapperFile +
251 ".py" )
252
253
pingping-lin0ce60622015-09-10 14:37:33 -0700254 def CASE1( self, main ):
255 '''
256 ping test from 3 bgp peers to BGP speaker
257 '''
pingping-lin950b50d2015-09-14 12:00:08 -0700258
pingping-linb3ebd3f2015-09-28 22:17:05 -0700259 main.case( "Ping tests between BGP peers and speakers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800260 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
261 peers=["peer64514", "peer64515", "peer64516"],
262 expectAllSuccess=True )
pingping-lin0ce60622015-09-10 14:37:33 -0700263
pingping-lin950b50d2015-09-14 12:00:08 -0700264
pingping-lin0ce60622015-09-10 14:37:33 -0700265 def CASE2( self, main ):
266 '''
267 point-to-point intents test for each BGP peer and BGP speaker pair
268 '''
Jon Hall6e9897d2016-02-29 14:41:32 -0800269 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700270 main.case( "Check point-to-point intents" )
pingping-lin0ce60622015-09-10 14:37:33 -0700271 main.log.info( "There are %s BGP peers in total "
272 % main.params[ 'config' ][ 'peerNum' ] )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700273 main.step( "Check P2P intents number from ONOS CLI" )
pingping-lin0ce60622015-09-10 14:37:33 -0700274
Jon Hall6e9897d2016-02-29 14:41:32 -0800275 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin0ce60622015-09-10 14:37:33 -0700276 bgpIntentsActualNum = \
277 main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
278 bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
Jon Hall6e9897d2016-02-29 14:41:32 -0800279 if bgpIntentsActualNum != bgpIntentsExpectedNum:
280 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700281 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800282 bgpIntentsActualNum = \
283 main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
pingping-lin0ce60622015-09-10 14:37:33 -0700284 main.log.info( "bgpIntentsExpected num is:" )
285 main.log.info( bgpIntentsExpectedNum )
286 main.log.info( "bgpIntentsActual num is:" )
287 main.log.info( bgpIntentsActualNum )
288 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800289 expect=True,
290 actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
291 onpass="PointToPointIntent Intent Num is correct!",
292 onfail="PointToPointIntent Intent Num is wrong!" )
pingping-lin0ce60622015-09-10 14:37:33 -0700293
294
295 def CASE3( self, main ):
296 '''
297 routes and intents check to all BGP peers
298 '''
Jon Hall6e9897d2016-02-29 14:41:32 -0800299 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700300 main.case( "Check routes and M2S intents to all BGP peers" )
pingping-lin0ce60622015-09-10 14:37:33 -0700301
pingping-lin28e7b212015-09-10 10:14:58 -0700302 allRoutesExpected = []
303 allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
304 allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )
305 allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" )
306
Jon Hall6e9897d2016-02-29 14:41:32 -0800307 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
pingping-lin28e7b212015-09-10 10:14:58 -0700308 allRoutesActual = \
309 main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
310 allRoutesStrExpected = str( sorted( allRoutesExpected ) )
311 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800312 if allRoutesStrActual != allRoutesStrExpected:
313 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700314 getRoutesResult = main.ONOScli.routes( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800315 allRoutesActual = \
316 main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
317 allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
pingping-lin28e7b212015-09-10 10:14:58 -0700318
319 main.step( "Check routes installed" )
320 main.log.info( "Routes expected:" )
321 main.log.info( allRoutesStrExpected )
322 main.log.info( "Routes get from ONOS CLI:" )
323 main.log.info( allRoutesStrActual )
324 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800325 expect=allRoutesStrExpected, actual=allRoutesStrActual,
326 onpass="Routes are correct!",
327 onfail="Routes are wrong!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700328
pingping-linb3ebd3f2015-09-28 22:17:05 -0700329 main.step( "Check M2S intents installed" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800330 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
pingping-lin28e7b212015-09-10 10:14:58 -0700331 routeIntentsActualNum = \
332 main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
333 routeIntentsExpectedNum = 3
Jon Hall6e9897d2016-02-29 14:41:32 -0800334 if routeIntentsActualNum != routeIntentsExpectedNum:
335 time.sleep( int( main.params['timers']['RouteDelivery'] ) )
Jon Hallfabd7e52016-04-19 19:20:59 -0700336 getIntentsResult = main.ONOScli.intents( jsonFormat=True )
Jon Hall6e9897d2016-02-29 14:41:32 -0800337 routeIntentsActualNum = \
338 main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
pingping-lin28e7b212015-09-10 10:14:58 -0700339
340 main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
341 main.log.info( routeIntentsExpectedNum )
342 main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
343 main.log.info( routeIntentsActualNum )
344 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800345 expect=routeIntentsExpectedNum,
346 actual=routeIntentsActualNum,
347 onpass="MultiPointToSinglePoint Intent Num is correct!",
348 onfail="MultiPointToSinglePoint Intent Num is wrong!" )
pingping-lin28e7b212015-09-10 10:14:58 -0700349
pingping-linbab7f8a2015-09-21 17:33:36 -0700350 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700351 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800352 main.FALSE,
353 kwargs={'isPENDING':False},
354 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700355 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800356 expect=main.TRUE,
357 actual=flowCheck,
358 onpass="Flow status is correct!",
359 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700360
pingping-lin950b50d2015-09-14 12:00:08 -0700361
362 def CASE4( self, main ):
363 '''
364 Ping test in data plane for each route
365 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700366 main.case( "Ping test for each route, all hosts behind BGP peers" )
pingping-lin829428d2015-09-22 20:50:00 -0700367 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800368 hosts=["host64514", "host64515", "host64516"],
369 expectAllSuccess=True )
pingping-lin4f80c492015-09-15 14:34:42 -0700370
371
372 def CASE5( self, main ):
373 '''
374 Cut links to peers one by one, check routes/intents
375 '''
376 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700377 main.case( "Bring down links and check routes/intents" )
pingping-lin4f80c492015-09-15 14:34:42 -0700378 main.step( "Bring down the link between sw32 and peer64514" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800379 linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
380 OPTION="down" )
381 utilities.assertEquals( expect=main.TRUE,
382 actual=linkResult1,
383 onpass="Bring down link succeeded!",
384 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700385
386 if linkResult1 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700387 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
388 main.Functions.checkRouteNum( main, 2 )
389 main.Functions.checkM2SintentNum( main, 2 )
390 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800391 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700392 main.cleanup()
393 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700394
395 main.step( "Bring down the link between sw8 and peer64515" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800396 linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
397 OPTION="down" )
398 utilities.assertEquals( expect=main.TRUE,
399 actual=linkResult2,
400 onpass="Bring down link succeeded!",
401 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700402 if linkResult2 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700403 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
404 main.Functions.checkRouteNum( main, 1 )
405 main.Functions.checkM2SintentNum( main, 1 )
406 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800407 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700408 main.cleanup()
409 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700410
411 main.step( "Bring down the link between sw28 and peer64516" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800412 linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
413 OPTION="down" )
414 utilities.assertEquals( expect=main.TRUE,
415 actual=linkResult3,
416 onpass="Bring down link succeeded!",
417 onfail="Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700418 if linkResult3 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700419 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
420 main.Functions.checkRouteNum( main, 0 )
421 main.Functions.checkM2SintentNum( main, 0 )
422 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800423 main.log.error( "Bring down link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700424 main.cleanup()
425 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700426
pingping-linbab7f8a2015-09-21 17:33:36 -0700427 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700428 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800429 main.FALSE,
430 kwargs={'isPENDING':False},
431 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700432 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800433 expect=main.TRUE,
434 actual=flowCheck,
435 onpass="Flow status is correct!",
436 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700437
pingping-lin829428d2015-09-22 20:50:00 -0700438 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800439 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
440 peers=["peer64514", "peer64515", "peer64516"],
441 expectAllSuccess=False )
pingping-lin829428d2015-09-22 20:50:00 -0700442 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800443 hosts=["host64514", "host64515", "host64516"],
444 expectAllSuccess=False )
pingping-lin4f80c492015-09-15 14:34:42 -0700445
pingping-lin829428d2015-09-22 20:50:00 -0700446
447 def CASE6( self, main ):
pingping-lin4f80c492015-09-15 14:34:42 -0700448 '''
449 Recover links to peers one by one, check routes/intents
450 '''
451 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700452 main.case( "Bring up links and check routes/intents" )
pingping-lin4f80c492015-09-15 14:34:42 -0700453 main.step( "Bring up the link between sw32 and peer64514" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800454 linkResult1 = main.Mininet.link( END1="sw32", END2="peer64514",
455 OPTION="up" )
456 utilities.assertEquals( expect=main.TRUE,
457 actual=linkResult1,
458 onpass="Bring up link succeeded!",
459 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700460 if linkResult1 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700461 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
462 main.Functions.checkRouteNum( main, 1 )
463 main.Functions.checkM2SintentNum( main, 1 )
464 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800465 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700466 main.cleanup()
467 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700468
469 main.step( "Bring up the link between sw8 and peer64515" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800470 linkResult2 = main.Mininet.link( END1="sw8", END2="peer64515",
471 OPTION="up" )
472 utilities.assertEquals( expect=main.TRUE,
473 actual=linkResult2,
474 onpass="Bring up link succeeded!",
475 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700476 if linkResult2 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700477 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
478 main.Functions.checkRouteNum( main, 2 )
479 main.Functions.checkM2SintentNum( main, 2 )
480 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800481 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700482 main.cleanup()
483 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700484
485 main.step( "Bring up the link between sw28 and peer64516" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800486 linkResult3 = main.Mininet.link( END1="sw28", END2="peer64516",
487 OPTION="up" )
488 utilities.assertEquals( expect=main.TRUE,
489 actual=linkResult3,
490 onpass="Bring up link succeeded!",
491 onfail="Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700492 if linkResult3 == main.TRUE:
pingping-lin4f80c492015-09-15 14:34:42 -0700493 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
494 main.Functions.checkRouteNum( main, 3 )
495 main.Functions.checkM2SintentNum( main, 3 )
496 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800497 main.log.error( "Bring up link failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700498 main.cleanup()
499 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700500
501 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700502 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800503 main.FALSE,
504 kwargs={'isPENDING':False},
505 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700506 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800507 expect=main.TRUE,
508 actual=flowCheck,
509 onpass="Flow status is correct!",
510 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700511
512 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800513 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
514 peers=["peer64514", "peer64515", "peer64516"],
515 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700516 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800517 hosts=["host64514", "host64515", "host64516"],
518 expectAllSuccess=True )
pingping-lin8244a3b2015-09-16 13:36:56 -0700519
520
pingping-lin829428d2015-09-22 20:50:00 -0700521 def CASE7( self, main ):
pingping-lin8244a3b2015-09-16 13:36:56 -0700522 '''
pingping-lin829428d2015-09-22 20:50:00 -0700523 Shut down a edge switch, check P-2-P and M-2-S intents, ping test
pingping-lin8244a3b2015-09-16 13:36:56 -0700524 '''
525 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700526 main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
pingping-lin8244a3b2015-09-16 13:36:56 -0700527 main.step( "Stop sw32" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800528 result = main.Mininet.switch( SW="sw32", OPTION="stop" )
529 utilities.assertEquals( expect=main.TRUE, actual=result,
530 onpass="Stopping switch succeeded!",
531 onfail="Stopping switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700532
pingping-lin8244a3b2015-09-16 13:36:56 -0700533 if result == main.TRUE:
534 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
535 main.Functions.checkRouteNum( main, 2 )
536 main.Functions.checkM2SintentNum( main, 2 )
537 main.Functions.checkP2PintentNum( main, 12 )
538 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800539 main.log.error( "Stopping switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700540 main.cleanup()
541 main.exit()
pingping-lin8244a3b2015-09-16 13:36:56 -0700542
pingping-lin829428d2015-09-22 20:50:00 -0700543 main.step( "Check ping between hosts behind BGP peers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800544 result1 = main.Mininet.pingHost( src="host64514", target="host64515" )
545 result2 = main.Mininet.pingHost( src="host64515", target="host64516" )
546 result3 = main.Mininet.pingHost( src="host64514", target="host64516" )
pingping-lin829428d2015-09-22 20:50:00 -0700547
548 pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \
549 and ( result3 == main.FALSE )
Jon Hall6e9897d2016-02-29 14:41:32 -0800550 utilities.assert_equals( expect=True, actual=pingResult1,
551 onpass="Ping test result is correct",
552 onfail="Ping test result is wrong" )
pingping-lin829428d2015-09-22 20:50:00 -0700553
554 if pingResult1 == False:
555 main.cleanup()
556 main.exit()
557
558 main.step( "Check ping between BGP peers and speakers" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800559 result4 = main.Mininet.pingHost( src="speaker1", target="peer64514" )
560 result5 = main.Mininet.pingHost( src="speaker1", target="peer64515" )
561 result6 = main.Mininet.pingHost( src="speaker1", target="peer64516" )
pingping-lin829428d2015-09-22 20:50:00 -0700562
563 pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \
564 and ( result6 == main.TRUE )
Jon Hall6e9897d2016-02-29 14:41:32 -0800565 utilities.assert_equals( expect=True, actual=pingResult2,
566 onpass="Speaker1 ping peers successful",
567 onfail="Speaker1 ping peers NOT successful" )
pingping-lin829428d2015-09-22 20:50:00 -0700568
569 if pingResult2 == False:
570 main.cleanup()
571 main.exit()
572
pingping-linbab7f8a2015-09-21 17:33:36 -0700573 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700574 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800575 main.FALSE,
576 kwargs={'isPENDING':False},
577 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700578 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800579 expect=main.TRUE,
580 actual=flowCheck,
581 onpass="Flow status is correct!",
582 onfail="Flow status is wrong!" )
pingping-lin8244a3b2015-09-16 13:36:56 -0700583
pingping-lind791d342015-09-17 18:34:31 -0700584
pingping-lin8244a3b2015-09-16 13:36:56 -0700585 def CASE8( self, main ):
pingping-lind791d342015-09-17 18:34:31 -0700586 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700587 Bring up the edge switch (sw32) which was shut down in CASE7,
pingping-lind791d342015-09-17 18:34:31 -0700588 check P-2-P and M-2-S intents, ping test
589 '''
590 import time
pingping-linb3ebd3f2015-09-28 22:17:05 -0700591 main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
pingping-lind791d342015-09-17 18:34:31 -0700592 main.step( "Start sw32" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800593 result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700594 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800595 expect=main.TRUE,
596 actual=result1,
597 onpass="Starting switch succeeded!",
598 onfail="Starting switch failed!" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700599
pingping-lind791d342015-09-17 18:34:31 -0700600 result2 = main.Mininet.assignSwController( "sw32", ONOS1Ip )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700601 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800602 expect=main.TRUE,
603 actual=result2,
604 onpass="Connect switch to ONOS succeeded!",
605 onfail="Connect switch to ONOS failed!" )
pingping-lind791d342015-09-17 18:34:31 -0700606
607 if result1 and result2:
608 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
609 main.Functions.checkRouteNum( main, 3 )
610 main.Functions.checkM2SintentNum( main, 3 )
611 main.Functions.checkP2PintentNum( main, 18 )
612 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800613 main.log.error( "Starting switch failed!" )
pingping-lind791d342015-09-17 18:34:31 -0700614 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700615 main.exit()
pingping-lin4f80c492015-09-15 14:34:42 -0700616
pingping-linbab7f8a2015-09-21 17:33:36 -0700617 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700618 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800619 main.FALSE,
620 kwargs={'isPENDING':False},
621 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700622 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800623 expect=main.TRUE,
624 actual=flowCheck,
625 onpass="Flow status is correct!",
626 onfail="Flow status is wrong!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700627
pingping-lin829428d2015-09-22 20:50:00 -0700628 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800629 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
630 peers=["peer64514", "peer64515", "peer64516"],
631 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700632 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800633 hosts=["host64514", "host64515", "host64516"],
634 expectAllSuccess=True )
pingping-linbab7f8a2015-09-21 17:33:36 -0700635
pingping-lin829428d2015-09-22 20:50:00 -0700636
637 def CASE9( self, main ):
pingping-linbab7f8a2015-09-21 17:33:36 -0700638 '''
639 Bring down a switch in best path, check:
640 route number, P2P intent number, M2S intent number, ping test
641 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700642 main.case( "Stop sw11 located in best path, \
pingping-linbab7f8a2015-09-21 17:33:36 -0700643 check route number, P2P intent number, M2S intent number, ping test" )
644
pingping-lin581a3662015-09-29 17:43:39 -0700645 main.log.info( "Check the flow number correctness before stopping sw11" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700646 main.Functions.checkFlowNum( main, "sw11", 13 )
647 main.Functions.checkFlowNum( main, "sw1", 3 )
648 main.Functions.checkFlowNum( main, "sw7", 3 )
Jon Hall6e9897d2016-02-29 14:41:32 -0800649 main.log.debug( main.Mininet.checkFlows( "sw11" ) )
650 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
651 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700652
653 main.step( "Stop sw11" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800654 result = main.Mininet.switch( SW="sw11", OPTION="stop" )
655 utilities.assertEquals( expect=main.TRUE, actual=result,
656 onpass="Stopping switch succeeded!",
657 onfail="Stopping switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700658 if result:
659 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700660 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700661 main.Functions.checkRouteNum( main, 3 )
662 main.Functions.checkM2SintentNum( main, 3 )
663 main.Functions.checkP2PintentNum( main, 18 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700664 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800665 main.log.error( "Stopping switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700666 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700667 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700668
669 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700670 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800671 main.FALSE,
672 kwargs={'isPENDING':False},
673 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700674 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800675 expect=main.TRUE,
676 actual=flowCheck,
677 onpass="Flow status is correct!",
678 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700679 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800680 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
681 peers=["peer64514", "peer64515", "peer64516"],
682 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700683 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800684 hosts=["host64514", "host64515", "host64516"],
685 expectAllSuccess=True )
pingping-linbab7f8a2015-09-21 17:33:36 -0700686
687
688 def CASE10( self, main ):
689 '''
690 Bring up the switch which was stopped in CASE9, check:
691 route number, P2P intent number, M2S intent number, ping test
692 '''
pingping-linb3ebd3f2015-09-28 22:17:05 -0700693 main.case( "Start sw11 which was stopped in CASE9, \
pingping-linbab7f8a2015-09-21 17:33:36 -0700694 check route number, P2P intent number, M2S intent number, ping test" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700695
pingping-lin581a3662015-09-29 17:43:39 -0700696 main.log.info( "Check the flow status before starting sw11" )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700697 main.Functions.checkFlowNum( main, "sw1", 11 )
698 main.Functions.checkFlowNum( main, "sw7", 5 )
Jon Hall6e9897d2016-02-29 14:41:32 -0800699 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
700 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linb3ebd3f2015-09-28 22:17:05 -0700701
pingping-linbab7f8a2015-09-21 17:33:36 -0700702 main.step( "Start sw11" )
Jon Hall6e9897d2016-02-29 14:41:32 -0800703 result1 = main.Mininet.switch( SW="sw11", OPTION="start" )
704 utilities.assertEquals( expect=main.TRUE, actual=result1,
705 onpass="Starting switch succeeded!",
706 onfail="Starting switch failed!" )
pingping-lin0351dee2015-09-28 13:26:35 -0700707 result2 = main.Mininet.assignSwController( "sw11", ONOS1Ip )
Jon Hall6e9897d2016-02-29 14:41:32 -0800708 utilities.assertEquals( expect=main.TRUE, actual=result2,
709 onpass="Connect switch to ONOS succeeded!",
710 onfail="Connect switch to ONOS failed!" )
pingping-lin0351dee2015-09-28 13:26:35 -0700711 if result1 and result2:
pingping-linbab7f8a2015-09-21 17:33:36 -0700712 time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
713 main.Functions.checkRouteNum( main, 3 )
714 main.Functions.checkM2SintentNum( main, 3 )
715 main.Functions.checkP2PintentNum( main, 18 )
716
pingping-lin3f091d62015-09-29 12:00:05 -0700717 main.log.debug( main.Mininet.checkFlows( "sw11" ) )
718 main.log.debug( main.Mininet.checkFlows( "sw1" ) )
719 main.log.debug( main.Mininet.checkFlows( "sw7" ) )
pingping-linbab7f8a2015-09-21 17:33:36 -0700720 else:
Jon Hall6e9897d2016-02-29 14:41:32 -0800721 main.log.error( "Starting switch failed!" )
pingping-linbab7f8a2015-09-21 17:33:36 -0700722 main.cleanup()
pingping-linb3ebd3f2015-09-28 22:17:05 -0700723 main.exit()
pingping-linbab7f8a2015-09-21 17:33:36 -0700724
725 main.step( "Check whether all flow status are ADDED" )
Jon Hall1aa05602016-04-05 10:25:39 -0700726 flowCheck = utilities.retry( main.ONOScli.checkFlowsState,
Jon Hall6e9897d2016-02-29 14:41:32 -0800727 main.FALSE,
728 kwargs={'isPENDING':False},
729 attempts=10 )
pingping-linbab7f8a2015-09-21 17:33:36 -0700730 utilities.assertEquals( \
Jon Hall6e9897d2016-02-29 14:41:32 -0800731 expect=main.TRUE,
732 actual=flowCheck,
733 onpass="Flow status is correct!",
734 onfail="Flow status is wrong!" )
pingping-lin829428d2015-09-22 20:50:00 -0700735 # Ping test
Jon Hall6e9897d2016-02-29 14:41:32 -0800736 main.Functions.pingSpeakerToPeer( main, speakers=["speaker1"],
737 peers=["peer64514", "peer64515", "peer64516"],
738 expectAllSuccess=True )
pingping-lin829428d2015-09-22 20:50:00 -0700739 main.Functions.pingHostToHost( main,
Jon Hall6e9897d2016-02-29 14:41:32 -0800740 hosts=["host64514", "host64515", "host64516"],
741 expectAllSuccess=True )