blob: e8a286eadc6b5a21efdef6647a84f7099813791f [file] [log] [blame]
santhosh91195f12014-08-07 13:53:50 -07001class scaleONOS7nodes :
2
3
4
5 def __init__(self) :
6 self.default = ''
7
8# def print_hello_world(self,main):
9# print("hello world")
10#*****************************************************************************************************************************************************************************************
11#Test startup
12#Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully
13 def CASE1(self,main) : #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
14 main.case("Initial setup")
15 main.step("Stop ONOS")
16 import time
17 main.ONOS1.stop_all()
18 main.ONOS2.stop_all()
19 main.ONOS3.stop_all()
20# main.print_hello_world()
21 main.ONOS4.stop_all()
22 # main.ONOS5.stop_all()
23 # main.ONOS6.stop_all()
24 # main.ONOS7.stop_all()
25 main.ONOS2.stop_rest()
26 #main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
27 #main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
28 #main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
29 #main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
30 #main.step("Start tcpdump on mn")
31 #main.Mininet2.start_tcpdump(main.params['tcpdump']['filename'], intf = main.params['tcpdump']['intf'], port = main.params['tcpdump']['port'])
32 main.step("Start ONOS")
33 main.Zookeeper1.start()
34 main.Zookeeper2.start()
35 main.Zookeeper3.start()
36 main.Zookeeper4.start()
37 time.sleep(5)
38
39
40 main.RamCloud1.del_db()
41 main.RamCloud2.del_db()
42 main.RamCloud3.del_db()
43 main.RamCloud4.del_db()
44
45 time.sleep(5)
46 #main.log.report("Pulling latest code from github to all nodes")
47
48 """
49 for i in range(2):
50 uptodate = main.ONOS1.git_pull()
51 main.ONOS2.git_pull()
52 main.ONOS3.git_pull()
53 # main.ONOS4.git_pull()
54 ver1 = main.ONOS1.get_version()
55 ver2 = main.ONOS3.get_version()
56 if ver1==ver2:
57 break
58 elif i==1:
59 main.ONOS2.git_pull("ONOS1 master")
60 main.ONOS3.git_pull("ONOS1 master")
61 # main.ONOS4.git_pull("ONOS1 master")
62 if uptodate==0:
63 # if 1:
64 main.ONOS1.git_compile()
65 main.ONOS2.git_compile()
66 main.ONOS3.git_compile()
67 # main.ONOS4.git_compile()
68 main.ONOS1.print_version()
69 # main.RamCloud1.git_pull()
70 # main.RamCloud2.git_pull()
71 # main.RamCloud3.git_pull()
72 # main.RamCloud4.git_pull()
73 # main.ONOS1.get_version()
74 # main.ONOS2.get_version()
75 # main.ONOS3.get_version()
76 # main.ONOS4.get_version()
77 # main.ONOS1.start_all()
78 # main.ONOS2.start_all()
79 # main.ONOS3.start_all()
80 # main.ONOS4.start_all()
81
82 """
83 main.RamCloud1.start_coor()
84 main.RamCloud1.start_serv()
85 main.RamCloud2.start_serv()
86 main.RamCloud3.start_serv()
87 #main.RamCloud4.start_serv()
88
89 main.ONOS1.start()
90 main.ONOS2.start()
91 main.ONOS3.start()
92 #main.ONOS4.start()
93
94
95
96 main.ONOS1.start_rest()
97 main.ONOS2.start_rest()
98 main.ONOS3.start_rest()
99 test= main.ONOS2.rest_status()
100 if test == main.FALSE:
101 main.ONOS1.start_rest()
102 main.ONOS1.get_version()
103 main.log.report("Startup check Zookeeper1, RamCloud1, and ONOS1 connections")
104 main.step("Testing startup Zookeeper")
105 data = main.Zookeeper1.isup() and main.Zookeeper2.isup() and main.Zookeeper3.isup()
106 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
107
108 main.step("Testing startup RamCloud")
109 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
110 if data == main.FALSE:
111 main.RamCloud1.stop_coor()
112 main.RamCloud1.stop_serv()
113 main.RamCloud2.stop_serv()
114 main.RamCloud3.stop_serv()
115 # main.RamCloud4.stop_serv()
116
117 time.sleep(5)
118 main.RamCloud1.start_coor()
119 main.RamCloud1.start_serv()
120 main.RamCloud2.start_serv()
121 main.RamCloud3.start_serv()
122 # main.RamCloud4.start_serv()
123 time.sleep(5)
124 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
125
126
127
128 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...")
129
130 main.step("Testing startup ONOS")
131 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
132 for i in range(3):
133 if data == main.FALSE:
134 #main.log.report("Something is funny... restarting ONOS")
135 #main.ONOS1.stop()
136 time.sleep(3)
137 #main.ONOS1.start()
138 #time.sleep(5)
139 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
140 else:
141 break
142 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
143 time.sleep(10)
144
145
146 def CASE2(self,main) :
147 ip1 = main.params['CTRL']['ip1']
148 ip2 = main.params['CTRL']['ip2']
149 ip3 = main.params['CTRL']['ip3']
150 rate1 = main.params['RATE1']
151 run_dur = main.params['RUN_DUR']
152 loop = int( main.params['loop'])
153 port = main.params['port']
154 switches_num = main.params['switches_num']
155 print loop
156 sleep_t =int( main.params['sleep_t'])
157 main.case("Starting SB load on 3 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
158 main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
159 main.Mininet2.handle.expect("starting to generate south bound load ....", timeout=400)
160 import time
161 import json
162 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", 'w').close()
163 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
164 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
165 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
166 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", "a")
167 #time.sleep(10)
168 for i in range(int (loop)):
169 json_str1 = main.ONOS1.get_json(url1)
170 json_str2 = main.ONOS2.get_json(url2)
171 json_str3 = main.ONOS3.get_json(url3)
172 if json_str1 != "" and json_str2 != "" and json_str3 != "":
173 # write_str = str(json_str["meters"][4]["meter"][2])
174 #print str(json_str["meters"][4])
175 #f.write(str(json_str["meters"][4]))
176 #f.write('\n')
177 #time.sleep(3)
178 f.write("ONOS1 \n")
179 f.write(str(json_str1["meters"][4]['meter']['count']))
180 f.write('\t')
181 f.write(str(json_str1["meters"][4]['meter']['m1_rate']))
182 f.write('\t')
183 f.write(str(json_str1["meters"][4]['meter']['m5_rate']))
184 f.write('\t')
185 f.write(str(json_str1["meters"][4]['meter']['m15_rate']))
186 f.write('\t')
187 f.write(str(json_str1["meters"][4]['meter']['mean_rate']))
188 f.write('\n')
189 f.write("ONOS2 \n")
190 f.write(str(json_str2["meters"][4]['meter']['count']))
191 f.write('\t')
192 f.write(str(json_str2["meters"][4]['meter']['m1_rate']))
193 f.write('\t')
194 f.write(str(json_str2["meters"][4]['meter']['m5_rate']))
195 f.write('\t')
196 f.write(str(json_str2["meters"][4]['meter']['m15_rate']))
197 f.write('\t')
198 f.write(str(json_str2["meters"][4]['meter']['mean_rate']))
199 f.write('\n')
200 f.write("ONOS3 \n")
201 f.write(str(json_str3["meters"][4]['meter']['count']))
202 f.write('\t')
203 f.write(str(json_str3["meters"][4]['meter']['m1_rate']))
204 f.write('\t')
205 f.write(str(json_str3["meters"][4]['meter']['m5_rate']))
206 f.write('\t')
207 f.write(str(json_str3["meters"][4]['meter']['m15_rate']))
208 f.write('\t')
209 f.write(str(json_str3["meters"][4]['meter']['mean_rate']))
210 f.write('\n')
211 f.write('\n')
212
213 f.write("--------------------------------------------------------------------------------- \n")
214 time.sleep(sleep_t)
215 f.close()
216 main.Mininet2.handle.expect("\$", timeout=900)
217 # main.Mininet2.handle.sendline("sudo mn -c")
218 #main.Mininet2.handle.expect("\$")
219 time.sleep(5)
220 # main.Mininet2.handle.expect("\$", timeout=900)
221
222
223 def CASE3(self,main):
224 ip1 = main.params['CTRL']['ip1']
225 ip2 = main.params['CTRL']['ip2']
226 ip3 = main.params['CTRL']['ip3']
227 import time
228 rate2 = main.params['RATE2']
229 run_dur = main.params['RUN_DUR']
230 loop = int(main.params['loop'])
231 sleep_t = int(main.params['sleep_t'])
232 port = main.params['port']
233 switches_num = main.params['switches_num']
234 main.case("Starting SB load on 3 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
235 main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
236 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"10.128.10.1\" 100 50 1200 \"11\"")
237 main.Mininet2.handle.expect("starting to generate south bound load ....", timeout=900 )
238
239 import json
240
241 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", 'w').close()
242 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
243 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
244 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
245 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", "a")
246 #time.sleep(10)
247 for i in range(int (loop)):
248 json_str1 = main.ONOS1.get_json(url1)
249 json_str2 = main.ONOS2.get_json(url2)
250 json_str3 = main.ONOS3.get_json(url3)
251 if json_str1 != "" and json_str2 != "" and json_str3 != "":
252 # write_str = str(json_str["meters"][4]["meter"][2])
253 #print str(json_str["meters"][4])
254 #f.write(str(json_str["meters"][4]))
255 #f.write('\n')
256 #time.sleep(3)
257 f.write("ONOS1 \n")
258 f.write(str(json_str1["meters"][4]['meter']['count']))
259 f.write('\t')
260 f.write(str(json_str1["meters"][4]['meter']['m1_rate']))
261 f.write('\t')
262 f.write(str(json_str1["meters"][4]['meter']['m5_rate']))
263 f.write('\t')
264 f.write(str(json_str1["meters"][4]['meter']['m15_rate']))
265 f.write('\t')
266 f.write(str(json_str1["meters"][4]['meter']['mean_rate']))
267 f.write('\n')
268 f.write("ONOS2 \n")
269 f.write(str(json_str2["meters"][4]['meter']['count']))
270 f.write('\t')
271 f.write(str(json_str2["meters"][4]['meter']['m1_rate']))
272 f.write('\t')
273 f.write(str(json_str2["meters"][4]['meter']['m5_rate']))
274 f.write('\t')
275 f.write(str(json_str2["meters"][4]['meter']['m15_rate']))
276 f.write('\t')
277 f.write(str(json_str2["meters"][4]['meter']['mean_rate']))
278 f.write('\n')
279 f.write("ONOS3 \n")
280 f.write(str(json_str3["meters"][4]['meter']['count']))
281 f.write('\t')
282 f.write(str(json_str3["meters"][4]['meter']['m1_rate']))
283 f.write('\t')
284 f.write(str(json_str3["meters"][4]['meter']['m5_rate']))
285 f.write('\t')
286 f.write(str(json_str3["meters"][4]['meter']['m15_rate']))
287 f.write('\t')
288 f.write(str(json_str3["meters"][4]['meter']['mean_rate']))
289 f.write('\n')
290 f.write('\n')
291 f.write("--------------------------------------------------------------------------------- \n")
292 time.sleep(sleep_t)
293 f.close()
294 main.Mininet2.handle.expect("\$", timeout=900)
295 # main.Mininet2.handle.sendline("sudo mn -c")
296 #time.sleep(5)
297 # main.Mininet2.handle.expect("\$", timeout=900)
298
299
300 def CASE4(self,main):
301
302 main.case("Starting NB Throughput test")
303 ip1 = main.params['CTRL']['ip1']
304 ip2 = main.params['CTRL']['ip2']
305 ip3 = main.params['CTRL']['ip3']
306 import time
307 import json
308
309 main.Mininet4.handle.expect("\$")
310 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
311 #main.Mininet2.handle.expect("mininet>" , timeout=400)
312 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
313 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.1:6633")
314 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.2:6633")
315 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.2:6633")
316 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.3:6633")
317 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
318 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.3:6633")
319
320 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
321 main.ONOS3.handle.expect("\$")
322
323 main.ONOS3.handle.sendline("./multiLoadgen_NB.py -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 \" -i 4 -g 100 -a 1 -d 1 -p 0")
324 main.ONOS3.handle.expect("intent group is : 0", timeout=900)
325
326
327 import json
328
329 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
330 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
331 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
332 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
333 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
334 #time.sleep(10)
335 for i in range(8):
336 json_str1 = main.ONOS1.get_json(url1)
337 json_str2 = main.ONOS2.get_json(url2)
338 json_str3 = main.ONOS3.get_json(url3)
339 if json_str1 != "" and json_str2 != "" and json_str3 != "":
340 f.write("ONOS1......IncomingRate \n ")
341 f.write(str(json_str1["meters"][0]['meter']['count']))
342 f.write('\t')
343 f.write(str(json_str1["meters"][0]['meter']['m1_rate']))
344 f.write('\t')
345 f.write(str(json_str1["meters"][0]['meter']['m5_rate']))
346 f.write('\t')
347 f.write(str(json_str1["meters"][0]['meter']['m15_rate']))
348 f.write('\t')
349 f.write(str(json_str1["meters"][0]['meter']['mean_rate']))
350 f.write('\n')
351 f.write("ONOS2......IncomingRate \n")
352 f.write(str(json_str2["meters"][0]['meter']['count']))
353 f.write('\t')
354 f.write(str(json_str2["meters"][0]['meter']['m1_rate']))
355 f.write('\t')
356 f.write(str(json_str2["meters"][0]['meter']['m5_rate']))
357 f.write('\t')
358 f.write(str(json_str2["meters"][0]['meter']['m15_rate']))
359 f.write('\t')
360 f.write(str(json_str2["meters"][0]['meter']['mean_rate']))
361 f.write('\n')
362 f.write("ONOS3......IncomingRate \n")
363 f.write(str(json_str3["meters"][0]['meter']['count']))
364 f.write('\t')
365 f.write(str(json_str3["meters"][0]['meter']['m1_rate']))
366 f.write('\t')
367 f.write(str(json_str3["meters"][0]['meter']['m5_rate']))
368 f.write('\t')
369 f.write(str(json_str3["meters"][0]['meter']['m15_rate']))
370 f.write('\t')
371 f.write(str(json_str3["meters"][0]['meter']['mean_rate']))
372 f.write('\n')
373 f.write('\n')
374
375 f.write("--------------------------------------------------------------------------------- \n")
376
377 f.write("ONOS1......ProcessingRate \n ")
378 f.write(str(json_str1["meters"][1]['meter']['count']))
379 f.write('\t')
380 f.write(str(json_str1["meters"][1]['meter']['m1_rate']))
381 f.write('\t')
382 f.write(str(json_str1["meters"][1]['meter']['m5_rate']))
383 f.write('\t')
384 f.write(str(json_str1["meters"][1]['meter']['m15_rate']))
385 f.write('\t')
386 f.write(str(json_str1["meters"][1]['meter']['mean_rate']))
387 f.write('\n')
388 f.write("ONOS2......ProcessingRate \n")
389 f.write(str(json_str2["meters"][1]['meter']['count']))
390 f.write('\t')
391 f.write(str(json_str2["meters"][1]['meter']['m1_rate']))
392 f.write('\t')
393 f.write(str(json_str2["meters"][1]['meter']['m5_rate']))
394 f.write('\t')
395 f.write(str(json_str2["meters"][1]['meter']['m15_rate']))
396 f.write('\t')
397 f.write(str(json_str2["meters"][1]['meter']['mean_rate']))
398 f.write('\n')
399 f.write("ONOS3......ProcessingRate \n")
400 f.write(str(json_str3["meters"][1]['meter']['count']))
401 f.write('\t')
402 f.write(str(json_str3["meters"][1]['meter']['m1_rate']))
403 f.write('\t')
404 f.write(str(json_str3["meters"][1]['meter']['m5_rate']))
405 f.write('\t')
406 f.write(str(json_str3["meters"][1]['meter']['m15_rate']))
407 f.write('\t')
408 f.write(str(json_str3["meters"][1]['meter']['mean_rate']))
409 f.write('\n')
410 f.write('\n')
411
412 f.write("--------------------------------------------------------------------------------- \n")
413 time.sleep(10)
414 f.close()
415
416 main.ONOS3.handle.expect("\$", timeout=900)
417
418 def CASE5(self,main):
419
420 main.case("Starting ONOS scale-up to 4 nodes ")
421 import time
422 # main.RamCloud4.start_serv()
423 main.Zookeeper1.start()
424 main.ONOS4.start()
425 main.ONOS4.start_rest()
426 time.sleep(5)
427 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
428 for i in range(3):
429 if data == main.FALSE:
430 #main.log.report("Something is funny... restarting ONOS")
431 #main.ONOS1.stop()
432 time.sleep(3)
433 #main.ONOS1.start()
434 #time.sleep(5)
435 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
436 else:
437 break
438 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
439 time.sleep(10)
440
441 def CASE6(self,main):
442
443 ip1 = main.params['CTRL']['ip1']
444 ip2 = main.params['CTRL']['ip2']
445 ip3 = main.params['CTRL']['ip3']
446 ip4 = main.params['CTRL']['ip4']
447 rate1 = main.params['RATE1']
448 run_dur = main.params['RUN_DUR']
449 loop = int( main.params['loop'])
450 switches_num = main.params['switches_num']
451 port = main.params['port']
452 print loop
453 sleep_t =int( main.params['sleep_t'])
454 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
455 main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
456 main.Mininet2.handle.expect("starting to generate south bound load ....", timeout=900)
457 import time
458 import json
459 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
460 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
461 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
462 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
463 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
464
465 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
466 #time.sleep(10)
467 for i in range(int (loop)):
468 json_str1 = main.ONOS1.get_json(url1)
469 json_str2 = main.ONOS2.get_json(url2)
470 json_str3 = main.ONOS3.get_json(url3)
471 json_str4 = main.ONOS4.get_json(url4)
472 if json_str1 != "" and json_str2 != "" and json_str3 != "" and json_str4 != "":
473 # write_str = str(json_str["meters"][4]["meter"][2])
474 #print str(json_str["meters"][4])
475 #f.write(str(json_str["meters"][4]))
476 #f.write('\n')
477 #time.sleep(3)
478
479 f.write("ONOS1 \n")
480 f.write(str(json_str1["meters"][4]['meter']['count']))
481 f.write('\t')
482 f.write(str(json_str1["meters"][4]['meter']['m1_rate']))
483 f.write('\t')
484 f.write(str(json_str1["meters"][4]['meter']['m5_rate']))
485 f.write('\t')
486 f.write(str(json_str1["meters"][4]['meter']['m15_rate']))
487 f.write('\t')
488 f.write(str(json_str1["meters"][4]['meter']['mean_rate']))
489 f.write('\n')
490
491 f.write("ONOS2 \n")
492 f.write(str(json_str2["meters"][4]['meter']['count']))
493 f.write('\t')
494 f.write(str(json_str2["meters"][4]['meter']['m1_rate']))
495 f.write('\t')
496 f.write(str(json_str2["meters"][4]['meter']['m5_rate']))
497 f.write('\t')
498 f.write(str(json_str2["meters"][4]['meter']['m15_rate']))
499 f.write('\t')
500 f.write(str(json_str2["meters"][4]['meter']['mean_rate']))
501 f.write('\n')
502
503 f.write("ONOS3 \n")
504 f.write(str(json_str3["meters"][4]['meter']['count']))
505 f.write('\t')
506 f.write(str(json_str3["meters"][4]['meter']['m1_rate']))
507 f.write('\t')
508 f.write(str(json_str3["meters"][4]['meter']['m5_rate']))
509 f.write('\t')
510 f.write(str(json_str3["meters"][4]['meter']['m15_rate']))
511 f.write('\t')
512 f.write(str(json_str3["meters"][4]['meter']['mean_rate']))
513 f.write('\n')
514
515 f.write("ONOS4 \n")
516 f.write(str(json_str4["meters"][4]['meter']['count']))
517 f.write('\t')
518 f.write(str(json_str4["meters"][4]['meter']['m1_rate']))
519 f.write('\t')
520 f.write(str(json_str4["meters"][4]['meter']['m5_rate']))
521 f.write('\t')
522 f.write(str(json_str4["meters"][4]['meter']['m15_rate']))
523 f.write('\t')
524 f.write(str(json_str4["meters"][4]['meter']['mean_rate']))
525 f.write('\n')
526
527 f.write('\n')
528
529 time.sleep(sleep_t)
530 f.close()
531 #main.Mininet2.handle.expect("\$", timeout=900)
532 #main.Mininet2.handle.sendline("sudo mn -c")
533 #main.Mininet2.handle.expect("\$")
534 time.sleep(5)
535 main.Mininet2.handle.expect("\$", timeout=900)
536
537
538 def CASE7(self,main):
539
540 ip1 = main.params['CTRL']['ip1']
541 ip2 = main.params['CTRL']['ip2']
542 ip3 = main.params['CTRL']['ip3']
543 ip4 = main.params['CTRL']['ip4']
544
545 import time
546 import json
547 rate2 = main.params['RATE2']
548 run_dur = main.params['RUN_DUR']
549 loop = int(main.params['loop'])
550 sleep_t = int(main.params['sleep_t'])
551 switches_num = main.params['sitches_num']
552 port = main.params['port']
553 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
554 main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
555 main.Mininet2.handle.expect("starting to generate south bound load ....", timeout=900 )
556
557 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close()
558 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
559 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
560 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
561 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
562 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a")
563 #time.sleep(10)
564 for i in range(int (loop)):
565 json_str1 = main.ONOS1.get_json(url1)
566 json_str2 = main.ONOS2.get_json(url2)
567 json_str3 = main.ONOS3.get_json(url3)
568 json_str4 = main.ONOS4.get_json(url4)
569 if json_str1 != "" and json_str2 != "" and json_str3 != "" and json_str4 != "":
570
571 f.write("ONOS1 \n")
572 f.write(str(json_str1["meters"][4]['meter']['count']))
573 f.write('\t')
574 f.write(str(json_str1["meters"][4]['meter']['m1_rate']))
575 f.write('\t')
576 f.write(str(json_str1["meters"][4]['meter']['m5_rate']))
577 f.write('\t')
578 f.write(str(json_str1["meters"][4]['meter']['m15_rate']))
579 f.write('\t')
580 f.write(str(json_str1["meters"][4]['meter']['mean_rate']))
581 f.write('\n')
582
583 f.write("ONOS2 \n")
584 f.write(str(json_str2["meters"][4]['meter']['count']))
585 f.write('\t')
586 f.write(str(json_str2["meters"][4]['meter']['m1_rate']))
587 f.write('\t')
588 f.write(str(json_str2["meters"][4]['meter']['m5_rate']))
589 f.write('\t')
590 f.write(str(json_str2["meters"][4]['meter']['m15_rate']))
591 f.write('\t')
592 f.write(str(json_str2["meters"][4]['meter']['mean_rate']))
593 f.write('\n')
594
595 f.write("ONOS3 \n")
596 f.write(str(json_str3["meters"][4]['meter']['count']))
597 f.write('\t')
598 f.write(str(json_str3["meters"][4]['meter']['m1_rate']))
599 f.write('\t')
600 f.write(str(json_str3["meters"][4]['meter']['m5_rate']))
601 f.write('\t')
602 f.write(str(json_str3["meters"][4]['meter']['m15_rate']))
603 f.write('\t')
604 f.write(str(json_str3["meters"][4]['meter']['mean_rate']))
605 f.write('\n')
606
607 f.write("ONOS4 \n")
608 f.write(str(json_str4["meters"][4]['meter']['count']))
609 f.write('\t')
610 f.write(str(json_str4["meters"][4]['meter']['m1_rate']))
611 f.write('\t')
612 f.write(str(json_str4["meters"][4]['meter']['m5_rate']))
613 f.write('\t')
614 f.write(str(json_str4["meters"][4]['meter']['m15_rate']))
615 f.write('\t')
616 f.write(str(json_str4["meters"][4]['meter']['mean_rate']))
617 f.write('\n')
618
619 f.write('\n')
620
621 time.sleep(sleep_t)
622 f.close()
623
624 def CASE8(self,main):
625
626 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
627 ip1 = main.params['CTRL']['ip1']
628 ip2 = main.params['CTRL']['ip2']
629 ip3 = main.params['CTRL']['ip3']
630 ip4 = main.params['CTRL']['ip4']
631
632 import time
633 import json
634
635 main.Mininet4.handle.expect("\$")
636 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
637 #main.Mininet2.handle.expect("mininet>" , timeout=400)
638 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
639 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
640 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
641 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
642 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633")
643 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633")
644 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633")
645
646 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
647 main.ONOS3.handle.expect("\$")
648
649 main.ONOS3.handle.sendline("./multiLoadgen_NB.py -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 \" -i 4 -g 100 -a 1 -d 1 -p 0")
650 main.ONOS3.handle.expect("intent group is : 0", timeout=900)
651
652
653 import json
654
655 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
656 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
657 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
658 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
659 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
660 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
661 #time.sleep(10)
662 for i in range(8):
663 json_str1 = main.ONOS1.get_json(url1)
664 json_str2 = main.ONOS2.get_json(url2)
665 json_str3 = main.ONOS3.get_json(url3)
666 json_str4 = main.ONOS4.get_json(url4)
667
668 if json_str1 != "" and json_str2 != "" and json_str3 != "":
669 f.write("ONOS1......IncomingRate \n ")
670 f.write(str(json_str1["meters"][0]['meter']['count']))
671 f.write('\t')
672 f.write(str(json_str1["meters"][0]['meter']['m1_rate']))
673 f.write('\t')
674 f.write(str(json_str1["meters"][0]['meter']['m5_rate']))
675 f.write('\t')
676 f.write(str(json_str1["meters"][0]['meter']['m15_rate']))
677 f.write('\t')
678 f.write(str(json_str1["meters"][0]['meter']['mean_rate']))
679 f.write('\n')
680 f.write("ONOS2......IncomingRate \n")
681 f.write(str(json_str2["meters"][0]['meter']['count']))
682 f.write('\t')
683 f.write(str(json_str2["meters"][0]['meter']['m1_rate']))
684 f.write('\t')
685 f.write(str(json_str2["meters"][0]['meter']['m5_rate']))
686 f.write('\t')
687 f.write(str(json_str2["meters"][0]['meter']['m15_rate']))
688 f.write('\t')
689 f.write(str(json_str2["meters"][0]['meter']['mean_rate']))
690 f.write('\n')
691 f.write("ONOS3......IncomingRate \n")
692 f.write(str(json_str3["meters"][0]['meter']['count']))
693 f.write('\t')
694 f.write(str(json_str3["meters"][0]['meter']['m1_rate']))
695 f.write('\t')
696 f.write(str(json_str3["meters"][0]['meter']['m5_rate']))
697 f.write('\t')
698 f.write(str(json_str3["meters"][0]['meter']['m15_rate']))
699 f.write('\t')
700 f.write(str(json_str3["meters"][0]['meter']['mean_rate']))
701 f.write('\n')
702 f.write("ONOS4......IncomingRate \n")
703 f.write(str(json_str4["meters"][0]['meter']['count']))
704 f.write('\t')
705 f.write(str(json_str4["meters"][0]['meter']['m1_rate']))
706 f.write('\t')
707 f.write(str(json_str4["meters"][0]['meter']['m5_rate']))
708 f.write('\t')
709 f.write(str(json_str4["meters"][0]['meter']['m15_rate']))
710 f.write('\t')
711 f.write(str(json_str4["meters"][0]['meter']['mean_rate']))
712 f.write('\n')
713 f.write('\n')
714
715 f.write("--------------------------------------------------------------------------------- \n")
716
717 f.write("ONOS1......ProcessingRate \n ")
718 f.write(str(json_str1["meters"][1]['meter']['count']))
719 f.write('\t')
720 f.write(str(json_str1["meters"][1]['meter']['m1_rate']))
721 f.write('\t')
722 f.write(str(json_str1["meters"][1]['meter']['m5_rate']))
723 f.write('\t')
724 f.write(str(json_str1["meters"][1]['meter']['m15_rate']))
725 f.write('\t')
726 f.write(str(json_str1["meters"][1]['meter']['mean_rate']))
727 f.write('\n')
728 f.write("ONOS2......ProcessingRate \n")
729 f.write(str(json_str2["meters"][1]['meter']['count']))
730 f.write('\t')
731 f.write(str(json_str2["meters"][1]['meter']['m1_rate']))
732 f.write('\t')
733 f.write(str(json_str2["meters"][1]['meter']['m5_rate']))
734 f.write('\t')
735 f.write(str(json_str2["meters"][1]['meter']['m15_rate']))
736 f.write('\t')
737 f.write(str(json_str2["meters"][1]['meter']['mean_rate']))
738 f.write('\n')
739 f.write("ONOS3......ProcessingRate \n")
740 f.write(str(json_str3["meters"][1]['meter']['count']))
741 f.write('\t')
742 f.write(str(json_str3["meters"][1]['meter']['m1_rate']))
743 f.write('\t')
744 f.write(str(json_str3["meters"][1]['meter']['m5_rate']))
745 f.write('\t')
746 f.write(str(json_str3["meters"][1]['meter']['m15_rate']))
747 f.write('\t')
748 f.write(str(json_str3["meters"][1]['meter']['mean_rate']))
749 f.write('\n')
750
751 f.write("ONOS4......ProcessingRate \n")
752 f.write(str(json_str4["meters"][1]['meter']['count']))
753 f.write('\t')
754 f.write(str(json_str4["meters"][1]['meter']['m1_rate']))
755 f.write('\t')
756 f.write(str(json_str4["meters"][1]['meter']['m5_rate']))
757 f.write('\t')
758 f.write(str(json_str4["meters"][1]['meter']['m15_rate']))
759 f.write('\t')
760 f.write(str(json_str4["meters"][1]['meter']['mean_rate']))
761 f.write('\n')
762
763 f.write('\n')
764
765 f.write("--------------------------------------------------------------------------------- \n")
766
767 time.sleep(10)
768 f.close()
769
770 main.ONOS3.handle.expect("\$", timeout=900)
771