blob: e6f7d76a94e3bd1e8eb92cfce1a1895f23d75dfe [file] [log] [blame]
suibin zhang17308622016-04-14 15:45:30 -07001class SCPFbatchFlowResp:
Jon Hall5c3ff722017-05-24 17:24:59 -07002
3 """
suibin zhang17308622016-04-14 15:45:30 -07004 Testing end-to-end ONOS response time from POST of batched flows to when ONOS returns
5 response confirmation of all flows ADDED; subsequently testing the response time from when REST DELETE to
6 ONOS confirmation of all flows REMOVED.
Jon Hall5c3ff722017-05-24 17:24:59 -07007 """
suibin zhang17308622016-04-14 15:45:30 -07008 def __init__( self ):
9 self.default = ''
10
11 def CASE1( self, main ):
12 import time
13 import os
14 import imp
15
16 """
17 - Construct tests variables
18 - GIT ( optional )
19 - Checkout ONOS master branch
20 - Pull latest ONOS code
suibin zhang17308622016-04-14 15:45:30 -070021 """
Devin Lim58046fa2017-07-05 16:55:00 -070022 try:
23 from tests.dependencies.ONOSSetup import ONOSSetup
24 main.testSetUp = ONOSSetup()
25 except ImportError:
26 main.log.error( "ONOSSetup not found. exiting the test" )
27 main.exit()
28 main.testSetUp.envSetupDescription()
29 stepResult = main.FALSE
30 try:
31 # Test variables
32 main.testOnDirectory = os.path.dirname( os.getcwd() )
33 main.cellName = main.params[ 'CASE1' ][ 'cellName' ]
34 main.apps = main.params[ 'CASE1' ][ 'cellApps' ]
35 main.maxNodes = int( main.params[ 'GLOBAL' ][ 'maxNodes' ] )
36 main.startUpSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'startup' ] )
37 main.startMNSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'startMN' ] )
38 main.addFlowSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'addFlow' ] )
39 main.delFlowSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'delFlow' ] )
40 main.chkFlowSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'chkFlow' ] )
41 main.onosPackaging = main.params[ 'CASE2' ][ 'incPackaging' ] == "true"
42 main.cfgSleep = float( main.params[ 'GLOBAL' ][ 'SLEEP' ][ 'cfg' ] )
43 main.numSw = int( main.params[ 'GLOBAL' ][ 'numSw' ] )
44 main.numThreads = int( main.params[ 'GLOBAL' ][ 'numThreads' ] )
45 main.cluster = main.params[ 'GLOBAL' ][ 'cluster' ]
suibin zhang17308622016-04-14 15:45:30 -070046
Devin Lim58046fa2017-07-05 16:55:00 -070047 stepResult = main.testSetUp.envSetup()
48 except Exception as e:
49 main.testSetUp.envSetupException( e )
50 main.testSetUp.evnSetupConclusion( stepResult )
Jon Hall5c3ff722017-05-24 17:24:59 -070051 main.commit = main.commit.split( " " )[ 1 ]
YPZhang28909bc2016-06-20 13:29:11 -070052
suibin zhang17308622016-04-14 15:45:30 -070053
54 def CASE2( self, main ):
55 """
56 - Set up cell
57 - Create cell file
58 - Set cell file
59 - Verify cell file
60 - Kill ONOS process
61 - Uninstall ONOS cluster
62 - Verify ONOS start up
63 - Install ONOS cluster
64 - Connect to cli
65 """
Devin Lim58046fa2017-07-05 16:55:00 -070066 main.testSetUp.ONOSSetUp( main.Mininet1, skipPack=main.onosPackaging )
suibin zhang17308622016-04-14 15:45:30 -070067
suibin zhang17308622016-04-14 15:45:30 -070068 def CASE10( self, main ):
Jon Hall5c3ff722017-05-24 17:24:59 -070069 """
suibin zhang17308622016-04-14 15:45:30 -070070 Start Mininet
Jon Hall5c3ff722017-05-24 17:24:59 -070071 """
suibin zhang17308622016-04-14 15:45:30 -070072 import time
73
74 main.case( "Enable openflow-base on onos and start Mininet." )
75
Jon Hall5c3ff722017-05-24 17:24:59 -070076 main.step( "Activate openflow-base App" )
77 app = main.params[ 'CASE10' ][ 'app' ]
YPZhang5d0552f2016-05-18 13:02:52 -070078 stepResult = main.ONOScli1.activateApp( app )
Jon Hall5c3ff722017-05-24 17:24:59 -070079 time.sleep( main.cfgSleep )
80 main.log.info( stepResult )
suibin zhang17308622016-04-14 15:45:30 -070081 utilities.assert_equals( expect=main.TRUE,
82 actual=stepResult,
83 onpass="Successfully activate " + app,
84 onfail="Failed to activate app " + app )
85
Jon Hall5c3ff722017-05-24 17:24:59 -070086 time.sleep( main.cfgSleep )
suibin zhang17308622016-04-14 15:45:30 -070087
Jon Hall5c3ff722017-05-24 17:24:59 -070088 main.step( "Configure AdaptiveFlowSampling " )
89 stepResult = main.ONOScli1.setCfg( component="org.onosproject.provider.of.flow.impl.OpenFlowRuleProvider",
90 propName="adaptiveFlowSampling ", value=main.params[ 'CASE10' ][ 'adaptiveFlowenabled' ] )
suibin zhang17308622016-04-14 15:45:30 -070091 utilities.assert_equals( expect=main.TRUE,
92 actual=stepResult,
93 onpass="App Configuration Succeeded! ",
94 onfail="App Configuration Failed!" )
Jon Hall5c3ff722017-05-24 17:24:59 -070095 time.sleep( main.cfgSleep )
suibin zhang17308622016-04-14 15:45:30 -070096
Jon Hall5c3ff722017-05-24 17:24:59 -070097 main.step( "Setup Mininet Linear Topology with " + str( main.numSw ) + " switches" )
98 argStr = main.params[ 'CASE10' ][ 'mnArgs' ].format( main.numSw )
99 stepResult = main.Mininet1.startNet( args=argStr )
suibin zhang17308622016-04-14 15:45:30 -0700100
101 utilities.assert_equals( expect=main.TRUE,
102 actual=stepResult,
103 onpass="Successfully loaded topology",
104 onfail="Failed to load topology" )
105
106 time.sleep( main.startMNSleep )
107
108 main.step( "Assign switches to controller" )
Jon Hall5c3ff722017-05-24 17:24:59 -0700109 for i in range( 1, main.numSw + 1 ):
110 main.Mininet1.assignSwController( "s" + str( i ), main.ONOSip[ 0 ] )
suibin zhang17308622016-04-14 15:45:30 -0700111
112 utilities.assert_equals( expect=main.TRUE,
113 actual=stepResult,
114 onpass="Successfully assigned switch to controller",
115 onfail="Failed to assign switch to controller" )
116
117 main.deviceIdPrefix = "of:"
118
119 time.sleep( main.startMNSleep )
120
121 def CASE11( self, main ):
Jon Hall5c3ff722017-05-24 17:24:59 -0700122 """
suibin zhang17308622016-04-14 15:45:30 -0700123 Start Null Provider
Jon Hall5c3ff722017-05-24 17:24:59 -0700124 """
suibin zhang17308622016-04-14 15:45:30 -0700125 import time
126
127 main.case( "Setup Null Provider for linear Topology" )
128
Jon Hall5c3ff722017-05-24 17:24:59 -0700129 main.step( "Activate Null Provider App" )
130 stepResult = main.ONOSbench.onosCli( ONOSIp=main.ONOSip[ 0 ],
131 cmdstr="app activate org.onosproject.null" )
suibin zhang17308622016-04-14 15:45:30 -0700132 utilities.assert_equals( expect=main.TRUE,
133 actual=stepResult,
134 onpass="Successfully activated org.onosproject.null",
135 onfail="Failed to activate org.onosproject.null" )
Jon Hall5c3ff722017-05-24 17:24:59 -0700136 time.sleep( main.cfgSleep )
suibin zhang17308622016-04-14 15:45:30 -0700137
Jon Hall5c3ff722017-05-24 17:24:59 -0700138 main.step( "Setup Null Provider Linear Topology with " + str( main.numSw ) + " devices." )
139 r1 = main.ONOSbench.onosCfgSet( main.ONOSip[ 0 ], "org.onosproject.provider.nil.NullProviders", "deviceCount " + str( main.numSw ) )
140 r2 = main.ONOSbench.onosCfgSet( main.ONOSip[ 0 ], "org.onosproject.provider.nil.NullProviders", "topoShape " + main.params[ 'CASE11' ][ 'nullTopo' ] )
141 r3 = main.ONOSbench.onosCfgSet( main.ONOSip[ 0 ], "org.onosproject.provider.nil.NullProviders", "enabled " + main.params[ 'CASE11' ][ 'nullStart' ] )
suibin zhang17308622016-04-14 15:45:30 -0700142 stepResult = r1 & r2 & r3
143 utilities.assert_equals( expect=main.TRUE,
144 actual=stepResult,
145 onpass="App Configuration Succeeded! ",
146 onfail="App Configuration Failed!" )
147 time.sleep( main.cfgSleep )
148
Jon Hall5c3ff722017-05-24 17:24:59 -0700149 main.log.info( "Check to make sure null providers are configured correctly." )
150 main.ONOSbench.handle.sendline( "onos $OC1 summary" )
151 stepResult = main.ONOSbench.handle.expect( ":~" )
152 main.log.info( "ONOS Summary: " + main.ONOSbench.handle.before )
suibin zhang17308622016-04-14 15:45:30 -0700153
154 main.deviceIdPrefix = "null:"
155
156 time.sleep( main.startMNSleep )
157
suibin zhang17308622016-04-14 15:45:30 -0700158 def CASE1000( self, main ):
Jon Hall5c3ff722017-05-24 17:24:59 -0700159 """
suibin zhang17308622016-04-14 15:45:30 -0700160 create JSON object with batched flows
Jon Hall5c3ff722017-05-24 17:24:59 -0700161 """
suibin zhang17308622016-04-14 15:45:30 -0700162 import numpy
163 import time
164 from pprint import pprint
165
166 main.case( "Create a json object for the batched flows" )
167
168 main.step( "Parse batch creation information" )
Jon Hall5c3ff722017-05-24 17:24:59 -0700169 main.batchSize = int( main.params[ 'CASE1000' ][ 'batchSize' ] )
170 main.log.info( "Number of flows in a batch is:" + str( main.batchSize ) )
suibin zhang17308622016-04-14 15:45:30 -0700171
172 main.flowJsonBatchList = []
173 startSw = 1
174
Jon Hall5c3ff722017-05-24 17:24:59 -0700175 main.step( "Creating a full list of batches" )
176 for index in range( 1, int( main.params[ 'CASE1000' ][ 'batches' ] ) + 1 ):
suibin zhang17308622016-04-14 15:45:30 -0700177 if startSw <= main.numSw:
178 ind = startSw
179 else:
180 startSw = 1
181 ind = startSw
182
Jon Hall5c3ff722017-05-24 17:24:59 -0700183 main.log.info( "Creating batch: " + str( index ) )
184 flowJsonBatch = main.ONOSrest.createFlowBatch( numSw=main.numSw,
185 swIndex=ind,
186 batchSize=main.batchSize,
187 batchIndex=index,
suibin zhang17308622016-04-14 15:45:30 -0700188 deviceIdpreFix=main.deviceIdPrefix,
Jon Hall5c3ff722017-05-24 17:24:59 -0700189 ingressPort=2,
190 egressPort=3 )
191 main.flowJsonBatchList.append( flowJsonBatch )
suibin zhang17308622016-04-14 15:45:30 -0700192
193 startSw += 1
Jon Hall5c3ff722017-05-24 17:24:59 -0700194 main.log.info( "Number of items created in the batch list is: " + str( len( main.flowJsonBatchList ) ) )
suibin zhang17308622016-04-14 15:45:30 -0700195
Jon Hall5c3ff722017-05-24 17:24:59 -0700196 def CASE2100( self, main ):
197 """
suibin zhang17308622016-04-14 15:45:30 -0700198 Posting flow batches using threads
Jon Hall5c3ff722017-05-24 17:24:59 -0700199 """
200 main.case( "Using REST API /flows/{} to post flow batch - multi-threads" )
201 main.step( "Using REST API /flows/{} to post flow batch - multi-threads" )
suibin zhang17308622016-04-14 15:45:30 -0700202
203 from Queue import Queue
204 from threading import Thread
205 import time
206 import json
207
208 main.threadID = 0
209 main.addedBatchList = []
210 q = Queue()
211 tAllAdded = 0
You Wang7b5b2262016-11-10 13:54:56 -0800212 main.postFailed = False
suibin zhang17308622016-04-14 15:45:30 -0700213
Jon Hall5c3ff722017-05-24 17:24:59 -0700214 def postWorker( id ):
suibin zhang17308622016-04-14 15:45:30 -0700215 while True:
216 item = q.get()
Jon Hall5c3ff722017-05-24 17:24:59 -0700217 #print json.dumps( item )
218 status, response = main.ONOSrest.sendFlowBatch( batch=item )
You Wang7b5b2262016-11-10 13:54:56 -0800219 if status == main.TRUE:
Jon Hall5c3ff722017-05-24 17:24:59 -0700220 main.log.info( "Thread {} is working on posting. ".format( id ) )
221 #print json.dumps( response )
222 main.addedBatchList.append( response[ 1 ] )
You Wang7b5b2262016-11-10 13:54:56 -0800223 else:
Jon Hall5c3ff722017-05-24 17:24:59 -0700224 main.log.error( "Thread {} failed to post.".format( id ) )
You Wang7b5b2262016-11-10 13:54:56 -0800225 main.postFailed = True
suibin zhang17308622016-04-14 15:45:30 -0700226 q.task_done()
227
Jon Hall5c3ff722017-05-24 17:24:59 -0700228 for i in range( int( main.params[ 'CASE2100' ][ 'numThreads' ] ) ):
229 threadID = "ThreadID-" + str( i )
230 t = Thread( target=postWorker, name=threadID, args=( threadID, ) )
suibin zhang17308622016-04-14 15:45:30 -0700231 t.daemon = True
232 t.start()
233
234 tStartPost = time.time()
235 for item in main.flowJsonBatchList:
Jon Hall5c3ff722017-05-24 17:24:59 -0700236 q.put( item )
suibin zhang17308622016-04-14 15:45:30 -0700237
238 q.join()
239 tLastPostEnd = time.time()
You Wang7b5b2262016-11-10 13:54:56 -0800240 if main.postFailed:
241 main.log.error( "Flow batch posting failed, exit test" )
242 main.cleanup()
243 main.exit()
suibin zhang17308622016-04-14 15:45:30 -0700244
Jon Hall5c3ff722017-05-24 17:24:59 -0700245 main.step( "Check to ensure all flows are in added state." )
246 #pprint( main.addedBatchList )
suibin zhang17308622016-04-14 15:45:30 -0700247 resp = main.FALSE
Jon Hall5c3ff722017-05-24 17:24:59 -0700248 while resp != main.TRUE and ( tAllAdded - tLastPostEnd < int( main.params[ 'CASE2100' ][ 'chkFlowTO' ] ) ):
249 if main.params[ 'CASE2100' ][ 'RESTchkFlow' ] == 'main.TRUE':
suibin zhang17308622016-04-14 15:45:30 -0700250 resp = main.ONOSrest.checkFlowsState()
251 else:
Jon Hall5c3ff722017-05-24 17:24:59 -0700252 handle = main.CLIs[ 0 ].flows( state=" |grep PEND|wc -l", jsonFormat=False )
253 main.log.info( "handle returns PENDING flows: " + handle )
suibin zhang17308622016-04-14 15:45:30 -0700254 if handle == "0":
255 resp = main.TRUE
256
257 time.sleep( main.chkFlowSleep )
258 tAllAdded = time.time()
259
Jon Hall5c3ff722017-05-24 17:24:59 -0700260 if tAllAdded - tLastPostEnd >= int( main.params[ 'CASE2100' ][ 'chkFlowTO' ] ):
261 main.log.warn( "ONOS Flows still in pending state after: {} seconds.".format( tAllAdded - tLastPostEnd ) )
suibin zhang17308622016-04-14 15:45:30 -0700262
Jon Hall5c3ff722017-05-24 17:24:59 -0700263 main.numFlows = int( main.params[ 'CASE1000' ][ 'batches' ] ) *\
264 int( main.params[ 'CASE1000' ][ 'batchSize' ] )
265 main.log.info( "Total number of flows: " + str( main.numFlows ) )
266 main.elapsePOST = tLastPostEnd - tStartPost
267 main.log.info( "Total POST elapse time: " + str( main.elapsePOST ) )
268 main.log.info( "Rate of ADD Controller response: " + str( main.numFlows / ( main.elapsePOST ) ) )
suibin zhang17308622016-04-14 15:45:30 -0700269
270 main.POSTtoCONFRM = tAllAdded - tLastPostEnd
Jon Hall5c3ff722017-05-24 17:24:59 -0700271 main.log.info( "Elapse time from end of last REST POST to Flows in ADDED state: " +
272 str( main.POSTtoCONFRM ) )
273 main.log.info( "Rate of Confirmed Batch Flow ADD is ( flows/sec ): " +
274 str( main.numFlows / main.POSTtoCONFRM ) )
275 main.log.info( "Number of flow Batches in the addedBatchList is: " +
276 str( len( main.addedBatchList ) ) )
suibin zhang17308622016-04-14 15:45:30 -0700277
Jon Hall5c3ff722017-05-24 17:24:59 -0700278 def CASE3100( self, main ):
279 """
suibin zhang17308622016-04-14 15:45:30 -0700280 DELETE flow batches using threads
Jon Hall5c3ff722017-05-24 17:24:59 -0700281 """
282 main.case( "Using REST API /flows/{} to delete flow batch - multi-threads" )
283 main.step( "Using REST API /flows/{} to delete flow batch - multi-threads" )
suibin zhang17308622016-04-14 15:45:30 -0700284
285 from Queue import Queue
286 from threading import Thread
287 import time
288 import json
289
290 main.threadID = 0
291 q = Queue()
292 tAllRemoved = 0
293
Jon Hall5c3ff722017-05-24 17:24:59 -0700294 main.log.info( "Number of flow batches at start of remove: " + str( len( main.addedBatchList ) ) )
295
296 def removeWorker( id ):
suibin zhang17308622016-04-14 15:45:30 -0700297 while True:
298 item = q.get()
Jon Hall5c3ff722017-05-24 17:24:59 -0700299 response = main.ONOSrest.removeFlowBatch( batch=json.loads( item ) )
300 main.log.info( "Thread {} is working on deleting. ".format( id ) )
suibin zhang17308622016-04-14 15:45:30 -0700301 q.task_done()
302
Jon Hall5c3ff722017-05-24 17:24:59 -0700303 for i in range( int( main.params[ 'CASE2100' ][ 'numThreads' ] ) ):
304 threadID = "ThreadID-" + str( i )
305 t = Thread( target=removeWorker, name=threadID, args=( threadID, ) )
suibin zhang17308622016-04-14 15:45:30 -0700306 t.daemon = True
307 t.start()
308
309 tStartDelete = time.time()
310 for item in main.addedBatchList:
Jon Hall5c3ff722017-05-24 17:24:59 -0700311 q.put( item )
suibin zhang17308622016-04-14 15:45:30 -0700312
313 q.join()
314 tLastDeleteEnd = time.time()
Jon Hall5c3ff722017-05-24 17:24:59 -0700315 main.log.info( "Number of flow batches at end of remove: " + str( len( main.addedBatchList ) ) )
suibin zhang17308622016-04-14 15:45:30 -0700316
Jon Hall5c3ff722017-05-24 17:24:59 -0700317 main.step( "Check to ensure all flows are in added state." )
318 #pprint( main.addedBatchList )
suibin zhang17308622016-04-14 15:45:30 -0700319 resp = main.FALSE
Jon Hall5c3ff722017-05-24 17:24:59 -0700320 while resp != main.TRUE and ( tAllRemoved - tLastDeleteEnd < int( main.params[ 'CASE3100' ][ 'chkFlowTO' ] ) ):
321 if main.params[ 'CASE3100' ][ 'RESTchkFlow' ] == 'main.TRUE':
suibin zhang17308622016-04-14 15:45:30 -0700322 resp = main.ONOSrest.checkFlowsState()
323 else:
Jon Hall5c3ff722017-05-24 17:24:59 -0700324 handle = main.CLIs[ 0 ].flows( state=" |grep PEND|wc -l", jsonFormat=False )
325 main.log.info( "handle returns PENDING flows: " + handle )
suibin zhang17308622016-04-14 15:45:30 -0700326 if handle == "0":
327 resp = main.TRUE
328 time.sleep( main.chkFlowSleep )
329 tAllRemoved = time.time()
330
Jon Hall5c3ff722017-05-24 17:24:59 -0700331 if tLastDeleteEnd - tLastDeleteEnd >= int( main.params[ 'CASE2100' ][ 'chkFlowTO' ] ):
332 main.log.warn( "ONOS Flows still in pending state after: {} seconds.".format( tAllRemoved - tLastDeleteEnd ) )
suibin zhang17308622016-04-14 15:45:30 -0700333
Jon Hall5c3ff722017-05-24 17:24:59 -0700334 main.numFlows = int( main.params[ 'CASE1000' ][ 'batches' ] ) *\
335 int( main.params[ 'CASE1000' ][ 'batchSize' ] )
336 main.log.info( "Total number of flows: " + str( main.numFlows ) )
337 main.elapseDELETE = tLastDeleteEnd - tStartDelete
338 main.log.info( "Total DELETE elapse time: " + str( main.elapseDELETE ) )
339 main.log.info( "Rate of DELETE Controller response: " + str( main.numFlows / ( main.elapseDELETE ) ) )
suibin zhang17308622016-04-14 15:45:30 -0700340
341 main.DELtoCONFRM = tAllRemoved - tLastDeleteEnd
Jon Hall5c3ff722017-05-24 17:24:59 -0700342 main.log.info( "Elapse time from end of last REST DELETE to Flows in REMOVED state: " +
343 str( main.DELtoCONFRM ) )
344 main.log.info( "Rate of Confirmed Batch Flow REMOVED is ( flows/sec ): " + str( main.numFlows / main.DELtoCONFRM ) )
suibin zhang17308622016-04-14 15:45:30 -0700345
Jon Hall5c3ff722017-05-24 17:24:59 -0700346 def CASE100( self, main ):
suibin zhang17308622016-04-14 15:45:30 -0700347 from pprint import pprint
348
349 main.case( "Check to ensure onos flows." )
350
351 resp = main.ONOSrest.checkFlowsState()
Jon Hall5c3ff722017-05-24 17:24:59 -0700352 #pprint( resp )
suibin zhang17308622016-04-14 15:45:30 -0700353
Jon Hall5c3ff722017-05-24 17:24:59 -0700354 def CASE210( self, main ):
355 main.case( "Log test results to a data file" )
356 main.step( "Write test resulted data to a data file" )
suibin zhang17308622016-04-14 15:45:30 -0700357 main.scale = main.maxNodes
358
359 try:
Jon Hall5c3ff722017-05-24 17:24:59 -0700360 dbFileName = "/tmp/SCPFbatchFlowRespData"
361 dbfile = open( dbFileName, "w+" )
suibin zhang17308622016-04-14 15:45:30 -0700362 temp = "'" + main.commit + "',"
YPZhang28909bc2016-06-20 13:29:11 -0700363 temp += "'1gig',"
suibin zhang17308622016-04-14 15:45:30 -0700364 temp += "'" + str( main.scale ) + "',"
365 temp += "'" + main.cluster + "',"
366 temp += "'" + str( main.elapsePOST ) + "',"
367 temp += "'" + str( main.POSTtoCONFRM ) + "',"
YPZhang28909bc2016-06-20 13:29:11 -0700368 temp += "'" + str( main.numFlows / main.POSTtoCONFRM ) + "',"
Jon Hall5c3ff722017-05-24 17:24:59 -0700369 temp += "'" + str( main.elapseDELETE ) + "',"
370 temp += "'" + str( main.DELtoCONFRM ) + "',"
YPZhang28909bc2016-06-20 13:29:11 -0700371 temp += "'" + str( main.numFlows / main.DELtoCONFRM ) + "',"
372 temp += "'" + str( main.numSw ) + "'\n"
suibin zhang17308622016-04-14 15:45:30 -0700373 dbfile.write( temp )
374 dbfile.close()
375 stepResult = main.TRUE
376 except IOError:
Jon Hall5c3ff722017-05-24 17:24:59 -0700377 main.log.warn( "Error opening " + dbFileName + " to write results." )
suibin zhang17308622016-04-14 15:45:30 -0700378 stepResult = main.FALSE
379
380 utilities.assert_equals( expect=main.TRUE,
381 actual=stepResult,
382 onpass="Succeeded to write results to datafile",
383 onfail="Failed to write results to datafile " )
Jon Hall5c3ff722017-05-24 17:24:59 -0700384
suibin zhang17308622016-04-14 15:45:30 -0700385 def CASE110( self, main ):
Jon Hall5c3ff722017-05-24 17:24:59 -0700386 """
suibin zhang17308622016-04-14 15:45:30 -0700387 Report errors/warnings/exceptions
Jon Hall5c3ff722017-05-24 17:24:59 -0700388 """
389 main.log.info( "Error report: \n" )
suibin zhang17308622016-04-14 15:45:30 -0700390 main.ONOSbench.logReport( main.ONOSip[ 0 ],
391 [ "INFO",
392 "FOLLOWER",
393 "WARN",
394 "flow",
395 "ERROR",
396 "Except" ],
397 "s" )
398 #main.stop()
399