blob: bf0c9f0861b34b59754d054eacdda46292d9021d [file] [log] [blame]
santhoshfe88a202014-08-19 18:53:23 -07001#Author: Santhosh Jayashankar
santhosh91195f12014-08-07 13:53:50 -07002class scaleONOS7nodes :
3
4
5
6 def __init__(self) :
7 self.default = ''
8
9# def print_hello_world(self,main):
10# print("hello world")
11#*****************************************************************************************************************************************************************************************
12#Test startup
13#Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully
14 def CASE1(self,main) : #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version
15 main.case("Initial setup")
16 main.step("Stop ONOS")
17 import time
santhoshbc421422014-08-17 09:48:49 -070018 main.log.info("Stopping all ONOS nodes...")
santhosh91195f12014-08-07 13:53:50 -070019 main.ONOS1.stop_all()
20 main.ONOS2.stop_all()
21 main.ONOS3.stop_all()
22# main.print_hello_world()
23 main.ONOS4.stop_all()
santhoshbc421422014-08-17 09:48:49 -070024 main.ONOS5.stop_all()
25 main.ONOS6.stop_all()
26 main.ONOS7.stop_all()
27 #main.ONOS2.stop_rest()
santhoshf6863782014-08-11 15:28:24 -070028 time.sleep(5)
santhosh91195f12014-08-07 13:53:50 -070029 #main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
30 #main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
31 #main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
32 #main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
33 #main.step("Start tcpdump on mn")
34 #main.Mininet2.start_tcpdump(main.params['tcpdump']['filename'], intf = main.params['tcpdump']['intf'], port = main.params['tcpdump']['port'])
santhoshbc421422014-08-17 09:48:49 -070035 main.step("Starting 3 ONOS nodes...")
santhosh91195f12014-08-07 13:53:50 -070036 main.Zookeeper1.start()
37 main.Zookeeper2.start()
38 main.Zookeeper3.start()
39 main.Zookeeper4.start()
santhoshbc421422014-08-17 09:48:49 -070040 main.Zookeeper5.start()
41 main.Zookeeper6.start()
42 main.Zookeeper7.start()
43
santhosh91195f12014-08-07 13:53:50 -070044 time.sleep(5)
45
46
47 main.RamCloud1.del_db()
48 main.RamCloud2.del_db()
49 main.RamCloud3.del_db()
santhoshbc421422014-08-17 09:48:49 -070050 # main.RamCloud4.del_db()
santhosh91195f12014-08-07 13:53:50 -070051
52 time.sleep(5)
53 #main.log.report("Pulling latest code from github to all nodes")
54
55 """
56 for i in range(2):
57 uptodate = main.ONOS1.git_pull()
58 main.ONOS2.git_pull()
59 main.ONOS3.git_pull()
60 # main.ONOS4.git_pull()
61 ver1 = main.ONOS1.get_version()
62 ver2 = main.ONOS3.get_version()
63 if ver1==ver2:
64 break
65 elif i==1:
66 main.ONOS2.git_pull("ONOS1 master")
67 main.ONOS3.git_pull("ONOS1 master")
68 # main.ONOS4.git_pull("ONOS1 master")
69 if uptodate==0:
70 # if 1:
71 main.ONOS1.git_compile()
72 main.ONOS2.git_compile()
73 main.ONOS3.git_compile()
74 # main.ONOS4.git_compile()
75 main.ONOS1.print_version()
76 # main.RamCloud1.git_pull()
77 # main.RamCloud2.git_pull()
78 # main.RamCloud3.git_pull()
79 # main.RamCloud4.git_pull()
80 # main.ONOS1.get_version()
81 # main.ONOS2.get_version()
82 # main.ONOS3.get_version()
83 # main.ONOS4.get_version()
84 # main.ONOS1.start_all()
85 # main.ONOS2.start_all()
86 # main.ONOS3.start_all()
87 # main.ONOS4.start_all()
88
89 """
90 main.RamCloud1.start_coor()
91 main.RamCloud1.start_serv()
92 main.RamCloud2.start_serv()
93 main.RamCloud3.start_serv()
santhoshbc421422014-08-17 09:48:49 -070094 time.sleep(5)
santhosh91195f12014-08-07 13:53:50 -070095 main.ONOS1.start()
96 main.ONOS2.start()
97 main.ONOS3.start()
98 #main.ONOS4.start()
santhoshbc421422014-08-17 09:48:49 -070099 time.sleep(5)
100
101 #main.ONOS1.handle.sendline("./onos.sh core start")
102 #main.ONOS1.handle.sendline("./onos.sh core start")
103 #main.ONOS1.handle.sendline("./onos.sh core start")
santhosh91195f12014-08-07 13:53:50 -0700104
105 main.ONOS1.start_rest()
106 main.ONOS2.start_rest()
107 main.ONOS3.start_rest()
108 test= main.ONOS2.rest_status()
109 if test == main.FALSE:
110 main.ONOS1.start_rest()
111 main.ONOS1.get_version()
112 main.log.report("Startup check Zookeeper1, RamCloud1, and ONOS1 connections")
113 main.step("Testing startup Zookeeper")
114 data = main.Zookeeper1.isup() and main.Zookeeper2.isup() and main.Zookeeper3.isup()
115 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
116
117 main.step("Testing startup RamCloud")
118 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
119 if data == main.FALSE:
120 main.RamCloud1.stop_coor()
121 main.RamCloud1.stop_serv()
122 main.RamCloud2.stop_serv()
123 main.RamCloud3.stop_serv()
124 # main.RamCloud4.stop_serv()
125
126 time.sleep(5)
127 main.RamCloud1.start_coor()
128 main.RamCloud1.start_serv()
129 main.RamCloud2.start_serv()
130 main.RamCloud3.start_serv()
131 # main.RamCloud4.start_serv()
132 time.sleep(5)
133 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
134
135
136
137 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...")
138
139 main.step("Testing startup ONOS")
140 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
141 for i in range(3):
142 if data == main.FALSE:
143 #main.log.report("Something is funny... restarting ONOS")
144 #main.ONOS1.stop()
145 time.sleep(3)
146 #main.ONOS1.start()
147 #time.sleep(5)
148 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
149 else:
150 break
151 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
152 time.sleep(10)
153
154
santhoshbc421422014-08-17 09:48:49 -0700155 def CASE31(self,main):
156 main.case("Staring SB load with 3 ONOS nodes")
santhosh91195f12014-08-07 13:53:50 -0700157 ip1 = main.params['CTRL']['ip1']
158 ip2 = main.params['CTRL']['ip2']
159 ip3 = main.params['CTRL']['ip3']
160 rate1 = main.params['RATE1']
161 run_dur = main.params['RUN_DUR']
162 loop = int( main.params['loop'])
163 port = main.params['port']
164 switches_num = main.params['switches_num']
165 print loop
santhoshbc421422014-08-17 09:48:49 -0700166 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700167 sleep_t =int( main.params['sleep_t'])
168 main.case("Starting SB load on 3 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700169 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur)
170 main.log.info("Adding switches and ports.....")
171 main.Mininet2.handle.expect("Starting SB load....", timeout=400)
172 main.log.info("Starting SB load....")
santhosh91195f12014-08-07 13:53:50 -0700173 import time
174 import json
santhoshfe88a202014-08-19 18:53:23 -0700175 import math
santhoshbc421422014-08-17 09:48:49 -0700176 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700177 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", 'w').close()
178 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
179 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
180 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
181 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", "a")
182 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700183 tpval = 0.0
184 global tpavg3n
185 tpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700186 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700187 j1 = main.ONOS2.get_json(url1)
188 j2 = main.ONOS2.get_json(url2)
189 j3 = main.ONOS2.get_json(url3)
190 json_str = []
191 json_str.append(0)
192 json_str.append(j1)
193 json_str.append(j2)
194 json_str.append(j3)
santhoshfe88a202014-08-19 18:53:23 -0700195 #float jval = 0
santhoshbc421422014-08-17 09:48:49 -0700196 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
santhosh91195f12014-08-07 13:53:50 -0700197 # write_str = str(json_str["meters"][4]["meter"][2])
198 #print str(json_str["meters"][4])
199 #f.write(str(json_str["meters"][4]))
200 #f.write('\n')
201 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700202 for j in range(1,4):
203 f.write("ONOS" + str(j) + "\n")
204 f.write(str(json_str[j]["meters"][4]['meter']['count']))
205 f.write('\t')
206 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
207 f.write('\t')
208 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
209 f.write('\t')
210 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
211 f.write('\t')
212 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
213 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700214 if j == 3:
215 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
216 #print tpval
217 #print ("\n")
218
santhoshbc421422014-08-17 09:48:49 -0700219
santhosh91195f12014-08-07 13:53:50 -0700220 f.write('\n')
221 f.write('\n')
222
223 f.write("--------------------------------------------------------------------------------- \n")
224 time.sleep(sleep_t)
225 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700226 # print tpval
227 print("\n")
228 tpavg3n = round(tpval)/loop
229 print tpavg3n
santhosh5d159cc2014-08-25 14:24:53 -0700230 main.log.report("Topology Event Throughput for 3-node ONOS cluster = " +str(tpavg3n) + " Events/sec")
santhosh91195f12014-08-07 13:53:50 -0700231 main.Mininet2.handle.expect("\$", timeout=900)
232 # main.Mininet2.handle.sendline("sudo mn -c")
233 #main.Mininet2.handle.expect("\$")
santhosh91195f12014-08-07 13:53:50 -0700234 # main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700235 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700236
237
santhoshbc421422014-08-17 09:48:49 -0700238 def CASE32(self,main):
santhosh91195f12014-08-07 13:53:50 -0700239 ip1 = main.params['CTRL']['ip1']
240 ip2 = main.params['CTRL']['ip2']
241 ip3 = main.params['CTRL']['ip3']
242 import time
243 rate2 = main.params['RATE2']
244 run_dur = main.params['RUN_DUR']
245 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700246 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700247 sleep_t = int(main.params['sleep_t'])
248 port = main.params['port']
249 switches_num = main.params['switches_num']
250 main.case("Starting SB load on 3 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700251 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
252 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 -0700253 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"10.128.10.1\" 100 50 1200 \"11\"")
santhoshf6863782014-08-11 15:28:24 -0700254 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700255 time.sleep(sleep_init )
santhosh91195f12014-08-07 13:53:50 -0700256 import json
santhoshbc421422014-08-17 09:48:49 -0700257 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700258 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", 'w').close()
259 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
260 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
261 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
262 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", "a")
santhosh91195f12014-08-07 13:53:50 -0700263 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700264 j1 = main.ONOS1.get_json(url1)
265 j2 = main.ONOS1.get_json(url2)
266 j3 = main.ONOS1.get_json(url3)
267 json_str = []
268 json_str.append(0)
269 json_str.append(j1)
270 json_str.append(j2)
271 json_str.append(j3)
272 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
santhosh91195f12014-08-07 13:53:50 -0700273 # write_str = str(json_str["meters"][4]["meter"][2])
274 #print str(json_str["meters"][4])
275 #f.write(str(json_str["meters"][4]))
276 #f.write('\n')
277 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700278 for j in range(1,4):
279 f.write("ONOS" + str(j) + "\n")
280 f.write(str(json_str[j]["meters"][4]['meter']['count']))
281 f.write('\t')
282 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
283 f.write('\t')
284 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
285 f.write('\t')
286 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
287 f.write('\t')
288 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
289 f.write('\n')
290
santhosh91195f12014-08-07 13:53:50 -0700291 f.write('\n')
292 f.write('\n')
santhoshbc421422014-08-17 09:48:49 -0700293
santhosh91195f12014-08-07 13:53:50 -0700294 f.write("--------------------------------------------------------------------------------- \n")
295 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700296 f.close()
297 #time.sleep(10)
santhosh91195f12014-08-07 13:53:50 -0700298 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700299 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700300 # main.Mininet2.handle.sendline("sudo mn -c")
301 #time.sleep(5)
302 # main.Mininet2.handle.expect("\$", timeout=900)
303
304
santhoshbc421422014-08-17 09:48:49 -0700305 def CASE33(self,main):
santhosh91195f12014-08-07 13:53:50 -0700306
307 main.case("Starting NB Throughput test")
308 ip1 = main.params['CTRL']['ip1']
309 ip2 = main.params['CTRL']['ip2']
310 ip3 = main.params['CTRL']['ip3']
311 import time
312 import json
santhoshfe88a202014-08-19 18:53:23 -0700313 int_num = main.params['int_num']
314 addrate = main.params['addrate']
315 NBdur = main.params['NBdur']
316 NBsleep = int(main.params['NBsleep'])
317 NBsleep_init = int(main.params['NBsleep_init'])
318 NBloop = int(main.params['NBloop'])
319
santhosh91195f12014-08-07 13:53:50 -0700320 main.Mininet4.handle.expect("\$")
321 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
322 #main.Mininet2.handle.expect("mininet>" , timeout=400)
323 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
324 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.1:6633")
325 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.2:6633")
326 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.2:6633")
327 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.3:6633")
328 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
329 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.3:6633")
santhoshd3957122014-08-21 19:33:58 -0700330
santhosh91195f12014-08-07 13:53:50 -0700331 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
332 main.ONOS3.handle.expect("\$")
333
santhoshfe88a202014-08-19 18:53:23 -0700334 main.ONOS3.handle.sendline("./loadgen_NB.py -n 3 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshbc421422014-08-17 09:48:49 -0700335 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshfe88a202014-08-19 18:53:23 -0700336 time.sleep(NBsleep_init)
337 #time.sleep(60)
santhosh91195f12014-08-07 13:53:50 -0700338 import json
santhosh518cc672014-08-20 16:32:26 -0700339 nbtpval = 0.0
340 global nbtpavg3n
341 nbtpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700342
343 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
344 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
345 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
346 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
347 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
348 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700349 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700350 j1 = main.ONOS1.get_json(url1)
351 j2 = main.ONOS1.get_json(url2)
352 j3 = main.ONOS1.get_json(url3)
353 json_str = []
354 json_str.append(0)
355 json_str.append(j1)
356 json_str.append(j2)
357 json_str.append(j3)
358 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
359 for j in range(1,4):
360 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
361 f.write(str(json_str[j]["meters"][0]['meter']['count']))
362 f.write('\t')
363 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
364 f.write('\t')
365 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
366 f.write('\t')
367 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
368 f.write('\t')
369 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
370 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700371
santhoshbc421422014-08-17 09:48:49 -0700372 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700373
santhoshbc421422014-08-17 09:48:49 -0700374 f.write("--------------------------------------------------------------------------------- \n")
375
376 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
377 f.write(str(json_str[j]["meters"][1]['meter']['count']))
378 f.write('\t')
379 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
380 f.write('\t')
381 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
382 f.write('\t')
383 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
384 f.write('\t')
385 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
386 f.write('\n')
387 f.write('\n')
388 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -0700389 if j == 3:
390 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700391
392 f.write("--------------------------------------------------------------------------------- \n")
393 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700394 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700395 f.close()
santhosh518cc672014-08-20 16:32:26 -0700396 print("\n")
397 nbtpavg3n = round(nbtpval)/NBloop
398 print nbtpavg3n
santhosh91195f12014-08-07 13:53:50 -0700399
santhoshbc421422014-08-17 09:48:49 -0700400 main.ONOS3.handle.expect("\$", timeout=900)
santhosh483a4162014-08-20 22:40:51 -0700401 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -0700402 main.log.report("Intent Throughput for 3-node ONOS cluster = " + str(nbtpavg3n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700403
404 def CASE4(self,main):
santhosh91195f12014-08-07 13:53:50 -0700405
406 main.case("Starting ONOS scale-up to 4 nodes ")
407 import time
408 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700409 main.ONOS5.handle.sendline("./onos.sh core stop")
410 main.ONOS6.handle.sendline("./onos.sh core stop")
411 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700412
413
414 main.Zookeeper4.start()
santhoshf6863782014-08-11 15:28:24 -0700415 time.sleep(5)
416
417 main.RamCloud4.del_db()
418 time.sleep(3)
419 main.RamCloud4.start_serv()
420 time.sleep(3)
santhosh91195f12014-08-07 13:53:50 -0700421 main.ONOS4.start()
422 main.ONOS4.start_rest()
423 time.sleep(5)
424 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
425 for i in range(3):
426 if data == main.FALSE:
427 #main.log.report("Something is funny... restarting ONOS")
428 #main.ONOS1.stop()
429 time.sleep(3)
430 #main.ONOS1.start()
431 #time.sleep(5)
432 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
433 else:
434 break
santhosh5d159cc2014-08-25 14:24:53 -0700435 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 4-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700436
437 time.sleep(10)
438
439 def CASE5(self,main):
440
441 main.case("Starting ONOS scale-up/down to 5 nodes ")
442 import time
443 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700444 main.ONOS6.handle.sendline("./onos.sh core stop")
445 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700446 #pdata = main.ONOS5.isup()
447
448 main.Zookeeper5.start()
449 time.sleep(5)
450
451 main.RamCloud5.del_db()
452 time.sleep(3)
453 main.RamCloud5.start_serv()
454 time.sleep(3)
455 main.ONOS5.start()
456 main.ONOS5.start_rest()
457 time.sleep(5)
458 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
459 for i in range(3):
460 if data == main.FALSE:
461 #main.log.report("Something is funny... restarting ONOS")
462 #main.ONOS1.stop()
463 time.sleep(3)
464 #main.ONOS1.start()
465 #time.sleep(5)
466 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
467 else:
468 break
santhosh5d159cc2014-08-25 14:24:53 -0700469 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 5-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhosh91195f12014-08-07 13:53:50 -0700470 time.sleep(10)
471
472 def CASE6(self,main):
473
santhoshbc421422014-08-17 09:48:49 -0700474 main.case("Starting ONOS scale-up/down to 6 nodes ")
475 import time
476 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700477 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700478 #pdata = main.ONOS6.isup()
479
480 main.Zookeeper6.start()
481 time.sleep(5)
482
483 main.RamCloud6.del_db()
484 time.sleep(3)
485 main.RamCloud6.start_serv()
486 time.sleep(3)
487 main.ONOS6.start()
488 main.ONOS6.start_rest()
489 time.sleep(5)
490 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
491 for i in range(3):
492 if data == main.FALSE:
493 #main.log.report("Something is funny... restarting ONOS")
494 #main.ONOS1.stop()
495 time.sleep(3)
496 #main.ONOS1.start()
497 #time.sleep(5)
498 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
499 else:
500 break
santhosh5d159cc2014-08-25 14:24:53 -0700501 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 6-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700502 time.sleep(10)
503
504 def CASE7(self,main):
505
506 main.case("Starting ONOS scale-up/down to 7 nodes ")
507 import time
508 # main.RamCloud4.start_serv()
509 #pdata = main.ONOS7.isup()
510
511 main.Zookeeper7.start()
512 time.sleep(5)
513
514 main.RamCloud7.del_db()
515 time.sleep(3)
516 main.RamCloud7.start_serv()
517 time.sleep(3)
518 main.ONOS7.start()
519 main.ONOS7.start_rest()
520 time.sleep(5)
521 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
522 for i in range(3):
523 if data == main.FALSE:
524 #main.log.report("Something is funny... restarting ONOS")
525 #main.ONOS1.stop()
526 time.sleep(3)
527 #main.ONOS1.start()
528 #time.sleep(5)
529 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
530 else:
531 break
santhosh5d159cc2014-08-25 14:24:53 -0700532 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 7-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700533 time.sleep(10)
534
535
536
537 def CASE41(self,main):
538 main.case("Starting SB test for 4 nodes")
santhosh91195f12014-08-07 13:53:50 -0700539 ip1 = main.params['CTRL']['ip1']
540 ip2 = main.params['CTRL']['ip2']
541 ip3 = main.params['CTRL']['ip3']
542 ip4 = main.params['CTRL']['ip4']
543 rate1 = main.params['RATE1']
544 run_dur = main.params['RUN_DUR']
545 loop = int( main.params['loop'])
546 switches_num = main.params['switches_num']
547 port = main.params['port']
548 print loop
santhoshbc421422014-08-17 09:48:49 -0700549 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700550 sleep_t =int( main.params['sleep_t'])
551 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700552 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
553 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)
554 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700555 import time
556 import json
santhoshfe88a202014-08-19 18:53:23 -0700557 import math
santhoshbc421422014-08-17 09:48:49 -0700558 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700559 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
560 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
561 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
562 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
563 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
santhoshfe88a202014-08-19 18:53:23 -0700564 tpval = 0.0
565 global tpavg4n
566 tpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700567
568 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
569 #time.sleep(10)
570 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700571 j1 = main.ONOS2.get_json(url1)
572 j2 = main.ONOS2.get_json(url2)
573 j3 = main.ONOS2.get_json(url3)
574 j4 = main.ONOS2.get_json(url4)
575 json_str = []
576 json_str.append(0)
577 json_str.append(j1)
578 json_str.append(j2)
579 json_str.append(j3)
580 json_str.append(j4)
581 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
santhosh91195f12014-08-07 13:53:50 -0700582 # write_str = str(json_str["meters"][4]["meter"][2])
583 #print str(json_str["meters"][4])
584 #f.write(str(json_str["meters"][4]))
585 #f.write('\n')
586 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700587 for j in range(1,5):
588 f.write("ONOS" + str(j) + "\n")
589 f.write(str(json_str[j]["meters"][4]['meter']['count']))
590 f.write('\t')
591 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
592 f.write('\t')
593 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
594 f.write('\t')
595 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
596 f.write('\t')
597 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
598 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700599 if j == 3:
600 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
601 # print tpval
santhoshbc421422014-08-17 09:48:49 -0700602
santhosh91195f12014-08-07 13:53:50 -0700603 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700604 f.write('\n')
605
santhoshbc421422014-08-17 09:48:49 -0700606 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700607 time.sleep(sleep_t)
608 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700609 # print tpval
610 print("\n")
611 tpavg4n = round(tpval)/loop
612 print tpavg4n
santhosh5d159cc2014-08-25 14:24:53 -0700613 main.log.report("Topology Event Throughput for 4-node ONOS cluster = " + str(tpavg4n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700614
santhosh91195f12014-08-07 13:53:50 -0700615 #main.Mininet2.handle.expect("\$", timeout=900)
616 #main.Mininet2.handle.sendline("sudo mn -c")
617 #main.Mininet2.handle.expect("\$")
618 time.sleep(5)
619 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700620 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700621
622
santhoshbc421422014-08-17 09:48:49 -0700623 def CASE42(self,main):
santhosh91195f12014-08-07 13:53:50 -0700624
625 ip1 = main.params['CTRL']['ip1']
626 ip2 = main.params['CTRL']['ip2']
627 ip3 = main.params['CTRL']['ip3']
628 ip4 = main.params['CTRL']['ip4']
629
630 import time
631 import json
632 rate2 = main.params['RATE2']
633 run_dur = main.params['RUN_DUR']
634 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700635 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700636 sleep_t = int(main.params['sleep_t'])
santhoshf6863782014-08-11 15:28:24 -0700637 switches_num = main.params['switches_num']
santhosh91195f12014-08-07 13:53:50 -0700638 port = main.params['port']
639 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700640 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
641 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)
642 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700643 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700644 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close()
645 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
646 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
647 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
648 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
649 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a")
650 #time.sleep(10)
651 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700652 j1 = main.ONOS2.get_json(url1)
653 j2 = main.ONOS2.get_json(url2)
654 j3 = main.ONOS2.get_json(url3)
655 j4 = main.ONOS2.get_json(url4)
656 json_str = []
657 json_str.append(0)
658 json_str.append(j1)
659 json_str.append(j2)
660 json_str.append(j3)
661 json_str.append(j4)
662 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
663 # write_str = str(json_str["meters"][4]["meter"][2])
664 #print str(json_str["meters"][4])
665 #f.write(str(json_str["meters"][4]))
666 #f.write('\n')
667 #time.sleep(3)
668 for j in range(1,5):
669 f.write("ONOS" + str(j) + "\n")
670 f.write(str(json_str[j]["meters"][4]['meter']['count']))
671 f.write('\t')
672 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
673 f.write('\t')
674 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
675 f.write('\t')
676 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
677 f.write('\t')
678 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
679 f.write('\n')
680
681 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700682 f.write('\n')
683
santhoshbc421422014-08-17 09:48:49 -0700684 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700685 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700686 f.close()
687 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700688
santhoshbc421422014-08-17 09:48:49 -0700689 def CASE43(self,main):
santhosh91195f12014-08-07 13:53:50 -0700690
691 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
692 ip1 = main.params['CTRL']['ip1']
693 ip2 = main.params['CTRL']['ip2']
694 ip3 = main.params['CTRL']['ip3']
695 ip4 = main.params['CTRL']['ip4']
696
697 import time
698 import json
santhoshfe88a202014-08-19 18:53:23 -0700699 int_num = main.params['int_num']
700 addrate = main.params['addrate']
701 NBdur = main.params['NBdur']
702 NBsleep = int(main.params['NBsleep'])
703 NBsleep_init = int(main.params['NBsleep_init'])
704 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700705 nbtpval = 0.0
706 global nbtpavg4n
707 nbtpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700708
709 main.Mininet4.handle.expect("\$")
710 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
711 #main.Mininet2.handle.expect("mininet>" , timeout=400)
712 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
713 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
714 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
715 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
716 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633")
717 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633")
718 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633")
santhoshd3957122014-08-21 19:33:58 -0700719
santhosh91195f12014-08-07 13:53:50 -0700720 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
721 main.ONOS3.handle.expect("\$")
722
santhosh518cc672014-08-20 16:32:26 -0700723 main.ONOS3.handle.sendline("./loadgen_NB.py -n 4 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700724 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700725
726
santhoshfe88a202014-08-19 18:53:23 -0700727 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700728 import json
729
730 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
731 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
732 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
733 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
734 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
735 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
736 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700737 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700738 j1 = main.ONOS2.get_json(url1)
739 j2 = main.ONOS2.get_json(url2)
740 j3 = main.ONOS2.get_json(url3)
741 j4 = main.ONOS2.get_json(url4)
742 json_str = []
743 json_str.append(0)
744 json_str.append(j1)
745 json_str.append(j2)
746 json_str.append(j3)
747 json_str.append(j4)
748 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
749 for j in range(1,5):
750 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
751 f.write(str(json_str[j]["meters"][0]['meter']['count']))
752 f.write('\t')
753 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
754 f.write('\t')
755 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
756 f.write('\t')
757 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
758 f.write('\t')
759 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
760 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700761
santhoshbc421422014-08-17 09:48:49 -0700762 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700763
santhoshbc421422014-08-17 09:48:49 -0700764 f.write("--------------------------------------------------------------------------------- \n")
765
766 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
767 f.write(str(json_str[j]["meters"][1]['meter']['count']))
768 f.write('\t')
769 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
770 f.write('\t')
771 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
772 f.write('\t')
773 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
774 f.write('\t')
775 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
776 f.write('\n')
777 f.write('\n')
778 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -0700779 if j == 3:
780 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh91195f12014-08-07 13:53:50 -0700781
santhoshbc421422014-08-17 09:48:49 -0700782 f.write("--------------------------------------------------------------------------------- \n")
783 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700784 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700785 f.close()
santhosh518cc672014-08-20 16:32:26 -0700786 print("\n")
787 nbtpavg4n = round(nbtpval)/NBloop
788 print nbtpavg4n
santhoshbc421422014-08-17 09:48:49 -0700789
santhosh91195f12014-08-07 13:53:50 -0700790
791 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -0700792 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -0700793 main.log.report("Intent Throughput for 4-node ONOS cluster = " + str(nbtpavg4n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700794
795 def CASE51(self,main):
796 main.case("Starting SB test for 5 nodes")
797 ip1 = main.params['CTRL']['ip1']
798 ip2 = main.params['CTRL']['ip2']
799 ip3 = main.params['CTRL']['ip3']
800 ip4 = main.params['CTRL']['ip4']
801 ip5 = main.params['CTRL']['ip5']
802 rate1 = main.params['RATE1']
803 run_dur = main.params['RUN_DUR']
804 loop = int( main.params['loop'])
805 switches_num = main.params['switches_num']
806 port = main.params['port']
807 print loop
808 sleep_init = int(main.params['sleep_init'])
809 sleep_t =int( main.params['sleep_t'])
810 main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
811 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
812 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur)
813 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
814 import time
815 import json
santhoshfe88a202014-08-19 18:53:23 -0700816 tpval = 0.0
817 global tpavg5n
818 tpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700819 time.sleep(sleep_init)
820
821 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close()
822 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
823 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
824 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
825 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
826 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
827
828 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a")
829 #time.sleep(10)
830 for i in range(int (loop)):
831 j1 = main.ONOS2.get_json(url1)
832 j2 = main.ONOS2.get_json(url2)
833 j3 = main.ONOS2.get_json(url3)
834 j4 = main.ONOS2.get_json(url4)
835 j5 = main.ONOS2.get_json(url5)
836 json_str = []
837 json_str.append(0)
838 json_str.append(j1)
839 json_str.append(j2)
840 json_str.append(j3)
841 json_str.append(j4)
842 json_str.append(j5)
843 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
844 # write_str = str(json_str["meters"][4]["meter"][2])
845 #print str(json_str["meters"][4])
846 #f.write(str(json_str["meters"][4]))
847 #f.write('\n')
848 #time.sleep(3)
849 for j in range(1,6):
850 f.write("ONOS" + str(j) + "\n")
851 f.write(str(json_str[j]["meters"][4]['meter']['count']))
852 f.write('\t')
853 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
854 f.write('\t')
855 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
856 f.write('\t')
857 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
858 f.write('\t')
859 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
860 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700861 if j == 3:
862 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
863 #print tpval
santhoshbc421422014-08-17 09:48:49 -0700864
865 f.write('\n')
866 f.write('\n')
867
868 f.write("--------------------------------------------------------------------------------- \n")
869 time.sleep(sleep_t)
870 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700871 #print tpval
872 print("\n")
873 tpavg5n = round(tpval)/loop
874 print tpavg5n
santhoshbc421422014-08-17 09:48:49 -0700875
876 #main.Mininet2.handle.expect("\$", timeout=900)
877 #main.Mininet2.handle.sendline("sudo mn -c")
878 #main.Mininet2.handle.expect("\$")
879 time.sleep(5)
880 main.Mininet2.handle.expect("\$", timeout=900)
881 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -0700882 main.log.report("Topology Event Throughput for 5-node ONOS cluster = " + str(tpavg5n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700883
884
885 def CASE52(self,main):
886
887 ip1 = main.params['CTRL']['ip1']
888 ip2 = main.params['CTRL']['ip2']
889 ip3 = main.params['CTRL']['ip3']
890 ip4 = main.params['CTRL']['ip4']
891 ip5 = main.params['CTRL']['ip5']
892
893 import time
894 import json
895 rate2 = main.params['RATE2']
896 run_dur = main.params['RUN_DUR']
897 loop = int(main.params['loop'])
898 sleep_t = int(main.params['sleep_t'])
899 sleep_init = int(main.params['sleep_init'])
900 switches_num = main.params['switches_num']
901 port = main.params['port']
902 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
903 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
904 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur)
905 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
906 time.sleep(sleep_init)
907 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", 'w').close()
908 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
909 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
910 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
911 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
912 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
913 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", "a")
914 #time.sleep(10)
915 for i in range(int (loop)):
916 j1 = main.ONOS2.get_json(url1)
917 j2 = main.ONOS2.get_json(url2)
918 j3 = main.ONOS2.get_json(url3)
919 j4 = main.ONOS2.get_json(url4)
920 j5 = main.ONOS2.get_json(url5)
921 json_str = []
922 json_str.append(0)
923 json_str.append(j1)
924 json_str.append(j2)
925 json_str.append(j3)
926 json_str.append(j4)
927 json_str.append(j5)
928 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[4] != "":
929 # write_str = str(json_str["meters"][4]["meter"][2])
930 #print str(json_str["meters"][4])
931 #f.write(str(json_str["meters"][4]))
932 #f.write('\n')
933 #time.sleep(3)
934 for j in range(1,6):
935 f.write("ONOS" + str(j) + "\n")
936 f.write(str(json_str[j]["meters"][4]['meter']['count']))
937 f.write('\t')
938 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
939 f.write('\t')
940 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
941 f.write('\t')
942 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
943 f.write('\t')
944 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
945 f.write('\n')
946
947 f.write('\n')
948 f.write('\n')
949
950 f.write("--------------------------------------------------------------------------------- \n")
951 time.sleep(sleep_t)
952 f.close()
953 time.sleep(180)
954
955 def CASE53(self,main):
956
santhosh518cc672014-08-20 16:32:26 -0700957 main.case("Starting NB Throughput test after scaling up to 5 onos nodes")
santhoshbc421422014-08-17 09:48:49 -0700958 ip1 = main.params['CTRL']['ip1']
959 ip2 = main.params['CTRL']['ip2']
960 ip3 = main.params['CTRL']['ip3']
961 ip4 = main.params['CTRL']['ip4']
962
963 import time
964 import json
santhoshfe88a202014-08-19 18:53:23 -0700965 int_num = main.params['int_num']
966 addrate = main.params['addrate']
967 NBdur = main.params['NBdur']
968 NBsleep = int(main.params['NBsleep'])
969 NBsleep_init = int(main.params['NBsleep_init'])
970 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700971 nbtpval = 0.0
972 global nbtpavg5n
973 nbtpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700974
975 main.Mininet4.handle.expect("\$")
976 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
977 #main.Mininet2.handle.expect("mininet>" , timeout=400)
978 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
979 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
980 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
981 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -0700982 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
983 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
984 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.5:6633")
santhoshd3957122014-08-21 19:33:58 -0700985
santhoshbc421422014-08-17 09:48:49 -0700986 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
987 main.ONOS3.handle.expect("\$")
988
santhosh518cc672014-08-20 16:32:26 -0700989 main.ONOS3.handle.sendline("./loadgen_NB.py -n 5 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700990 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700991
992
santhoshfe88a202014-08-19 18:53:23 -0700993 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -0700994 import json
995
996 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close()
997 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
998 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
999 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1000 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1001 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1002 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a")
1003 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001004 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001005 j1 = main.ONOS2.get_json(url1)
1006 j2 = main.ONOS2.get_json(url2)
1007 j3 = main.ONOS2.get_json(url3)
1008 j4 = main.ONOS2.get_json(url4)
1009 j5 = main.ONOS2.get_json(url5)
1010 json_str = []
1011 json_str.append(0)
1012 json_str.append(j1)
1013 json_str.append(j2)
1014 json_str.append(j3)
1015 json_str.append(j4)
1016 json_str.append(j5)
1017 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
1018 for j in range(1,6):
1019 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1020 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1021 f.write('\t')
1022 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1023 f.write('\t')
1024 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1025 f.write('\t')
1026 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1027 f.write('\t')
1028 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1029 f.write('\n')
1030
1031 f.write('\n')
1032
1033 f.write("--------------------------------------------------------------------------------- \n")
1034
1035 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1036 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1037 f.write('\t')
1038 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1039 f.write('\t')
1040 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1041 f.write('\t')
1042 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1043 f.write('\t')
1044 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1045 f.write('\n')
1046 f.write('\n')
1047 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001048 if j == 3:
1049 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1050
santhoshbc421422014-08-17 09:48:49 -07001051
1052 f.write("--------------------------------------------------------------------------------- \n")
1053 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001054 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001055 f.close()
santhosh518cc672014-08-20 16:32:26 -07001056 print("\n")
1057 nbtpavg5n = round(nbtpval)/NBloop
1058 print nbtpavg5n
santhoshbc421422014-08-17 09:48:49 -07001059
1060
1061 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001062 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001063 main.log.report("Intent Throughput for 5-node ONOS cluster = " + str(nbtpavg5n) + " Events/sec")
santhoshd3957122014-08-21 19:33:58 -07001064
santhoshbc421422014-08-17 09:48:49 -07001065 def CASE61(self,main):
1066 main.case("Starting SB test for 5 nodes")
1067 ip1 = main.params['CTRL']['ip1']
1068 ip2 = main.params['CTRL']['ip2']
1069 ip3 = main.params['CTRL']['ip3']
1070 ip4 = main.params['CTRL']['ip4']
1071 ip5 = main.params['CTRL']['ip5']
1072 ip6 = main.params['CTRL']['ip6']
1073 rate1 = main.params['RATE1']
1074 run_dur = main.params['RUN_DUR']
1075 loop = int( main.params['loop'])
1076 switches_num = main.params['switches_num']
1077 port = main.params['port']
1078 print loop
1079 sleep_t =int( main.params['sleep_t'])
1080 sleep_init = int(main.params['sleep_init'])
1081 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1082 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1083 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur)
1084 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1085
1086 import time
1087 import json
santhoshfe88a202014-08-19 18:53:23 -07001088 tpval = 0.0
1089 global tpavg6n
1090 tpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001091 time.sleep(sleep_init)
1092 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close()
1093 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1094 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1095 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1096 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1097 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1098 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1099 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1100
1101 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a")
1102 #time.sleep(10)
1103 for i in range(int (loop)):
1104 j1 = main.ONOS2.get_json(url1)
1105 j2 = main.ONOS2.get_json(url2)
1106 j3 = main.ONOS2.get_json(url3)
1107 j4 = main.ONOS2.get_json(url4)
1108 j5 = main.ONOS2.get_json(url5)
1109 j6 = main.ONOS2.get_json(url6)
1110 json_str = []
1111 json_str.append(0)
1112 json_str.append(j1)
1113 json_str.append(j2)
1114 json_str.append(j3)
1115 json_str.append(j4)
1116 json_str.append(j5)
1117 json_str.append(j6)
1118 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1119 # write_str = str(json_str["meters"][4]["meter"][2])
1120 #print str(json_str["meters"][4])
1121 #f.write(str(json_str["meters"][4]))
1122 #f.write('\n')
1123 #time.sleep(3)
1124 for j in range(1,7):
1125 f.write("ONOS" + str(j) + "\n")
1126 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1127 f.write('\t')
1128 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1129 f.write('\t')
1130 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1131 f.write('\t')
1132 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1133 f.write('\t')
1134 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1135 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001136 if j == 3:
1137 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1138 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001139
1140 f.write('\n')
1141 f.write('\n')
1142
1143 f.write("--------------------------------------------------------------------------------- \n")
1144 time.sleep(sleep_t)
1145 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001146 #print tpval
1147 print("\n")
1148 tpavg6n = round(tpval)/loop
1149 print tpavg6n
santhoshbc421422014-08-17 09:48:49 -07001150
1151 #main.Mininet2.handle.expect("\$", timeout=900)
1152 #main.Mininet2.handle.sendline("sudo mn -c")
1153 #main.Mininet2.handle.expect("\$")
1154 time.sleep(5)
1155 main.Mininet2.handle.expect("\$", timeout=900)
1156 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001157 main.log.report("Topology Event Throughput for 6-node ONOS cluster = " + tpavg6n + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -07001158
1159
1160 def CASE62(self,main):
1161
1162 ip1 = main.params['CTRL']['ip1']
1163 ip2 = main.params['CTRL']['ip2']
1164 ip3 = main.params['CTRL']['ip3']
1165 ip4 = main.params['CTRL']['ip4']
1166 ip5 = main.params['CTRL']['ip5']
1167 ip6 = main.params['CTRL']['ip6']
1168
1169 import time
1170 import json
1171 rate2 = main.params['RATE2']
1172 run_dur = main.params['RUN_DUR']
1173 loop = int(main.params['loop'])
1174 sleep_t = int(main.params['sleep_t'])
1175 switches_num = main.params['switches_num']
1176 sleep_init = int(main.params['sleep_init'])
1177 port = main.params['port']
1178 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1179 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1180 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur)
1181 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1182 time.sleep(sleep_init)
1183 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", 'w').close()
1184 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1185 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1186 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1187 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1188 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1189 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1190 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1191 #time.sleep(10)
1192 for i in range(int (loop)):
1193 j1 = main.ONOS2.get_json(url1)
1194 j2 = main.ONOS2.get_json(url2)
1195 j3 = main.ONOS2.get_json(url3)
1196 j4 = main.ONOS2.get_json(url4)
1197 j5 = main.ONOS2.get_json(url5)
1198 j6 = main.ONOS2.get_json(url6)
1199 json_str = []
1200 json_str.append(0)
1201 json_str.append(j1)
1202 json_str.append(j2)
1203 json_str.append(j3)
1204 json_str.append(j4)
1205 json_str.append(j5)
1206 json_str.append(j6)
1207 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1208 # write_str = str(json_str["meters"][4]["meter"][2])
1209 #print str(json_str["meters"][4])
1210 #f.write(str(json_str["meters"][4]))
1211 #f.write('\n')
1212 #time.sleep(3)
1213 for j in range(1,7):
1214 f.write("ONOS" + str(j) + "\n")
1215 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1216 f.write('\t')
1217 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1218 f.write('\t')
1219 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1220 f.write('\t')
1221 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1222 f.write('\t')
1223 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1224 f.write('\n')
1225
1226 f.write('\n')
1227 f.write('\n')
1228
1229 f.write("--------------------------------------------------------------------------------- \n")
1230 time.sleep(sleep_t)
1231 f.close()
1232 time.sleep(180)
1233
1234 def CASE63(self,main):
1235
1236 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1237 ip1 = main.params['CTRL']['ip1']
1238 ip2 = main.params['CTRL']['ip2']
1239 ip3 = main.params['CTRL']['ip3']
1240 ip4 = main.params['CTRL']['ip4']
1241
1242 import time
1243 import json
santhoshfe88a202014-08-19 18:53:23 -07001244 int_num = main.params['int_num']
1245 addrate = main.params['addrate']
1246 NBdur = main.params['NBdur']
1247 NBsleep = int(main.params['NBsleep'])
1248 NBsleep_init = int(main.params['NBsleep_init'])
1249 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -07001250 nbtpval = 0.0
1251 global nbtpavg6n
1252 nbtpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001253
1254 main.Mininet4.handle.expect("\$")
1255 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1256 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1257 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1258 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1259 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1260 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001261 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1262 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1263 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.6:6633")
santhoshd3957122014-08-21 19:33:58 -07001264
santhoshbc421422014-08-17 09:48:49 -07001265 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1266 main.ONOS3.handle.expect("\$")
1267
santhosh518cc672014-08-20 16:32:26 -07001268 main.ONOS3.handle.sendline("./loadgen_NB.py -n 6 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 10.128.10.6:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -07001269 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001270
1271
santhoshfe88a202014-08-19 18:53:23 -07001272 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001273 import json
1274
1275 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close()
1276 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1277 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1278 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1279 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1280 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1281 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1282 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a")
1283 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001284 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001285 j1 = main.ONOS2.get_json(url1)
1286 j2 = main.ONOS2.get_json(url2)
1287 j3 = main.ONOS2.get_json(url3)
1288 j4 = main.ONOS2.get_json(url4)
1289 j5 = main.ONOS2.get_json(url5)
1290 j6 = main.ONOS2.get_json(url6)
1291 json_str = []
1292 json_str.append(0)
1293 json_str.append(j1)
1294 json_str.append(j2)
1295 json_str.append(j3)
1296 json_str.append(j4)
1297 json_str.append(j5)
1298 json_str.append(j6)
1299 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1300 for j in range(1,7):
1301 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1302 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1303 f.write('\t')
1304 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1305 f.write('\t')
1306 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1307 f.write('\t')
1308 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1309 f.write('\t')
1310 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1311 f.write('\n')
1312
1313 f.write('\n')
1314
1315 f.write("--------------------------------------------------------------------------------- \n")
1316
1317 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1318 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1319 f.write('\t')
1320 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1321 f.write('\t')
1322 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1323 f.write('\t')
1324 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1325 f.write('\t')
1326 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1327 f.write('\n')
1328 f.write('\n')
1329 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001330 if j == 3:
1331 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1332
santhoshbc421422014-08-17 09:48:49 -07001333
1334 f.write("--------------------------------------------------------------------------------- \n")
1335 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001336 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001337 f.close()
santhosh518cc672014-08-20 16:32:26 -07001338 print("\n")
1339 nbtpavg6n = round(nbtpval)/NBloop
1340 print nbtpavg6n
1341
santhoshbc421422014-08-17 09:48:49 -07001342
1343
1344 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001345 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001346 main.log.report("Intent Throughput for 6-node ONOS cluster = " + str(nbtpavg6n) + " Events/sec")
santhoshd3957122014-08-21 19:33:58 -07001347
santhoshbc421422014-08-17 09:48:49 -07001348 def CASE71(self,main):
1349 main.case("Starting SB test for 7 nodes")
1350 ip1 = main.params['CTRL']['ip1']
1351 ip2 = main.params['CTRL']['ip2']
1352 ip3 = main.params['CTRL']['ip3']
1353 ip4 = main.params['CTRL']['ip4']
1354 ip5 = main.params['CTRL']['ip5']
1355 ip6 = main.params['CTRL']['ip6']
1356 ip7 = main.params['CTRL']['ip7']
1357 rate1 = main.params['RATE1']
1358 run_dur = main.params['RUN_DUR']
1359 loop = int( main.params['loop'])
1360 switches_num = main.params['switches_num']
1361 port = main.params['port']
1362 print loop
1363 sleep_t =int( main.params['sleep_t'])
1364 sleep_init = int(main.params['sleep_init'])
1365 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1366 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1367 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + " " + ip7 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur)
1368 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1369 import time
1370 import json
santhoshfe88a202014-08-19 18:53:23 -07001371 tpval = 0.0
1372 global tpavg7n
1373 tpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001374 time.sleep(sleep_init)
1375
1376 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close()
1377 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1378 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1379 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1380 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1381 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1382 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1383 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1384 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1385
1386 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a")
1387 #time.sleep(10)
1388 for i in range(int (loop)):
1389 j1 = main.ONOS2.get_json(url1)
1390 j2 = main.ONOS2.get_json(url2)
1391 j3 = main.ONOS2.get_json(url3)
1392 j4 = main.ONOS2.get_json(url4)
1393 j5 = main.ONOS2.get_json(url5)
1394 j6 = main.ONOS2.get_json(url6)
1395 j7 = main.ONOS2.get_json(url7)
1396 json_str = []
1397 json_str.append(0)
1398 json_str.append(j1)
1399 json_str.append(j2)
1400 json_str.append(j3)
1401 json_str.append(j4)
1402 json_str.append(j5)
1403 json_str.append(j6)
1404 json_str.append(j7)
1405 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[7] != "":
1406 # write_str = str(json_str["meters"][4]["meter"][2])
1407 #print str(json_str["meters"][4])
1408 #f.write(str(json_str["meters"][4]))
1409 #f.write('\n')
1410 #time.sleep(3)
1411 for j in range(1,8):
1412 f.write("ONOS" + str(j) + "\n")
1413 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1414 f.write('\t')
1415 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1416 f.write('\t')
1417 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1418 f.write('\t')
1419 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1420 f.write('\t')
1421 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1422 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001423 if j == 3:
1424 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1425 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001426
1427 f.write('\n')
1428 f.write('\n')
1429
1430 f.write("--------------------------------------------------------------------------------- \n")
1431 time.sleep(sleep_t)
1432 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001433 #print tpval
1434 print("\n")
1435 tpavg7n = round(tpval)/loop
1436 print tpavg7n
santhoshbc421422014-08-17 09:48:49 -07001437
1438 #main.Mininet2.handle.expect("\$", timeout=900)
1439 #main.Mininet2.handle.sendline("sudo mn -c")
1440 #main.Mininet2.handle.expect("\$")
1441 time.sleep(5)
1442 main.Mininet2.handle.expect("\$", timeout=900)
1443 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001444 main.log.report("Topology Event Throughput for 7-node ONOS cluster = " + str(tpavg7n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -07001445
1446
1447 def CASE72(self,main):
1448
1449 ip1 = main.params['CTRL']['ip1']
1450 ip2 = main.params['CTRL']['ip2']
1451 ip3 = main.params['CTRL']['ip3']
1452 ip4 = main.params['CTRL']['ip4']
1453 ip5 = main.params['CTRL']['ip5']
1454 ip6 = main.params['CTRL']['ip6']
1455 ip7 = main.params['CTRL']['ip7']
1456
1457 import time
1458 import json
1459 rate2 = main.params['RATE2']
1460 run_dur = main.params['RUN_DUR']
1461 loop = int(main.params['loop'])
1462 sleep_t = int(main.params['sleep_t'])
1463 sleep_init = int(main.params['sleep_init'])
1464 switches_num = main.params['switches_num']
1465 port = main.params['port']
1466 main.case("Starting SB load on 7 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1467 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1468 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + " " + ip7 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur)
1469 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1470
1471 time.sleep(sleep_init)
1472
1473 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate2", 'w').close()
1474 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1475 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1476 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1477 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1478 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1479 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1480 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1481 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1482 #time.sleep(10)
1483 for i in range(int (loop)):
1484 j1 = main.ONOS2.get_json(url1)
1485 j2 = main.ONOS2.get_json(url2)
1486 j3 = main.ONOS2.get_json(url3)
1487 j4 = main.ONOS2.get_json(url4)
1488 j5 = main.ONOS2.get_json(url5)
1489 j6 = main.ONOS2.get_json(url6)
1490 j7 = main.ONOS2.get_json(url7)
1491 json_str = []
1492 json_str.append(0)
1493 json_str.append(j1)
1494 json_str.append(j2)
1495 json_str.append(j3)
1496 json_str.append(j4)
1497 json_str.append(j5)
1498 json_str.append(j6)
1499 json_str.append(j7)
1500 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[7] != "":
1501 # write_str = str(json_str["meters"][4]["meter"][2])
1502 #print str(json_str["meters"][4])
1503 #f.write(str(json_str["meters"][4]))
1504 #f.write('\n')
1505 #time.sleep(3)
1506 for j in range(1,8):
1507 f.write("ONOS" + str(j) + "\n")
1508 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1509 f.write('\t')
1510 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1511 f.write('\t')
1512 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1513 f.write('\t')
1514 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1515 f.write('\t')
1516 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1517 f.write('\n')
1518
1519 f.write('\n')
1520 f.write('\n')
1521
1522 f.write("--------------------------------------------------------------------------------- \n")
1523 time.sleep(sleep_t)
1524 f.close()
1525 time.sleep(180)
1526
1527 def CASE73(self,main):
1528
1529 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1530 ip1 = main.params['CTRL']['ip1']
1531 ip2 = main.params['CTRL']['ip2']
1532 ip3 = main.params['CTRL']['ip3']
1533 ip4 = main.params['CTRL']['ip4']
1534
1535 import time
1536 import json
santhoshfe88a202014-08-19 18:53:23 -07001537 int_num = main.params['int_num']
1538 addrate = main.params['addrate']
1539 NBdur = main.params['NBdur']
1540 NBsleep = int(main.params['NBsleep'])
1541 NBsleep_init = int(main.params['NBsleep_init'])
1542 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -07001543 nbtpval = 0.0
1544 global nbtpavg7n
1545 nbtpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001546
1547 main.Mininet4.handle.expect("\$")
1548 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1549 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1550 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1551 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1552 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1553 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001554 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1555 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1556 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.7:6633")
santhoshd3957122014-08-21 19:33:58 -07001557
santhoshbc421422014-08-17 09:48:49 -07001558 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1559 main.ONOS3.handle.expect("\$")
1560
santhosh518cc672014-08-20 16:32:26 -07001561 main.ONOS3.handle.sendline("./loadgen_NB.py -n 7 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.6:8080 10.128.10.5:8080 10.128.10.7:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -07001562 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001563
1564
santhoshfe88a202014-08-19 18:53:23 -07001565 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001566 import json
1567
1568 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close()
1569 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1570 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1571 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1572 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1573 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1574 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1575 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1576 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a")
1577 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001578 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001579 j1 = main.ONOS2.get_json(url1)
1580 j2 = main.ONOS2.get_json(url2)
1581 j3 = main.ONOS2.get_json(url3)
1582 j4 = main.ONOS2.get_json(url4)
1583 j5 = main.ONOS2.get_json(url5)
1584 j6 = main.ONOS2.get_json(url6)
1585 j7 = main.ONOS2.get_json(url7)
1586 json_str = []
1587 json_str.append(0)
1588 json_str.append(j1)
1589 json_str.append(j2)
1590 json_str.append(j3)
1591 json_str.append(j4)
1592 json_str.append(j5)
1593 json_str.append(j6)
1594 json_str.append(j7)
1595 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[6] != "":
1596 for j in range(1,8):
1597 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1598 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1599 f.write('\t')
1600 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1601 f.write('\t')
1602 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1603 f.write('\t')
1604 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1605 f.write('\t')
1606 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1607 f.write('\n')
1608
1609 f.write('\n')
1610
1611 f.write("--------------------------------------------------------------------------------- \n")
1612
1613 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1614 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1615 f.write('\t')
1616 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1617 f.write('\t')
1618 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1619 f.write('\t')
1620 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1621 f.write('\t')
1622 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1623 f.write('\n')
1624 f.write('\n')
1625 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001626 if j == 3:
1627 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1628
santhoshbc421422014-08-17 09:48:49 -07001629
1630 f.write("--------------------------------------------------------------------------------- \n")
1631 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001632 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001633 f.close()
santhosh518cc672014-08-20 16:32:26 -07001634 print("\n")
1635 nbtpavg7n = round(nbtpval)/NBloop
1636 print nbtpavg7n
santhoshbc421422014-08-17 09:48:49 -07001637
1638
1639 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001640 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001641 main.log.report("Intent Throughput for 7-node ONOS cluster = " + str(nbtpavg7n) + " Events/sec")
santhoshd3957122014-08-21 19:33:58 -07001642
santhoshbc421422014-08-17 09:48:49 -07001643 def CASE8(self,main):
1644 import time
1645 main.case("Scaling ONOS down to 6 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001646 main.ONOS7.handle.sendline("./onos.sh core stop")
1647 time.sleep(8)
1648 pdata = main.ONOS7.isup()
1649 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
1650 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001651 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1652 for i in range(3):
1653 if data == main.FALSE:
1654 #main.log.report("Something is funny... restarting ONOS")
1655 #main.ONOS1.stop()
1656 time.sleep(3)
1657 #main.ONOS1.start()
1658 #time.sleep(5)
1659 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1660 else:
1661 break
santhosh5d159cc2014-08-25 14:24:53 -07001662 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull -6-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001663
1664 def CASE9(self,main):
1665
1666 main.case("Scaling ONOS down to 5 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001667 main.ONOS6.handle.sendline("./onos.sh core stop")
1668 time.sleep(8)
1669 pdata = main.ONOS6.isup() and main.ONOS7.isup()
1670 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001671 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1672 for i in range(3):
1673 if data == main.FALSE:
1674 #main.log.report("Something is funny... restarting ONOS")
1675 #main.ONOS1.stop()
1676 time.sleep(3)
1677 #main.ONOS1.start()
1678 #time.sleep(5)
1679 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1680 else:
1681 break
santhosh5d159cc2014-08-25 14:24:53 -07001682 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull - 5 node ONOS clsuter is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001683
1684 def CASE10(self,main):
1685
1686 main.case("Scaling ONOS down to 4 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001687
1688 main.ONOS5.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001689 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001690 pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1691 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001692 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1693 for i in range(3):
1694 if data == main.FALSE:
1695 #main.log.report("Something is funny... restarting ONOS")
1696 #main.ONOS1.stop()
1697 time.sleep(3)
1698 #main.ONOS1.start()
1699 #time.sleep(5)
1700 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1701 else:
1702 break
santhosh5d159cc2014-08-25 14:24:53 -07001703 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 4 node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001704
1705 def CASE11(self,main):
1706
1707 main.case("Scaling ONOS down to 3 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001708 main.ONOS4.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001709 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001710 pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1711 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001712 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1713 for i in range(3):
1714 if data == main.FALSE:
1715 #main.log.report("Something is funny... restarting ONOS")
1716 #main.ONOS1.stop()
1717 time.sleep(3)
1718 #main.ONOS1.start()
1719 #time.sleep(5)
1720 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1721 else:
1722 break
santhosh5d159cc2014-08-25 14:24:53 -07001723 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 3 node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001724
1725 def CASE100(self,main):
1726 import os
1727 import time
1728 global timestr
1729 timestr = time.strftime("%Y%m%d-%H%M%S")
1730 main.case("Scale-up tests complete...now making final changes")
1731 main.log.info("moving logs....")
1732 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001733 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001734 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001735 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
1736 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001737 time.sleep(2)
1738 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
santhoshfe88a202014-08-19 18:53:23 -07001739 time.sleep(180)
1740
santhoshbc421422014-08-17 09:48:49 -07001741 def CASE101(self,main):
1742
1743 import os
1744 import time
1745 main.case("Scale-down tests complete...now making final changes")
1746 global timestr
1747 main.case("Scale-down tests complete...now making final changes")
1748 main.log.info("moving logs....")
1749 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001750 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001751 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001752 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
1753 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001754 time.sleep(2)
1755 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
1756 time.sleep(2)
1757
santhoshfe88a202014-08-19 18:53:23 -07001758 def CASE103(self,main):
1759 import os
1760 import time
1761 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1762 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001763 os.system(db_script + " -n='100SwitchScaleUp" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'")
santhoshfe88a202014-08-19 18:53:23 -07001764
1765 def CASE104(self,main):
1766 import os
1767 import time
1768 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1769 db_script = main.params['db_script']
santhosh483a4162014-08-20 22:40:51 -07001770 os.system(db_script + " -n='100SwitchScaleDown" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'")
santhoshfe88a202014-08-19 18:53:23 -07001771
1772
santhosh518cc672014-08-20 16:32:26 -07001773 def CASE105(self,main):
1774 import os
1775 import time
1776 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1777 db_script = main.params['db_script']
1778 os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'")
1779
1780 def CASE106(self,main):
1781 import os
1782 import time
1783 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1784 db_script = main.params['db_script']
santhoshd3957122014-08-21 19:33:58 -07001785 os.system(db_script + " -n='1000IntentsScaleDown" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'")
santhosh518cc672014-08-20 16:32:26 -07001786
santhoshfe88a202014-08-19 18:53:23 -07001787
santhosh91195f12014-08-07 13:53:50 -07001788