blob: 762f6fd2d490ce75817cea006e01a43c79f6defd [file] [log] [blame]
GlennRCb3202c52015-08-24 14:43:30 -07001
2# This is a performance scale intent that test onos to see how many intents can
3# be installed and rerouted using the null provider and mininet.
4
5class SCPFmaxIntents:
6
7 def __init__( self ):
8 self.default = ''
9
10 def CASE0( self, main ):
11 import time
12 import os
13 import imp
14
15 """
16 - Construct tests variables
17 - GIT ( optional )
18 - Checkout ONOS master branch
19 - Pull latest ONOS code
20 - Building ONOS ( optional )
21 - Install ONOS package
22 - Build ONOS package
GlennRCec6c7612015-08-31 14:52:10 -070023 - Set up cell
24 - Create cell file
25 - Set cell file
26 - Verify cell file
27 - Kill ONOS process
GlennRCb3202c52015-08-24 14:43:30 -070028 """
29
30 main.case( "Constructing test variables and building ONOS package" )
31 main.step( "Constructing test variables" )
32 stepResult = main.FALSE
33
34 # Test variables
35 main.testOnDirectory = os.path.dirname( os.getcwd ( ) )
36 main.dependencyPath = main.testOnDirectory + \
37 main.params['DEPENDENCY']['path']
38 main.cellName = main.params[ 'ENV' ][ 'cellName' ]
39 main.apps = main.params[ 'ENV' ][ 'cellApps' ]
40 gitBranch = main.params[ 'GIT' ][ 'branch' ]
41 main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
42 main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
43 main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
44 main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
45 main.timeout = int(main.params['SLEEP']['timeout'])
46 main.minIntents = int(main.params['TEST']['min_intents'])
GlennRC9882f352015-08-27 18:03:28 -070047 main.maxIntents = int(main.params['TEST']['max_intents'])
GlennRCb3202c52015-08-24 14:43:30 -070048 main.checkInterval = int(main.params['TEST']['check_interval'])
49 wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
50 wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
51 main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
52 main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
53 main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] )
54 main.rerouteSleep = int ( main.params['SLEEP']['reroute'] )
55 gitPull = main.params[ 'GIT' ][ 'pull' ]
56 main.batchSize = int(main.params['TEST']['batch_size'])
GlennRCd0e5ed22015-09-03 11:54:27 -070057 nic = main.params['DATABASE']['nic']
58 node = main.params['DATABASE']['node']
GlennRCb3202c52015-08-24 14:43:30 -070059 main.cellData = {} # for creating cell file
60 main.CLIs = []
61 main.ONOSip = []
62 main.maxNumBatch = 0
63
64 main.ONOSip = main.ONOSbench.getOnosIps()
65 main.log.info(main.ONOSip)
66
GlennRCec6c7612015-08-31 14:52:10 -070067 # main.scale[ 0 ] determines the current number of ONOS controller
68 main.numCtrls = int( main.scale[ 0 ] )
69
GlennRCb3202c52015-08-24 14:43:30 -070070 # Assigning ONOS cli handles to a list
71 for i in range( 1, main.maxNodes + 1 ):
72 main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
73
74 # -- INIT SECTION, ONLY RUNS ONCE -- #
75 main.startUp = imp.load_source( wrapperFile1,
76 main.dependencyPath +
77 wrapperFile1 +
78 ".py" )
79
80 main.intentFunctions = imp.load_source( wrapperFile2,
81 main.dependencyPath +
82 wrapperFile2 +
83 ".py" )
84
85 copyResult = main.ONOSbench.copyMininetFile( main.topology,
86 main.dependencyPath,
87 main.Mininet1.user_name,
88 main.Mininet1.ip_address )
89
90 if main.CLIs:
91 stepResult = main.TRUE
92 else:
93 main.log.error( "Did not properly created list of ONOS CLI handle" )
94 stepResult = main.FALSE
95
96 utilities.assert_equals( expect=main.TRUE,
97 actual=stepResult,
98 onpass="Successfully construct " +
99 "test variables ",
100 onfail="Failed to construct test variables" )
101
102 if gitPull == 'True':
103 main.step( "Building ONOS in " + gitBranch + " branch" )
104 onosBuildResult = main.startUp.onosBuild( main, gitBranch )
105 stepResult = onosBuildResult
106 utilities.assert_equals( expect=main.TRUE,
107 actual=stepResult,
108 onpass="Successfully compiled " +
109 "latest ONOS",
110 onfail="Failed to compile " +
111 "latest ONOS" )
112 else:
113 main.log.warn( "Did not pull new code so skipping mvn " +
114 "clean install" )
115
GlennRCb3202c52015-08-24 14:43:30 -0700116 main.case( "Starting up " + str( main.numCtrls ) +
117 " node(s) ONOS cluster" )
118
119 # kill off all onos processes
120 main.log.info( "Safety check, killing all ONOS processes" +
121 " before initiating enviornment setup" )
122
123 for i in range( main.maxNodes ):
124 main.ONOSbench.onosDie( main.ONOSip[ i ] )
125
126 main.log.info( "NODE COUNT = " + str( main.numCtrls))
127
128 tempOnosIp = []
129 for i in range( main.numCtrls ):
130 tempOnosIp.append( main.ONOSip[i] )
131
132 main.ONOSbench.createCellFile( main.ONOSbench.ip_address,
133 "temp",
134 main.Mininet1.ip_address,
135 main.apps,
136 tempOnosIp )
137
138 main.step( "Apply cell to environment" )
139 cellResult = main.ONOSbench.setCell( "temp" )
140 verifyResult = main.ONOSbench.verifyCell()
141 stepResult = cellResult and verifyResult
142 utilities.assert_equals( expect=main.TRUE,
143 actual=stepResult,
144 onpass="Successfully applied cell to " + \
145 "environment",
146 onfail="Failed to apply cell to environment " )
147
148 main.step( "Creating ONOS package" )
149 packageResult = main.ONOSbench.onosPackage()
150 stepResult = packageResult
151 utilities.assert_equals( expect=main.TRUE,
152 actual=stepResult,
153 onpass="Successfully created ONOS package",
154 onfail="Failed to create ONOS package" )
155
GlennRCec6c7612015-08-31 14:52:10 -0700156 commit = main.ONOSbench.getVersion()
157 commit = commit.split(" ")[1]
158
GlennRC58ea2542015-09-02 14:23:34 -0700159 main.log.info("Creating DB file")
160 nic = main.params['DATABASE']['nic']
161 node = main.params['DATABASE']['node']
GlennRCd0e5ed22015-09-03 11:54:27 -0700162
GlennRCec6c7612015-08-31 14:52:10 -0700163 try:
164 dbFileName="/tmp/MaxIntentDB"
165 dbfile = open(dbFileName, "w+")
166 temp = "'" + commit + "',"
GlennRC58ea2542015-09-02 14:23:34 -0700167 temp += "'" + nic + "',"
168 temp += str(main.numCtrls) + ","
GlennRC5719ff02015-09-08 17:25:30 -0700169 temp += "'" + node + "1" + "'"
GlennRCec6c7612015-08-31 14:52:10 -0700170 dbfile.write(temp)
171 dbfile.close()
172 except IOError:
173 main.log.warn("Error opening " + dbFileName + " to write results.")
174
175 def CASE1( self, main ):
176 """
177 - Uninstall ONOS cluster
178 - Verify ONOS start up
179 - Install ONOS cluster
180 - Connect to cli
181 """
GlennRCb3202c52015-08-24 14:43:30 -0700182 main.step( "Uninstalling ONOS package" )
183 onosUninstallResult = main.TRUE
184 for i in range( main.maxNodes ):
185 onosUninstallResult = onosUninstallResult and \
186 main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
187 stepResult = onosUninstallResult
188 utilities.assert_equals( expect=main.TRUE,
189 actual=stepResult,
190 onpass="Successfully uninstalled ONOS package",
191 onfail="Failed to uninstall ONOS package" )
192
193 time.sleep( main.startUpSleep )
194 main.step( "Installing ONOS package" )
195 onosInstallResult = main.TRUE
196 for i in range( main.numCtrls ):
197 onosInstallResult = onosInstallResult and \
198 main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
199 stepResult = onosInstallResult
200 utilities.assert_equals( expect=main.TRUE,
201 actual=stepResult,
202 onpass="Successfully installed ONOS package",
203 onfail="Failed to install ONOS package" )
204
205 main.step( "Starting ONOS service" )
206 stopResult = main.TRUE
207 startResult = main.TRUE
208 onosIsUp = main.TRUE
209
210 for i in range( main.numCtrls ):
211 onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
212 if onosIsUp == main.TRUE:
213 main.log.report( "ONOS instance is up and ready" )
214 else:
215 main.log.report( "ONOS instance may not be up, stop and " +
216 "start ONOS again " )
217 for i in range( main.numCtrls ):
218 stopResult = stopResult and \
219 main.ONOSbench.onosStop( main.ONOSip[ i ] )
220 for i in range( main.numCtrls ):
221 startResult = startResult and \
222 main.ONOSbench.onosStart( main.ONOSip[ i ] )
223 stepResult = onosIsUp and stopResult and startResult
224 utilities.assert_equals( expect=main.TRUE,
225 actual=stepResult,
226 onpass="ONOS service is ready",
227 onfail="ONOS service did not start properly" )
228
229 main.step( "Start ONOS cli" )
230 cliResult = main.TRUE
231 for i in range( main.numCtrls ):
232 cliResult = cliResult and \
233 main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
234 stepResult = cliResult
235 utilities.assert_equals( expect=main.TRUE,
236 actual=stepResult,
237 onpass="Successfully start ONOS cli",
238 onfail="Failed to start ONOS cli" )
239
240 def CASE10( self, main ):
241 """
242 Setting up null-provider
243 """
244 import json
245 import pexpect
246
247 # Activate apps
248 main.log.step("Activating apps")
249 stepResult = main.CLIs[0].activateApp('org.onosproject.null')
250 utilities.assert_equals( expect=main.TRUE,
251 actual=stepResult,
252 onpass="Successfully activated null-provider",
253 onfail="Failed to activate null-provider")
254
255 # Setup the null-provider
256 main.log.step("Configuring null-provider")
257 stepResult = main.FALSE
258 for i in range(3):
259 main.ONOSbench.onosCfgSet( main.ONOSip[0],
260 'org.onosproject.provider.nil.NullProviders',
261 'deviceCount 3' )
262 main.ONOSbench.onosCfgSet( main.ONOSip[0],
263 'org.onosproject.provider.nil.NullProviders',
264 'topoShape reroute' )
265 main.ONOSbench.onosCfgSet( main.ONOSip[0],
266 'org.onosproject.provider.nil.NullProviders',
267 'enabled true' )
268 # give onos some time to settle
269 time.sleep(main.startUpSleep)
270 jsonSum = json.loads(main.CLIs[0].summary())
271 if jsonSum['devices'] == 3 and jsonSum['SCC(s)'] == 1:
272 stepResult = main.TRUE
273 break
274 utilities.assert_equals( expect=stepResult,
275 actual=stepResult,
276 onpass="Successfully configured the null-provider",
277 onfail="Failed to configure the null-provider")
278
279
280 main.log.step("Get default flows")
281 jsonSum = json.loads(main.CLIs[0].summary())
282
283 # flows installed by the null-provider
284 main.defaultFlows = jsonSum["flows"]
285 main.ingress = ":0000000000000001/3"
286 main.egress = ":0000000000000003/2"
287 main.switch = "null"
288 main.linkUpCmd = "null-link null:0000000000000001/3 null:0000000000000003/1 up"
289 main.linkDownCmd = "null-link null:0000000000000001/3 null:0000000000000003/1 down"
290
291 def CASE11( self, main ):
292 '''
293 Setting up mininet
294 '''
295 import json
296 import time
297
298 # Activate apps
299 main.log.step("Activating apps")
300 stepResult = main.CLIs[0].activateApp('org.onosproject.openflow')
301
302 utilities.assert_equals( expect=main.TRUE,
303 actual=stepResult,
304 onpass="Successfully activated openflow",
305 onfail="Failed to activate openflow")
306 # give onos some time settle
307 time.sleep(main.startUpSleep)
308
309 main.log.step('Starting mininet topology')
310 main.Mininet1.startNet(topoFile='~/mininet/custom/rerouteTopo.py')
311 main.Mininet1.assignSwController(sw='s1', ip=main.ONOSip[0])
312 main.Mininet1.assignSwController(sw='s2', ip=main.ONOSip[0])
313 main.Mininet1.assignSwController(sw='s3', ip=main.ONOSip[0])
314 time.sleep(main.startUpSleep)
315
316 jsonSum = json.loads(main.CLIs[0].summary())
317 if jsonSum['devices'] == 3 and jsonSum['SCC(s)'] == 1:
318 stepResult = main.TRUE
319
320 utilities.assert_equals( expect=stepResult,
321 actual=stepResult,
322 onpass="Successfully assigned switches to their master",
323 onfail="Failed to assign switches")
324
325 main.log.step("Get default flows")
326 jsonSum = json.loads(main.CLIs[0].summary())
327
328 # flows installed by the null-provider
329 main.defaultFlows = jsonSum["flows"]
330 main.ingress = ":0000000000000001/3"
331 main.egress = ":0000000000000003/2"
332 main.switch = "of"
333 main.linkDownCmd = 'link s1 s3 down'
334 main.linkUpCmd = 'link s1 s3 up'
335
336
337 def CASE20( self, main ):
338 import pexpect
339 '''
340 Pushing intents
341 '''
342 # the index where the next intents will be installed
343 offset = 0
344 # the number of intents we expect to be in the installed state
345 expectedIntents = 0
GlennRC33a42072015-09-11 11:32:44 -0700346 # keeps track of how many intents have been installed
347 maxIntents = 0
GlennRCb3202c52015-08-24 14:43:30 -0700348 # the number of flows we expect to be in the added state
349 expectedFlows = main.defaultFlows
GlennRC33a42072015-09-11 11:32:44 -0700350 # keeps track of how many flows have been installed
351 maxFlows = main.defaultFlows
GlennRC9882f352015-08-27 18:03:28 -0700352 # limit for the number of intents that can be installed
353 limit = main.maxIntents / main.batchSize
GlennRCd0e5ed22015-09-03 11:54:27 -0700354
355 for i in range(limit):
356 # Push intents
357 main.log.step("Pushing intents")
358 stepResult = main.intentFunctions.pushIntents( main,
359 main.switch,
360 main.ingress,
361 main.egress,
362 main.batchSize,
363 offset,
364 sleep=main.installSleep,
365 timeout=main.timeout,
366 options="-i" )
367 utilities.assert_equals( expect=main.TRUE,
368 actual=stepResult,
369 onpass="Successfully pushed intents",
370 onfail="Failed to push intents")
371 if stepResult == main.FALSE:
372 break
373
374 offset += main.batchSize
375 expectedIntents = offset
376 expectedFlows += main.batchSize*2
377
GlennRC33a42072015-09-11 11:32:44 -0700378 maxIntents = main.intentFunctions.getIntents( main )
379 maxFlows = main.intentFunctions.getFlows( main )
380
GlennRC5719ff02015-09-08 17:25:30 -0700381 if offset >= main.minIntents and offset % main.checkInterval == 0 or expectedIntents == main.maxIntents:
GlennRCd0e5ed22015-09-03 11:54:27 -0700382 # Verifying intents
383 main.log.step("Verifying intents")
384 main.log.info("Expected intents: " + str(expectedIntents))
385 stepResult = main.intentFunctions.verifyIntents( main,
386 expectedIntents,
387 sleep=main.verifySleep,
388 timeout=main.timeout)
GlennRCb3202c52015-08-24 14:43:30 -0700389 utilities.assert_equals( expect=main.TRUE,
GlennRCd0e5ed22015-09-03 11:54:27 -0700390 actual=stepResult,
391 onpass="Successfully verified intents",
392 onfail="Failed to verify intents")
393
GlennRCb3202c52015-08-24 14:43:30 -0700394 if stepResult == main.FALSE:
395 break
396
GlennRCd0e5ed22015-09-03 11:54:27 -0700397 # Verfying flows
398 main.log.step("Verifying flows")
399 main.log.info("Expected Flows: " + str(expectedFlows))
400 stepResult = main.intentFunctions.verifyFlows( main,
401 expectedFlows,
402 sleep=main.verifySleep,
403 timeout=main.timeout)
GlennRCb3202c52015-08-24 14:43:30 -0700404
GlennRCd0e5ed22015-09-03 11:54:27 -0700405 utilities.assert_equals( expect=main.TRUE,
406 actual=stepResult,
407 onpass="Successfully verified flows",
408 onfail="Failed to verify flows")
GlennRCb3202c52015-08-24 14:43:30 -0700409
GlennRCd0e5ed22015-09-03 11:54:27 -0700410 if stepResult == main.FALSE:
411 break
GlennRCb3202c52015-08-24 14:43:30 -0700412
413 main.log.report("Done pushing intents")
414 main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
GlennRCec6c7612015-08-31 14:52:10 -0700415 main.log.info("Installed intents: " + str(maxIntents) +
GlennRC5719ff02015-09-08 17:25:30 -0700416 " Added flows: " + str(maxFlows))
GlennRCec6c7612015-08-31 14:52:10 -0700417
GlennRC58ea2542015-09-02 14:23:34 -0700418 main.log.info("Writing results to DB file")
GlennRCec6c7612015-08-31 14:52:10 -0700419 try:
420 dbFileName="/tmp/MaxIntentDB"
GlennRC58ea2542015-09-02 14:23:34 -0700421 dbfile = open(dbFileName, "a")
GlennRC5719ff02015-09-08 17:25:30 -0700422 temp = "," + str(maxIntents)
423 temp += "," + str(maxFlows)
GlennRCec6c7612015-08-31 14:52:10 -0700424 dbfile.write(temp)
425 dbfile.close()
426 except IOError:
427 main.log.warn("Error opening " + dbFileName + " to write results.")
GlennRCb3202c52015-08-24 14:43:30 -0700428
429 # Stopping mininet
430 if main.switch == "of":
431 main.log.info("Stopping mininet")
432 main.Mininet1.stopNet()
433
434 def CASE21( self, main ):
435 import pexpect
436 import time
437 '''
438 Reroute
439 '''
440 # the index where the next intents will be installed
441 offset = 0
442 # the number of intents we expect to be in the installed state
443 expectedIntents = 0
GlennRC33a42072015-09-11 11:32:44 -0700444 # keeps track of how many intents have been installed
445 maxIntents = 0
GlennRCb3202c52015-08-24 14:43:30 -0700446 # the number of flows we expect to be in the added state
447 expectedFlows = main.defaultFlows
GlennRC33a42072015-09-11 11:32:44 -0700448 # keeps track of how many flows have been installed
449 maxFlows = main.defaultFlows
GlennRC9882f352015-08-27 18:03:28 -0700450 # limit for the number of intents that can be installed
451 limit = main.maxIntents / main.batchSize
GlennRCd0e5ed22015-09-03 11:54:27 -0700452
453 for i in range(limit):
454 # Push intents
455 main.log.step("Pushing intents")
456 stepResult = main.intentFunctions.pushIntents( main,
457 main.switch,
458 main.ingress,
459 main.egress,
460 main.batchSize,
461 offset,
462 sleep=main.installSleep,
463 options="-i",
464 timeout=main.timeout )
465 utilities.assert_equals( expect=main.TRUE,
466 actual=stepResult,
467 onpass="Successfully pushed intents",
468 onfail="Failed to push intents")
469 if stepResult == main.FALSE:
470 break
471
GlennRC33a42072015-09-11 11:32:44 -0700472 maxIntents = main.intentFunctions.getIntents( main )
473 maxFlows = main.intentFunctions.getFlows( main )
474
GlennRCd0e5ed22015-09-03 11:54:27 -0700475 offset += main.batchSize
476 expectedIntents = offset
477 expectedFlows += main.batchSize*2
478
479 # Verifying intents
480 main.log.step("Verifying intents")
481 main.log.info("Expected intents: " + str(expectedIntents))
482 stepResult = main.intentFunctions.verifyIntents( main,
483 expectedIntents,
484 sleep=main.verifySleep,
485 timeout=main.timeout )
486 utilities.assert_equals( expect=main.TRUE,
GlennRCb3202c52015-08-24 14:43:30 -0700487 actual=stepResult,
GlennRCd0e5ed22015-09-03 11:54:27 -0700488 onpass="Successfully verified intents",
489 onfail="Failed to verify intents")
GlennRCb3202c52015-08-24 14:43:30 -0700490
GlennRCd0e5ed22015-09-03 11:54:27 -0700491 if stepResult == main.FALSE:
492 break
GlennRCb3202c52015-08-24 14:43:30 -0700493
GlennRCd0e5ed22015-09-03 11:54:27 -0700494 # Verfying flows
495 main.log.step("Verifying flows")
496 main.log.info("Expected Flows: " + str(expectedFlows))
497 stepResult = main.intentFunctions.verifyFlows( main,
498 expectedFlows,
499 sleep=main.verifySleep,
500 timeout=main.timeout )
501 utilities.assert_equals( expect=main.TRUE,
502 actual=stepResult,
503 onpass="Successfully verified flows",
504 onfail="Failed to verify flows")
GlennRCb3202c52015-08-24 14:43:30 -0700505
GlennRCd0e5ed22015-09-03 11:54:27 -0700506 if stepResult == main.FALSE:
507 break
GlennRCb3202c52015-08-24 14:43:30 -0700508
GlennRCd0e5ed22015-09-03 11:54:27 -0700509 # tear down a link
510 main.log.step("Tearing down link")
511 if main.switch == "of":
512 main.log.info("Sending: " + main.linkDownCmd)
513 main.Mininet1.handle.sendline(main.linkDownCmd)
514 main.Mininet1.handle.expect('mininet>')
515 else:
516 main.log.info("Sending: " + main.linkDownCmd)
517 main.CLIs[0].handle.sendline(main.linkDownCmd)
518 main.CLIs[0].handle.expect('onos>')
519 time.sleep(main.rerouteSleep)
GlennRCb3202c52015-08-24 14:43:30 -0700520
GlennRCd0e5ed22015-09-03 11:54:27 -0700521 # rerouting adds a 1000 flows
522 expectedFlows += 1000
GlennRCb3202c52015-08-24 14:43:30 -0700523
GlennRCd0e5ed22015-09-03 11:54:27 -0700524 # Verfying flows
525 main.log.step("Verifying flows")
526 main.log.info("Expected Flows: " + str(expectedFlows))
527 stepResult = main.intentFunctions.verifyFlows( main,
528 expectedFlows,
529 sleep=main.verifySleep,
530 timeout=main.timeout)
531 utilities.assert_equals( expect=main.TRUE,
532 actual=stepResult,
533 onpass="Successfully verified flows",
534 onfail="Failed to verify flows")
GlennRCb3202c52015-08-24 14:43:30 -0700535
GlennRCd0e5ed22015-09-03 11:54:27 -0700536 if stepResult == main.FALSE:
537 break
GlennRCb3202c52015-08-24 14:43:30 -0700538
GlennRCd0e5ed22015-09-03 11:54:27 -0700539 # Bring link back up
540 main.log.step("Tearing down link")
541 if main.switch == "of":
542 main.log.info("Sending: " + main.linkUpCmd)
543 main.Mininet1.handle.sendline(main.linkUpCmd)
544 main.Mininet1.handle.expect('mininet>')
545 else:
546 main.log.info("Sending: " + main.linkUpCmd)
547 main.CLIs[0].handle.sendline(main.linkUpCmd)
548 main.CLIs[0].handle.expect('onos>')
549 time.sleep(main.rerouteSleep)
GlennRCb3202c52015-08-24 14:43:30 -0700550
551 main.log.report("Done pushing intents")
552 main.log.info("Summary: Intents=" + str(expectedIntents) + " Flows=" + str(expectedFlows))
GlennRCec6c7612015-08-31 14:52:10 -0700553 main.log.info("Installed intents: " + str(maxIntents) +
GlennRC5719ff02015-09-08 17:25:30 -0700554 " Added flows: " + str(maxFlows))
GlennRCec6c7612015-08-31 14:52:10 -0700555
GlennRC14d54f72015-09-03 10:51:37 -0700556 try:
557 dbFileName="/tmp/MaxIntentDB"
558 dbfile = open(dbFileName, "a")
GlennRC5719ff02015-09-08 17:25:30 -0700559 temp = "," + str(maxIntents)
560 temp += "," + str(maxFlows)
GlennRC14d54f72015-09-03 10:51:37 -0700561 dbfile.write(temp)
562 dbfile.close()
563 except IOError:
564 main.log.warn("Error opening " + dbFileName + " to write results.")
565
GlennRCb3202c52015-08-24 14:43:30 -0700566 # Stopping mininet
567 if main.switch == "of":
568 main.log.info("Stopping mininet")
569 main.Mininet1.stopNet()
570
571 def CASE100( self, main ):
572 '''
573 Report errors/warnings/exceptions
574 '''
575 main.log.info("Error report: \n")
576 main.ONOSbench.logReport( main.ONOSip[ 0 ],
577 [ "INFO",
578 "FOLLOWER",
579 "WARN",
580 "flow",
581 "ERROR",
582 "Except" ],
583 "s" )