blob: 9c75cb80fba8fbb52dc580a8ffc3b506c94b3992 [file] [log] [blame]
GlennRCdc7ab012015-07-23 15:40:12 -07001# CASE1 starts number of nodes specified in param file
2#
3# cameron@onlab.us
4
5class SCPFportLat:
6
7 def __init__( self ):
8 self.default = ''
9
10 def CASE1( self, main ):
11 import sys
12 import os.path
13 import os
14 import time
15
16 global init
17 try:
18 if type(init) is not bool:
19 init = Fals
20 except NameError:
21 init = False
22
23 #Load values from params file
24 checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
25 gitPull = main.params[ 'GIT' ][ 'autopull' ]
26 cellName = main.params[ 'ENV' ][ 'cellName' ]
27 Apps = main.params[ 'ENV' ][ 'cellApps' ]
28 BENCHIp = main.params[ 'BENCH' ][ 'ip' ]
29 MN1Ip = main.params[ 'MN' ][ 'ip1' ]
30 main.maxNodes = int(main.params[ 'max' ])
31 cellName = main.params[ 'ENV' ][ 'cellName' ]
32 homeDir = os.path.expanduser('~')
33 topoCfgFile = main.params['TEST']['topoConfigFile']
34 topoCfgName = main.params['TEST']['topoConfigName']
35 portEventResultPath = main.params['DB']['portEventResultPath']
36 skipMvn = main.params ['TEST']['mci']
37 testONpath = os.getcwd() #testON/bin
38
39 # -- INIT SECTION, ONLY RUNS ONCE -- #
40 if init == False:
41 init = True
42 global clusterCount #number of nodes running
43 global ONOSIp #list of ONOS IP addresses
44 global scale
45 global commit
46 global timeToPost
47 global runNum
48 global jenkinsBuildNumber
49 global CLIs
50 CLIs = []
51
52 timeToPost = time.strftime('%Y-%m-%d %H:%M:%S')
53 runNum = time.strftime('%d%H%M%S')
54 ONOSIp = main.ONOSbench.getOnosIps()
55
56 #Assigning ONOS cli handles to a list
57 for i in range(main.maxNodes):
58 CLIs.append( getattr( main, 'ONOS' + str(i+1) + 'cli'))
59
60 try:
61 jenkinsBuildNumber = str(os.environ['BUILD_NUMBER'])
62 main.log.report( 'Jenkins build number: ' + jenkinsBuildNumber )
63 except KeyError:
64 jenkinsBuildNumber = str(0)
65 main.log.info( 'Job is not run by jenkins. ' + 'Build number set to: ' + jenkinsBuildNumber)
66
67 clusterCount = 0
68 ONOSIp = main.ONOSbench.getOnosIps()
69
70 scale = (main.params[ 'SCALE' ]).split(",")
71 clusterCount = int(scale[0])
72
73 #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
74 if skipMvn != "off":
75 mvnResult = main.ONOSbench.cleanInstall()
76
77 #git
78 main.step( "Git checkout and pull " + checkoutBranch )
79 if gitPull == 'on':
80 checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
81 pullResult = main.ONOSbench.gitPull()
82
83 else:
84 checkoutResult = main.TRUE
85 pullResult = main.TRUE
86 main.log.info( "Skipped git checkout and pull" )
87
88 main.step("Grabbing commit number")
89 commit = main.ONOSbench.getVersion()
90 commit = (commit.split(" "))[1]
91
92 main.step("Creating results file")
93 resultsDB = open("IntentEventTPDB", "w+")
94 resultsDB.close()
95
96 main.log.report('Commit information - ')
97 main.ONOSbench.getVersion(report=True)
98
99 # -- END OF INIT SECTION --#
100
101 main.step("Adjusting scale")
102 clusterCount = int(scale[0])
103 scale.remove(scale[0])
104
105 #kill off all onos processes
106 main.step("Killing all ONOS processes before environmnet setup")
107 for node in range(main.maxNodes):
108 main.ONOSbench.onosDie(ONOSIp[node])
109
110 #Uninstall everywhere
111 main.step( "Cleaning Enviornment..." )
112 for i in range(main.maxNodes):
113 main.log.info(" Uninstalling ONOS " + str(i) )
114 main.ONOSbench.onosUninstall( ONOSIp[i] )
115 main.log.info("Sleep 10 second for uninstall to settle...")
116 time.sleep(10)
117 main.ONOSbench.handle.sendline(" ")
118 main.ONOSbench.handle.expect(":~")
119
120 #construct the cell file
121 main.log.info("Creating cell file")
122 cellIp = []
123 for node in range (clusterCount):
124 cellIp.append(ONOSIp[node])
125
126 main.ONOSbench.createCellFile("localhost",cellName,MN1Ip,str(Apps), cellIp)
127
128 main.step( "Set Cell" )
129 main.ONOSbench.setCell(cellName)
130
131 main.step( "Creating ONOS package" )
132 packageResult = main.ONOSbench.onosPackage()
133
134 main.step( "verify cells" )
135 verifyCellResult = main.ONOSbench.verifyCell()
136
137 main.step('Starting mininet topology ')
138 main.Mininet1.startNet()
139
140 main.step('Clearing previous DB log file')
141 fPortLog = open(portEventResultPath, 'w+')
142 fPortLog.close()
143
144 main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
145 for node in range(clusterCount):
146 main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
147 main.ONOSbench.onosInstall( ONOSIp[node])
148
149 for node in range(clusterCount):
150 for i in range( 2 ):
151 isup = main.ONOSbench.isup( ONOSIp[node] )
152 if isup:
153 main.log.info("ONOS " + str(node + 1) + " is up\n")
154 break
155 if not isup:
156 main.log.report( "ONOS " + str(node) + " didn't start!" )
157 main.log.info("Startup sequence complete")
158
159 main.step('Starting onos CLIs')
160 for i in range(clusterCount):
161 CLIs[i].startOnosCli(ONOSIp[i])
162
163 time.sleep(20)
164
165 main.step( 'activating essential applications' )
166 CLIs[0].activateApp( 'org.onosproject.metrics' )
167 CLIs[0].activateApp( 'org.onosproject.openflow' )
168
169 main.step( 'Configuring application parameters' )
170
171 configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
172 configParam = 'maxEvents 1'
173 main.ONOSbench.onosCfgSet( ONOSIp[0], configName, configParam )
174 configParam = 'maxBatchMs 0'
175 main.ONOSbench.onosCfgSet( ONOSIp[0], configName, configParam )
176 configParam = 'maxIdleMs 0'
177 main.ONOSbench.onosCfgSet( ONOSIp[0], configName, configParam )
178
179 def CASE2( self, main ):
180 """
181 Bring port up / down and measure latency.
182 Port enable / disable is simulated by ifconfig up / down
183
184 In ONOS-next, we must ensure that the port we are
185 manipulating is connected to another switch with a valid
186 connection. Otherwise, graph view will not be updated.
187 """
188 import time
189 import subprocess
190 import os
191 import requests
192 import json
193 import numpy
194
195 ONOSUser = main.params['CTRL']['user']
196 numIter = main.params['TEST']['numIter']
197 iterIgnore = int(main.params['TEST']['iterIgnore'])
198
199 deviceTimestampKey = main.params['JSON']['deviceTimestamp']
200 graphTimestampKey = main.params['JSON']['graphTimestamp']
201 linkTimestampKey = main.params['JSON']['linkTimestamp']
202
203 tsharkPortUp = '/tmp/tshark_port_up.txt'
204 tsharkPortDown = '/tmp/tshark_port_down.txt'
205 tsharkPortStatus = main.params[ 'TSHARK' ][ 'ofpPortStatus' ]
206
207 debugMode = main.params['TEST']['debugMode']
208 postToDB = main.params['DB']['postToDB']
209 resultPath = main.params['DB']['portEventResultPath']
210 localTime = time.strftime('%x %X')
211 localTime = localTime.replace('/', '')
212 localTime = localTime.replace(' ', '_')
213 localTime = localTime.replace(':', '')
214
215 if debugMode == 'on':
216 main.ONOSbench.tsharkPcap('eth0', '/tmp/port_lat_pcap_' + localTime)
217
218 upThresholdStr = main.params['TEST']['portUpThreshold']
219 downThresholdStr = main.params['TEST']['portDownThreshold']
220 upThresholdObj = upThresholdStr.split(',')
221 downThresholdObj = downThresholdStr.split(',')
222 upThresholdMin = int(upThresholdObj[0])
223 upThresholdMax = int(upThresholdObj[1])
224 downThresholdMin = int(downThresholdObj[0])
225 downThresholdMax = int(downThresholdObj[1])
226
227 interfaceConfig = 's1-eth1'
228 main.log.report('Port enable / disable latency')
229 main.log.report('Simulated by ifconfig up / down')
230 main.log.report('Total iterations of test: ' + str(numIter))
231 main.step('Assign switches s1 and s2 to controller 1')
232
233 main.Mininet1.assignSwController(sw='s1', ip=ONOSIp[0])
234 main.Mininet1.assignSwController(sw='s2', ip=ONOSIp[0])
235
236 time.sleep(15)
237
238 portUpEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
239 portUpOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
240 portUpDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
241 portUpLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
242
243 portDownEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
244 portDownOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
245 portDownDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
246 portDownLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
247
248 for i in range(0, int(numIter)):
249 main.step('Starting wireshark capture for port status down')
250 main.ONOSbench.tsharkGrep(tsharkPortStatus, tsharkPortDown)
251
252 time.sleep(2)
253
254 main.step('Disable port: ' + interfaceConfig)
255 main.Mininet1.handle.sendline('sh ifconfig ' +
256 interfaceConfig + ' down')
257 main.Mininet1.handle.expect('mininet>')
258
259 time.sleep(2)
260
261 jsonStrPtDown = []
262 for node in range (0, clusterCount):
263 metricsPortDown = CLIs[node].topologyEventsMetrics()
264 jsonStrPtDown.append(metricsPortDown)
265
266 time.sleep(10)
267
268 main.ONOSbench.tsharkStop()
269
270 fPortDown = open(tsharkPortDown, 'r')
271 fLine = fPortDown.readline()
272 objDown = fLine.split(' ')
273 if len(fLine) > 0:
274 timestampBeginPtDown = int(float(objDown[1]) * 1000)
275 # At times, tshark reports timestamp at the 3rd
276 # index of the array. If initial readings were
277 # unlike the epoch timestamp, then check the 3rd
278 # index and set that as a timestamp
279 if timestampBeginPtDown < 1400000000000:
280 timestampBeginPtDown = int(float(objDown[2]) * 1000)
281 else:
282 main.log.info('Tshark output file returned unexpected' +
283 ' results: ' + str(objDown))
284 timestampBeginPtDown = 0
285 fPortDown.close()
286
287 for node in range(0, clusterCount):
288 nodeNum = node+1
289 metricsDown = CLIs[node].topologyEventsMetrics
290 jsonStrPtDown[node] = metricsDown()
291 jsonObj = json.loads(jsonStrPtDown[node])
292
293 if jsonObj:
294 graphTimestamp = jsonObj[graphTimestampKey]['value']
295 deviceTimestamp = jsonObj[deviceTimestampKey]['value']
296 linkTimestamp = jsonObj[linkTimestampKey]['value']
297 else:
298 main.log.error( "Unexpected json object" )
299 graphTimestamp = 0
300 deviceTimestamp = 0
301 linkTimestamp = 0
302
303 main.log.info('ptDownTimestamp: ' + str(timestampBeginPtDown))
304 main.log.info("graphTimestamp: " + str(graphTimestamp))
305 main.log.info("deviceTimestamp: " + str(deviceTimestamp))
306 main.log.info("linkTimestamp: " + str(linkTimestamp))
307
308 ptDownEndToEnd = int(graphTimestamp) - int(timestampBeginPtDown)
309 ptDownOfpToDevice = float(deviceTimestamp) - float(timestampBeginPtDown)
310 ptDownDeviceToLink = float(linkTimestamp) - float(deviceTimestamp)
311 ptDownLinkToGraph = float(graphTimestamp) - float(linkTimestamp)
312
313 if ptDownEndToEnd < downThresholdMin or ptDownEndToEnd >= downThresholdMax:
314 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port down End-to-end: "+ str(ptDownEndToEnd) + " ms")
315 elif i < iterIgnore:
316 main.log.info("ONOS "+str(nodeNum) + " warming up - port down End-to-end: "+ str(ptDownEndToEnd) + " ms")
317 else:
318 portDownEndToEndNodeIter[node][i] = ptDownEndToEnd
319 main.log.info("ONOS "+str(nodeNum) + " port down End-to-end: "+ str(ptDownEndToEnd) + " ms")
320
321 if ptDownOfpToDevice < downThresholdMin or ptDownOfpToDevice >= downThresholdMax:
322 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port down Ofp-to-device: "+ str(ptDownOfpToDevice) + " ms")
323 elif i < iterIgnore:
324 main.log.info("ONOS "+str(nodeNum) + " warming up - port down Ofp-to-device: "+ str(ptDownOfpToDevice) + " ms")
325 else:
326 portDownOfpToDevNodeIter[node][i] = ptDownOfpToDevice
327 main.log.info("ONOS "+str(nodeNum) + " port down Ofp-to-device: "+ str(ptDownOfpToDevice) + " ms")
328
329 if ptDownDeviceToLink < downThresholdMin or ptDownDeviceToLink >= downThresholdMax:
330 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port down Device-to-link: "+ str(ptDownDeviceToLink) + " ms")
331 elif i < iterIgnore:
332 main.log.info("ONOS "+str(nodeNum) + " warming up - port down Device-to-link: "+ str(ptDownDeviceToLink) + " ms")
333 else:
334 portDownDevToLinkNodeIter[node][i] = ptDownDeviceToLink
335 main.log.info("ONOS "+str(nodeNum) + " port down Device-to-link: "+ str(ptDownDeviceToLink) + " ms")
336
337 if ptDownLinkToGraph < downThresholdMin or ptDownLinkToGraph >= downThresholdMax:
338 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port down Link-to-graph: "+ str(ptDownLinkToGraph) + " ms")
339 elif i < iterIgnore:
340 main.log.info("ONOS "+str(nodeNum) + " warming up - port down Link-to-graph: "+ str(ptDownLinkToGraph) + " ms")
341 else:
342 portDownLinkToGraphNodeIter[node][i] = ptDownLinkToGraph
343 main.log.info("ONOS "+str(nodeNum) + " port down Link-to-graph: "+ str(ptDownLinkToGraph) + " ms")
344
345 time.sleep(3)
346
347 main.step('Starting wireshark capture for port status up')
348 main.ONOSbench.tsharkGrep(tsharkPortStatus, tsharkPortUp)
349
350 time.sleep(5)
351 main.step('Enable port and obtain timestamp')
352 main.Mininet1.handle.sendline('sh ifconfig ' + interfaceConfig + ' up')
353 main.Mininet1.handle.expect('mininet>')
354
355 jsonStrPtUp = []
356 for node in range (0, clusterCount):
357 metricsPortUp = CLIs[node].topologyEventsMetrics()
358 jsonStrPtUp.append(metricsPortUp)
359
360 time.sleep(5)
361 main.ONOSbench.tsharkStop()
362
363 time.sleep(3)
364
365 fPortUp = open(tsharkPortUp, 'r')
366 fLine = fPortUp.readline()
367 objUp = fLine.split(' ')
368 if len(fLine) > 0:
369 timestampBeginPtUp = int(float(objUp[1]) * 1000)
370 if timestampBeginPtUp < 1400000000000:
371 timestampBeginPtUp = int(float(objUp[2]) * 1000)
372 else:
373 main.log.info('Tshark output file returned unexpected' + ' results.')
374 timestampBeginPtUp = 0
375 fPortUp.close()
376
377 for node in range(0, clusterCount):
378 nodeNum = node+1
379 metricsUp = CLIs[node].topologyEventsMetrics
380 jsonStrUp = metricsUp()
381 jsonObj = json.loads(jsonStrPtUp[node])
382
383 if jsonObj:
384 graphTimestamp = jsonObj[graphTimestampKey]['value']
385 deviceTimestamp = jsonObj[deviceTimestampKey]['value']
386 linkTimestamp = jsonObj[linkTimestampKey]['value']
387 else:
388 main.log.error( "Unexpected json object" )
389 graphTimestamp = 0
390 deviceTimestamp = 0
391 linkTimestamp = 0
392
393
394 main.log.info('ptDownTimestamp: ' + str(timestampBeginPtDown))
395 main.log.info("graphTimestamp: " + str(graphTimestamp))
396 main.log.info("deviceTimestamp: " + str(deviceTimestamp))
397 main.log.info("linkTimestamp: " + str(linkTimestamp))
398
399 ptUpEndToEnd = int(graphTimestamp) - int(timestampBeginPtUp)
400 ptUpOfpToDevice = float(deviceTimestamp) - float(timestampBeginPtUp)
401 ptUpDeviceToLink = float(linkTimestamp) - float(deviceTimestamp)
402 ptUpLinkToGraph = float(graphTimestamp) - float(linkTimestamp)
403
404 if ptUpEndToEnd < upThresholdMin or ptUpEndToEnd >= upThresholdMax:
405 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port up End-to-end: "+ str(ptUpEndToEnd) + " ms")
406 elif i < iterIgnore:
407 main.log.info("ONOS "+str(nodeNum) + " warming up - port up End-to-end: "+ str(ptUpEndToEnd) + " ms")
408 else:
409 portUpEndToEndNodeIter[node][i] = ptUpEndToEnd
410 main.log.info("ONOS "+str(nodeNum) + " port up End-to-end: "+ str(ptUpEndToEnd) + " ms")
411
412 if ptUpOfpToDevice < upThresholdMin or ptUpOfpToDevice >= upThresholdMax:
413 main.log.info("ONOS " + str(nodeNum) + " surpassed threshold - port up Ofp-to-device: "+ str(ptUpOfpToDevice) + " ms")
414 elif i < iterIgnore:
415 main.log.info("ONOS "+ str(nodeNum) + " warming up - port up Ofp-to-device: "+ str(ptUpOfpToDevice) + " ms")
416 else:
417 portUpOfpToDevNodeIter[node][i] = ptUpOfpToDevice
418 main.log.info("ONOS "+ str(nodeNum) + " port up Ofp-to-device: "+ str(ptUpOfpToDevice) + " ms")
419
420 if ptUpDeviceToLink < upThresholdMin or ptUpDeviceToLink >= upThresholdMax:
421 main.log.info("ONOS " +str(nodeNum) + " surpassed threshold - port up Device-to-link: "+ str(ptUpDeviceToLink) + " ms")
422 elif i < iterIgnore:
423 main.log.info("ONOS "+str(nodeNum) + " warming up - port up Device-to-link: "+ str(ptUpDeviceToLink) + " ms")
424 else:
425 portUpDevToLinkNodeIter[node][i] = ptUpDeviceToLink
426 main.log.info("ONOS "+str(nodeNum) + " port up Device-to-link: "+ str(ptUpDeviceToLink) + " ms")
427
428 if ptUpLinkToGraph < upThresholdMin or ptUpLinkToGraph >= upThresholdMax:
429 main.log.info("ONOS " + str(nodeNum) + " surpassed threshold - port up Link-to-graph: " + str(ptUpLinkToGraph) + " ms")
430 elif i < iterIgnore:
431 main.log.info("ONOS " + str(nodeNum) + " warming up - port up Link-to-graph: " + str(ptUpLinkToGraph) + " ms")
432 else:
433 portUpLinkToGraphNodeIter[node][i] = ptUpLinkToGraph
434 main.log.info("ONOS " + str(nodeNum) + " port up Link-to-graph: " + str(ptUpLinkToGraph) + " ms")
435
436 dbCmdList = []
437 for node in range(0, clusterCount):
438 portUpEndToEndList = []
439 portUpOfpToDevList = []
440 portUpDevToLinkList = []
441 portUpLinkToGraphList = []
442
443 portDownEndToEndList = []
444 portDownOfpToDevList = []
445 portDownDevToLinkList = []
446 portDownLinkToGraphList = []
447
448 portUpEndToEndAvg = 0
449 portUpOfpToDevAvg = 0
450 portUpDevToLinkAvg = 0
451 portUpLinkToGraphAvg = 0
452
453 portDownEndToEndAvg = 0
454 portDownOfpToDevAvg = 0
455 portDownDevToLinkAvg = 0
456 portDownLinkToGraphAvg = 0
457
458 # TODO: Update for more pythonic way to get list
459 # portUpDevList = [item for item in portUpDevNodeIter[node]
460 # if item > 0.0]
461 for item in portUpEndToEndNodeIter[node]:
462 if item > 0.0:
463 portUpEndToEndList.append(item)
464
465 for item in portUpOfpToDevNodeIter[node]:
466 if item > 0.0:
467 portUpOfpToDevList.append(item)
468
469 for item in portUpDevToLinkNodeIter[node]:
470 if item > 0.0:
471 portUpDevToLinkList.append(item)
472
473 for item in portUpLinkToGraphNodeIter[node]:
474 if item >= 0.0:
475 portUpLinkToGraphList.append(item)
476
477 for item in portDownEndToEndNodeIter[node]:
478 if item > 0.0:
479 portDownEndToEndList.append(item)
480
481 for item in portDownOfpToDevNodeIter[node]:
482 if item > 0.0:
483 portDownOfpToDevList.append(item)
484
485 for item in portDownDevToLinkNodeIter[node]:
486 if item >= 0.0:
487 portDownDevToLinkList.append(item)
488
489 for item in portDownLinkToGraphNodeIter[node]:
490 if item >= 0.0:
491 portDownLinkToGraphList.append(item)
492
493 portUpEndToEndAvg = round(numpy.mean(portUpEndToEndList), 2)
494 portUpOfpToDevAvg = round(numpy.mean(portUpOfpToDevList), 2)
495 portUpDevToLinkAvg = round(numpy.mean(portUpDevToLinkList), 2)
496 portUpLinkToGraphAvg = round(numpy.mean(portUpLinkToGraphList), 2)
497
498 portDownEndToEndAvg = round(numpy.mean(portDownEndToEndList), 2)
499 portDownOfpToDevAvg = round(numpy.mean(portDownOfpToDevList), 2)
500 portDownDevToLinkAvg = round(numpy.mean(portDownDevToLinkList), 2)
501 portDownLinkToGraphAvg = round(numpy.mean(portDownLinkToGraphList), 2)
502
503 portUpStdDev = round(numpy.std(portUpEndToEndList), 2)
504 portDownStdDev = round(numpy.std(portDownEndToEndList), 2)
505
506 main.log.report(' - Node ' + str(node + 1) + ' Summary ---------------- ')
507 main.log.report(' Port up End-to-end ' +
508 str(portUpEndToEndAvg) + ' ms')
509 main.log.report(' Port up Ofp-to-device ' +
510 str(portUpOfpToDevAvg) + ' ms')
511 main.log.report(' Port up Device-to-link ' +
512 str(portUpDevToLinkAvg) + ' ms')
513 main.log.report(' Port up Link-to-graph ' +
514 str(portUpLinkToGraphAvg) + ' ms')
515
516 main.log.report(' Port down End-to-end ' +
517 str(round(portDownEndToEndAvg, 2)) + ' ms')
518 main.log.report(' Port down Ofp-to-device ' +
519 str(portDownOfpToDevAvg) + ' ms')
520 main.log.report(' Port down Device-to-link ' +
521 str(portDownDevToLinkAvg) + ' ms')
522 main.log.report(' Port down Link-to-graph' +
523 str(portDownLinkToGraphAvg) + ' ms')
524
525 dbCmdList.append("INSERT INTO port_latency_details VALUES('" +
526 timeToPost + "','port_latency_results'," + jenkinsBuildNumber +
527 ',' + str(clusterCount) + ",'baremetal" + str(node + 1) +
528 "'," +
529 str(portUpEndToEndAvg) +',' +
530 str(portUpOfpToDevAvg) + ',' +
531 str(portUpDevToLinkAvg) + ',' +
532 str(portUpLinkToGraphAvg) + ',' +
533 str(portDownEndToEndAvg) + ',' +
534 str(portDownOfpToDevAvg) + ',' +
535 str(portDownDevToLinkAvg) + ',' +
536 str(portDownLinkToGraphAvg) +
537 ');')
538
539 fResult = open(resultPath, 'a')
540 for line in dbCmdList:
541 if line:
542 fResult.write(line + '\n')
543
544 fResult.close()
545
546 # Delete switches from controller to prepare for next
547 # set of tests
548 main.Mininet1.deleteSwController('s1')
549 main.Mininet1.deleteSwController('s2')
550
551 main.log.info("Stopping mininet")
552 main.Mininet1.stopNet()