blob: 3ed5e2715e9787e496e055b1153311e7352fe33e [file] [log] [blame]
YPZhangfebf7302016-05-24 16:45:56 -07001# SCPFintentRerouteLatWithFlowObj
2"""
3SCPFintentRerouteLat
4 - Test Intent Reroute Latency
5 - Test Algorithm:
6 1. Start Null Provider reroute Topology
7 2. Using Push-test-intents to push batch size intents from switch 1 to switch 7
8 3. Cut the link between switch 3 and switch 4 (the path will reroute to switch 8)
9 4. Get the topology time stamp
10 5. Get Intent reroute(Installed) time stamp from each nodes
11 6. Use the latest intent time stamp subtract topology time stamp
12 - This test will run 5 warm up by default, warm up iteration can be setup in Param file
YPZhang8742d2e2016-06-16 15:31:58 -070013 - The intent batch size will default set to 1 and 100, also can be set in Param file
YPZhangfebf7302016-05-24 16:45:56 -070014 - The unit of the latency result is milliseconds
15 - Ues flowObject set to True
16"""
YPZhang737d0012016-03-24 13:56:24 -070017
18class SCPFintentRerouteLatWithFlowObj:
YPZhangfebf7302016-05-24 16:45:56 -070019 def __init__(self):
YPZhang8742d2e2016-06-16 15:31:58 -070020 self.default = ''
YPZhang737d0012016-03-24 13:56:24 -070021
YPZhangfebf7302016-05-24 16:45:56 -070022 def CASE0( self, main ):
23 '''
24 - GIT
25 - BUILDING ONOS
26 Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
27 This step is usually skipped. Because in a Jenkins driven automated
28 test env. We want Jenkins jobs to pull&build for flexibility to handle
29 different versions of ONOS.
30 - Construct tests variables
31 '''
32 gitPull = main.params['GIT']['gitPull']
33 gitBranch = main.params['GIT']['gitBranch']
34
35 main.case("Pull onos branch and build onos on Teststation.")
36
37 if gitPull == 'True':
38 main.step("Git Checkout ONOS branch: " + gitBranch)
39 stepResult = main.ONOSbench.gitCheckout(branch=gitBranch)
40 utilities.assert_equals(expect=main.TRUE,
41 actual=stepResult,
42 onpass="Successfully checkout onos branch.",
43 onfail="Failed to checkout onos branch. Exiting test...")
44 if not stepResult: main.exit()
45
46 main.step("Git Pull on ONOS branch:" + gitBranch)
47 stepResult = main.ONOSbench.gitPull()
48 utilities.assert_equals(expect=main.TRUE,
49 actual=stepResult,
50 onpass="Successfully pull onos. ",
51 onfail="Failed to pull onos. Exiting test ...")
52 if not stepResult: main.exit()
53
54 main.step("Building ONOS branch: " + gitBranch)
55 stepResult = main.ONOSbench.cleanInstall(skipTest=True)
56 utilities.assert_equals(expect=main.TRUE,
57 actual=stepResult,
58 onpass="Successfully build onos.",
59 onfail="Failed to build onos. Exiting test...")
60 if not stepResult: main.exit()
61
62 else:
63 main.log.warn("Skipped pulling onos and Skipped building ONOS")
64
65 main.apps = main.params['ENV']['cellApps']
66 main.BENCHUser = main.params['BENCH']['user']
67 main.BENCHIp = main.params['BENCH']['ip1']
68 main.MN1Ip = main.params['MN']['ip1']
69 main.maxNodes = int(main.params['max'])
70 main.skipMvn = main.params['TEST']['skipCleanInstall']
71 main.cellName = main.params['ENV']['cellName']
72 main.scale = (main.params['SCALE']).split(",")
73 main.dbFileName = main.params['DATABASE']['file']
74 main.timeout = int(main.params['SLEEP']['timeout'])
75 main.startUpSleep = int(main.params['SLEEP']['startup'])
76 main.installSleep = int(main.params['SLEEP']['install'])
77 main.verifySleep = int(main.params['SLEEP']['verify'])
78 main.verifyAttempts = int(main.params['ATTEMPTS']['verify'])
79 main.sampleSize = int(main.params['TEST']['sampleSize'])
80 main.warmUp = int(main.params['TEST']['warmUp'])
81 main.intentsList = (main.params['TEST']['intents']).split(",")
82 main.ingress = main.params['TEST']['ingress']
83 main.egress = main.params['TEST']['egress']
84 main.debug = main.params['TEST']['debug']
YPZhang8742d2e2016-06-16 15:31:58 -070085 for i in range(0, len(main.intentsList)):
YPZhangfebf7302016-05-24 16:45:56 -070086 main.intentsList[i] = int(main.intentsList[i])
YPZhang8742d2e2016-06-16 15:31:58 -070087 # Create DataBase file
88 main.log.info("Create Database file " + main.dbFileName)
89 resultsDB = open(main.dbFileName, "w+")
YPZhangfebf7302016-05-24 16:45:56 -070090 resultsDB.close()
91
YPZhang737d0012016-03-24 13:56:24 -070092 def CASE1( self, main ):
YPZhangfebf7302016-05-24 16:45:56 -070093 '''
94 clean up test environment and set up
95 '''
YPZhang737d0012016-03-24 13:56:24 -070096 import time
97
YPZhang8742d2e2016-06-16 15:31:58 -070098 main.log.info("Get ONOS cluster IP")
YPZhangfebf7302016-05-24 16:45:56 -070099 print(main.scale)
100 main.numCtrls = int(main.scale[0])
101 main.ONOSip = []
102 main.maxNumBatch = 0
103 main.AllONOSip = main.ONOSbench.getOnosIps()
104 for i in range(main.numCtrls):
105 main.ONOSip.append(main.AllONOSip[i])
106 main.log.info(main.ONOSip)
YPZhang8742d2e2016-06-16 15:31:58 -0700107 main.CLIs = []
YPZhangfebf7302016-05-24 16:45:56 -0700108 main.log.info("Creating list of ONOS cli handles")
109 for i in range(main.numCtrls):
110 main.CLIs.append(getattr(main, 'ONOS%scli' % (i + 1)))
YPZhang737d0012016-03-24 13:56:24 -0700111
YPZhangfebf7302016-05-24 16:45:56 -0700112 if not main.CLIs:
113 main.log.error("Failed to create the list of ONOS cli handles")
114 main.cleanup()
115 main.exit()
YPZhang737d0012016-03-24 13:56:24 -0700116
YPZhangfebf7302016-05-24 16:45:56 -0700117 main.commit = main.ONOSbench.getVersion(report=True)
118 main.commit = main.commit.split(" ")[1]
119 main.log.info("Starting up %s node(s) ONOS cluster" % main.numCtrls)
120 main.log.info("Safety check, killing all ONOS processes" +
121 " before initiating environment setup")
YPZhang737d0012016-03-24 13:56:24 -0700122
YPZhangfebf7302016-05-24 16:45:56 -0700123 for i in range(main.numCtrls):
124 main.ONOSbench.onosDie(main.ONOSip[i])
YPZhang737d0012016-03-24 13:56:24 -0700125
YPZhangfebf7302016-05-24 16:45:56 -0700126 main.log.info("NODE COUNT = %s" % main.numCtrls)
YPZhangfebf7302016-05-24 16:45:56 -0700127 main.ONOSbench.createCellFile(main.ONOSbench.ip_address,
128 main.cellName,
129 main.MN1Ip,
130 main.apps,
YPZhang8742d2e2016-06-16 15:31:58 -0700131 main.ONOSip)
YPZhangfebf7302016-05-24 16:45:56 -0700132 main.step("Apply cell to environment")
133 cellResult = main.ONOSbench.setCell(main.cellName)
134 verifyResult = main.ONOSbench.verifyCell()
135 stepResult = cellResult and verifyResult
136 utilities.assert_equals(expect=main.TRUE,
137 actual=stepResult,
138 onpass="Successfully applied cell to " + \
139 "environment",
140 onfail="Failed to apply cell to environment ")
YPZhang737d0012016-03-24 13:56:24 -0700141
YPZhangfebf7302016-05-24 16:45:56 -0700142 main.step("Creating ONOS package")
YPZhang737d0012016-03-24 13:56:24 -0700143 packageResult = main.ONOSbench.onosPackage()
YPZhangfebf7302016-05-24 16:45:56 -0700144 stepResult = packageResult
145 utilities.assert_equals(expect=main.TRUE,
146 actual=stepResult,
147 onpass="Successfully created ONOS package",
148 onfail="Failed to create ONOS package")
YPZhang737d0012016-03-24 13:56:24 -0700149
YPZhangfebf7302016-05-24 16:45:56 -0700150 main.step("Uninstall ONOS package on all Nodes")
151 uninstallResult = main.TRUE
152 for i in range(int(main.numCtrls)):
153 main.log.info("Uninstalling package on ONOS Node IP: " + main.ONOSip[i])
154 u_result = main.ONOSbench.onosUninstall(main.ONOSip[i])
155 utilities.assert_equals(expect=main.TRUE, actual=u_result,
156 onpass="Test step PASS",
157 onfail="Test step FAIL")
158 uninstallResult = (uninstallResult and u_result)
YPZhang737d0012016-03-24 13:56:24 -0700159
YPZhangfebf7302016-05-24 16:45:56 -0700160 main.step("Install ONOS package on all Nodes")
161 installResult = main.TRUE
162 for i in range(int(main.numCtrls)):
163 main.log.info("Installing package on ONOS Node IP: " + main.ONOSip[i])
164 i_result = main.ONOSbench.onosInstall(node=main.ONOSip[i])
165 utilities.assert_equals(expect=main.TRUE, actual=i_result,
166 onpass="Test step PASS",
167 onfail="Test step FAIL")
168 installResult = installResult and i_result
YPZhang737d0012016-03-24 13:56:24 -0700169
YPZhangfebf7302016-05-24 16:45:56 -0700170 main.step("Verify ONOS nodes UP status")
171 statusResult = main.TRUE
172 for i in range(int(main.numCtrls)):
173 main.log.info("ONOS Node " + main.ONOSip[i] + " status:")
174 onos_status = main.ONOSbench.onosStatus(node=main.ONOSip[i])
175 utilities.assert_equals(expect=main.TRUE, actual=onos_status,
176 onpass="Test step PASS",
177 onfail="Test step FAIL")
178 statusResult = (statusResult and onos_status)
179 time.sleep(2)
180 main.step("Start ONOS CLI on all nodes")
181 cliResult = main.TRUE
182 main.log.step(" Start ONOS cli using thread ")
183 startCliResult = main.TRUE
184 pool = []
YPZhang8742d2e2016-06-16 15:31:58 -0700185 main.threadID = 0
YPZhangfebf7302016-05-24 16:45:56 -0700186 for i in range(int(main.numCtrls)):
187 t = main.Thread(target=main.CLIs[i].startOnosCli,
188 threadID=main.threadID,
189 name="startOnosCli",
190 args=[main.ONOSip[i]],
191 kwargs={"onosStartTimeout": main.timeout})
192 pool.append(t)
193 t.start()
194 main.threadID = main.threadID + 1
195 for t in pool:
196 t.join()
197 startCliResult = startCliResult and t.result
198 time.sleep(main.startUpSleep)
YPZhang737d0012016-03-24 13:56:24 -0700199
YPZhangfebf7302016-05-24 16:45:56 -0700200 # configure apps
201 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
202 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "topoShape", value="reroute")
203 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
204 main.CLIs[0].setCfg("org.onosproject.store.flow.impl.DistributedFlowRuleStore", "backupEnabled", value="false")
205 main.CLIs[0].setCfg("org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator",
206 "useFlowObjectives", value="true")
YPZhang8742d2e2016-06-16 15:31:58 -0700207
YPZhangfebf7302016-05-24 16:45:56 -0700208 time.sleep(main.startUpSleep)
YPZhang737d0012016-03-24 13:56:24 -0700209
YPZhangfebf7302016-05-24 16:45:56 -0700210 # Balance Master
211 main.CLIs[0].balanceMasters()
212 if len(main.ONOSip) > 1:
213 main.CLIs[0].deviceRole("null:0000000000000003", main.ONOSip[0])
214 main.CLIs[0].deviceRole("null:0000000000000004", main.ONOSip[0])
YPZhang737d0012016-03-24 13:56:24 -0700215
YPZhang8742d2e2016-06-16 15:31:58 -0700216 def CASE2( self, main ):
YPZhang737d0012016-03-24 13:56:24 -0700217 import time
218 import numpy
219 import datetime
YPZhangfebf7302016-05-24 16:45:56 -0700220 import json
221 # from scipy import stats
YPZhang737d0012016-03-24 13:56:24 -0700222
223 ts = time.time()
YPZhang8742d2e2016-06-16 15:31:58 -0700224 print(main.intentsList)
YPZhangfebf7302016-05-24 16:45:56 -0700225 for batchSize in main.intentsList:
226 main.log.report("Intent Batch size: " + str(batchSize) + "\n ")
227 main.LatencyList = []
YPZhang8742d2e2016-06-16 15:31:58 -0700228 validRun = 0
229 invalidRun = 0
230 while validRun <= main.warmUp + main.sampleSize and invalidRun <= 20:
231 if validRun >= main.warmUp:
232 main.log.info("================================================")
233 main.log.info("Starting test iteration: {} ".format(validRun - main.warmUp))
234 main.log.info("Total iteration: {}".format(validRun + invalidRun))
235 main.log.info("================================================")
YPZhang737d0012016-03-24 13:56:24 -0700236 else:
YPZhang8742d2e2016-06-16 15:31:58 -0700237 main.log.info("====================Warm Up=====================")
YPZhang737d0012016-03-24 13:56:24 -0700238
YPZhangfebf7302016-05-24 16:45:56 -0700239 # push intents
240 main.CLIs[0].pushTestIntents(main.ingress, main.egress, batchSize,
YPZhang8742d2e2016-06-16 15:31:58 -0700241 offset=1, options="-i", timeout=main.timeout)
YPZhang737d0012016-03-24 13:56:24 -0700242
YPZhangfebf7302016-05-24 16:45:56 -0700243 # check links and flows
244 k = 0
245 verify = main.FALSE
246 linkCheck = 0
247 flowsCheck = 0
248 while k <= main.verifyAttempts:
YPZhang8742d2e2016-06-16 15:31:58 -0700249 time.sleep(main.verifySleep)
250 summary = json.loads(main.CLIs[0].summary(timeout=main.timeout))
YPZhangfebf7302016-05-24 16:45:56 -0700251 linkCheck = summary.get("links")
252 flowsCheck = summary.get("flows")
YPZhang8742d2e2016-06-16 15:31:58 -0700253 if linkCheck == 16 and flowsCheck == batchSize * 7:
254 main.log.info("links: {}, flows: {} ".format(linkCheck, flowsCheck))
YPZhangfebf7302016-05-24 16:45:56 -0700255 verify = main.TRUE
256 break
257 k += 1
258 if not verify:
YPZhang8742d2e2016-06-16 15:31:58 -0700259 main.log.warn("Links or flows number are not match!")
260 main.log.warn("links: {}, flows: {} ".format(linkCheck, flowsCheck))
261 # bring back topology
262 main.log.info("Bring back topology...")
263 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
264 time.sleep(1)
265 main.CLIs[0].purgeWithdrawnIntents()
266 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
267 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
268 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
269 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
270 if validRun >= main.warmUp:
271 invalidRun += 1
272 continue
273 else:
274 validRun += 1
275 continue
YPZhang737d0012016-03-24 13:56:24 -0700276
YPZhangfebf7302016-05-24 16:45:56 -0700277 # Bring link down
278 main.CLIs[0].link("0000000000000004/1", "0000000000000003/2", "down",
YPZhang8742d2e2016-06-16 15:31:58 -0700279 timeout=main.timeout, showResponse=False)
YPZhangfebf7302016-05-24 16:45:56 -0700280 verify = main.FALSE
281 k = 0
282 topoManagerLog = ""
283 while k <= main.verifyAttempts:
284 time.sleep(main.verifySleep)
YPZhang8742d2e2016-06-16 15:31:58 -0700285 summary = json.loads(main.CLIs[0].summary(timeout=main.timeout))
YPZhangfebf7302016-05-24 16:45:56 -0700286 linkCheck = summary.get("links")
287 flowsCheck = summary.get("flows")
288 if linkCheck == 14:
YPZhang8742d2e2016-06-16 15:31:58 -0700289 main.log.info("links: {}, flows: {} ".format(linkCheck, flowsCheck))
YPZhangfebf7302016-05-24 16:45:56 -0700290 verify = main.TRUE
291 break
292 k += 1
293 if not verify:
YPZhang8742d2e2016-06-16 15:31:58 -0700294 main.log.warn("Links number are not match in TopologyManager log!")
295 main.log.warn(topoManagerLog)
296 # bring back topology
297 main.log.info("Bring back topology...")
298 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
299 time.sleep(1)
300 main.CLIs[0].purgeWithdrawnIntents()
301 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
302 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
303 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
304 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
305 if validRun >= main.warmUp:
306 invalidRun += 1
307 continue
308 else:
309 validRun += 1
310 continue
YPZhang737d0012016-03-24 13:56:24 -0700311
YPZhangfebf7302016-05-24 16:45:56 -0700312 try:
313 # expect twice to clean the pexpect buffer
314 main.ONOSbench.handle.sendline("")
315 main.ONOSbench.handle.expect("\$")
316 main.ONOSbench.handle.expect("\$")
317 # send line by using bench, can't use driver because pexpect buffer problem
318 cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
319 main.ONOSbench.handle.sendline(cmd)
320 time.sleep(1)
321 main.ONOSbench.handle.expect(":~")
322 topoManagerLog = main.ONOSbench.handle.before
323 topoManagerLogTemp = topoManagerLog.splitlines()
324 # To make sure we get correct topology log
325 for lines in topoManagerLogTemp:
326 if "creationTime" in lines:
327 topoManagerLog = lines
328 main.log.info("Topology Manager log:")
329 print(topoManagerLog)
330 cutTimestamp = float(topoManagerLog.split("creationTime=")[1].split(",")[0])
331 except:
332 main.log.error("Topology Log is not correct!")
333 print(topoManagerLog)
YPZhang8742d2e2016-06-16 15:31:58 -0700334 # bring back topology
335 main.log.info("Bring back topology...")
336 verify = main.FALSE
337 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
338 time.sleep(1)
339 main.CLIs[0].purgeWithdrawnIntents()
340 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
341 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
342 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
343 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
344 if validRun >= main.warmUp:
345 invalidRun += 1
346 else:
347 validRun += 1
YPZhangfebf7302016-05-24 16:45:56 -0700348 # If we got wrong Topology log, we should skip this iteration, and continue for next one
349 continue
350
351 installedTemp = []
YPZhang8742d2e2016-06-16 15:31:58 -0700352 time.sleep(10)
YPZhangfebf7302016-05-24 16:45:56 -0700353 for cli in main.CLIs:
YPZhang8742d2e2016-06-16 15:31:58 -0700354 tempJson = json.loads(cli.intentsEventsMetrics())
YPZhangfebf7302016-05-24 16:45:56 -0700355 Installedtime = tempJson.get('intentInstalledTimestamp').get('value')
356 installedTemp.append(float(Installedtime))
357 for i in range(0, len(installedTemp)):
YPZhang8742d2e2016-06-16 15:31:58 -0700358 main.log.info("ONOS Node {} Installed Time stemp: {}".format((i + 1), installedTemp[i]))
359 maxInstallTime = float(max(installedTemp))
360 if validRun >= main.warmUp and verify:
361 main.log.info("Installed time stemp: {0:f}".format(maxInstallTime))
362 main.log.info("CutTimestamp: {0:f}".format(cutTimestamp))
YPZhangfebf7302016-05-24 16:45:56 -0700363 # Both timeStemps are milliseconds
YPZhang8742d2e2016-06-16 15:31:58 -0700364 main.log.info("Latency: {0:f}".format(float(maxInstallTime - cutTimestamp)))
365 if float(maxInstallTime - cutTimestamp) < 0:
366 main.log.info("Latency less than 0!")
367 # bring back topology
368 main.log.info("Bring back topology...")
369 verify = main.FALSE
370 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
371 time.sleep(1)
372 main.CLIs[0].purgeWithdrawnIntents()
373 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
374 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
375 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
376 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
377 if validRun >= main.warmUp:
378 invalidRun += 1
379 else:
380 validRun += 1
381 continue
382 main.LatencyList.append(float(maxInstallTime - cutTimestamp))
383 # We get valid latency, validRun + 1
384 validRun += 1
YPZhangfebf7302016-05-24 16:45:56 -0700385
386 # Verify Summary after we bring up link, and withdrawn intents
YPZhang8742d2e2016-06-16 15:31:58 -0700387 main.CLIs[0].link("0000000000000004/1", "0000000000000003/2", "up",
388 timeout=main.timeout)
YPZhangfebf7302016-05-24 16:45:56 -0700389 k = 0
390 verify = main.FALSE
391 linkCheck = 0
392 flowsCheck = 0
393 while k <= main.verifyAttempts:
394 time.sleep(main.verifySleep)
YPZhang8742d2e2016-06-16 15:31:58 -0700395 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
YPZhangfebf7302016-05-24 16:45:56 -0700396 time.sleep(1)
397 main.CLIs[0].purgeWithdrawnIntents()
YPZhang8742d2e2016-06-16 15:31:58 -0700398 summary = json.loads(main.CLIs[0].summary())
YPZhangfebf7302016-05-24 16:45:56 -0700399 linkCheck = summary.get("links")
400 flowsCheck = summary.get("flows")
401 intentCheck = summary.get("intents")
402 if linkCheck == 16 and flowsCheck == 0 and intentCheck == 0:
403 main.log.info("links: {}, flows: {}, intents: {} ".format(linkCheck, flowsCheck, intentCheck))
404 verify = main.TRUE
405 break
406 k += 1
407 if not verify:
408 main.log.error("links, flows, or intents are not correct!")
409 main.log.info("links: {}, flows: {}, intents: {} ".format(linkCheck, flowsCheck, intentCheck))
YPZhang8742d2e2016-06-16 15:31:58 -0700410 # bring back topology
411 main.log.info("Bring back topology...")
412 main.CLIs[0].removeAllIntents(purge=True, sync=True, timeout=main.timeout)
413 time.sleep(1)
414 main.CLIs[0].purgeWithdrawnIntents()
415 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=0)
416 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="false")
417 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "deviceCount", value=8)
418 main.CLIs[0].setCfg("org.onosproject.provider.nil.NullProviders", "enabled", value="true")
YPZhangfebf7302016-05-24 16:45:56 -0700419 continue
420
YPZhang8742d2e2016-06-16 15:31:58 -0700421 aveLatency = 0
422 stdLatency = 0
YPZhangfebf7302016-05-24 16:45:56 -0700423 aveLatency = numpy.average(main.LatencyList)
424 stdLatency = numpy.std(main.LatencyList)
425 main.log.report("Scale: " + str(main.numCtrls) + " \tIntent batch: " + str(batchSize))
426 main.log.report("Latency average:................" + str(aveLatency))
427 main.log.report("Latency standard deviation:....." + str(stdLatency))
YPZhang737d0012016-03-24 13:56:24 -0700428 main.log.report("________________________________________________________")
429
YPZhang8742d2e2016-06-16 15:31:58 -0700430 if not (numpy.isnan(aveLatency) or numpy.isnan(stdLatency)):
431 # check if got NaN for result
432 resultsDB = open(main.dbFileName, "a")
433 resultsDB.write("'" + main.commit + "',")
434 resultsDB.write(str(main.numCtrls) + ",")
435 resultsDB.write(str(batchSize) + ",")
436 resultsDB.write(str(aveLatency) + ",")
437 resultsDB.write(str(stdLatency) + "\n")
438 resultsDB.close()
YPZhangfebf7302016-05-24 16:45:56 -0700439 del main.scale[0]