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