blob: 2dbe03c350b752e94ce391f8699ab3b5c19ca09d [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
santhosh91195f12014-08-07 13:53:50 -0700230 main.Mininet2.handle.expect("\$", timeout=900)
231 # main.Mininet2.handle.sendline("sudo mn -c")
232 #main.Mininet2.handle.expect("\$")
santhosh91195f12014-08-07 13:53:50 -0700233 # main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700234 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700235
236
santhoshbc421422014-08-17 09:48:49 -0700237 def CASE32(self,main):
santhosh91195f12014-08-07 13:53:50 -0700238 ip1 = main.params['CTRL']['ip1']
239 ip2 = main.params['CTRL']['ip2']
240 ip3 = main.params['CTRL']['ip3']
241 import time
242 rate2 = main.params['RATE2']
243 run_dur = main.params['RUN_DUR']
244 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700245 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700246 sleep_t = int(main.params['sleep_t'])
247 port = main.params['port']
248 switches_num = main.params['switches_num']
249 main.case("Starting SB load on 3 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700250 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
251 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 -0700252 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"10.128.10.1\" 100 50 1200 \"11\"")
santhoshf6863782014-08-11 15:28:24 -0700253 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700254 time.sleep(sleep_init )
santhosh91195f12014-08-07 13:53:50 -0700255 import json
santhoshbc421422014-08-17 09:48:49 -0700256 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700257 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", 'w').close()
258 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
259 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
260 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
261 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", "a")
santhosh91195f12014-08-07 13:53:50 -0700262 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700263 j1 = main.ONOS1.get_json(url1)
264 j2 = main.ONOS1.get_json(url2)
265 j3 = main.ONOS1.get_json(url3)
266 json_str = []
267 json_str.append(0)
268 json_str.append(j1)
269 json_str.append(j2)
270 json_str.append(j3)
271 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
santhosh91195f12014-08-07 13:53:50 -0700272 # write_str = str(json_str["meters"][4]["meter"][2])
273 #print str(json_str["meters"][4])
274 #f.write(str(json_str["meters"][4]))
275 #f.write('\n')
276 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700277 for j in range(1,4):
278 f.write("ONOS" + str(j) + "\n")
279 f.write(str(json_str[j]["meters"][4]['meter']['count']))
280 f.write('\t')
281 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
282 f.write('\t')
283 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
284 f.write('\t')
285 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
286 f.write('\t')
287 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
288 f.write('\n')
289
santhosh91195f12014-08-07 13:53:50 -0700290 f.write('\n')
291 f.write('\n')
santhoshbc421422014-08-17 09:48:49 -0700292
santhosh91195f12014-08-07 13:53:50 -0700293 f.write("--------------------------------------------------------------------------------- \n")
294 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700295 f.close()
296 #time.sleep(10)
santhosh91195f12014-08-07 13:53:50 -0700297 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700298 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700299 # main.Mininet2.handle.sendline("sudo mn -c")
300 #time.sleep(5)
301 # main.Mininet2.handle.expect("\$", timeout=900)
302
303
santhoshbc421422014-08-17 09:48:49 -0700304 def CASE33(self,main):
santhosh91195f12014-08-07 13:53:50 -0700305
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
santhoshfe88a202014-08-19 18:53:23 -0700312 int_num = main.params['int_num']
313 addrate = main.params['addrate']
314 NBdur = main.params['NBdur']
315 NBsleep = int(main.params['NBsleep'])
316 NBsleep_init = int(main.params['NBsleep_init'])
317 NBloop = int(main.params['NBloop'])
318
santhosh91195f12014-08-07 13:53:50 -0700319 main.Mininet4.handle.expect("\$")
320 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
321 #main.Mininet2.handle.expect("mininet>" , timeout=400)
322 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
323 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.1:6633")
324 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.2:6633")
325 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.2:6633")
326 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.3:6633")
327 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
328 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.3:6633")
santhoshd3957122014-08-21 19:33:58 -0700329
santhosh91195f12014-08-07 13:53:50 -0700330 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
331 main.ONOS3.handle.expect("\$")
332
santhoshfe88a202014-08-19 18:53:23 -0700333 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 -0700334 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshfe88a202014-08-19 18:53:23 -0700335 time.sleep(NBsleep_init)
336 #time.sleep(60)
santhosh91195f12014-08-07 13:53:50 -0700337 import json
santhosh518cc672014-08-20 16:32:26 -0700338 nbtpval = 0.0
339 global nbtpavg3n
340 nbtpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700341
342 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
343 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
344 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
345 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
346 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
347 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700348 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700349 j1 = main.ONOS1.get_json(url1)
350 j2 = main.ONOS1.get_json(url2)
351 j3 = main.ONOS1.get_json(url3)
352 json_str = []
353 json_str.append(0)
354 json_str.append(j1)
355 json_str.append(j2)
356 json_str.append(j3)
357 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
358 for j in range(1,4):
359 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
360 f.write(str(json_str[j]["meters"][0]['meter']['count']))
361 f.write('\t')
362 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
363 f.write('\t')
364 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
365 f.write('\t')
366 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
367 f.write('\t')
368 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
369 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700370
santhoshbc421422014-08-17 09:48:49 -0700371 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700372
santhoshbc421422014-08-17 09:48:49 -0700373 f.write("--------------------------------------------------------------------------------- \n")
374
375 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
376 f.write(str(json_str[j]["meters"][1]['meter']['count']))
377 f.write('\t')
378 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
379 f.write('\t')
380 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
381 f.write('\t')
382 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
383 f.write('\t')
384 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
385 f.write('\n')
386 f.write('\n')
387 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -0700388 if j == 3:
389 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700390
391 f.write("--------------------------------------------------------------------------------- \n")
392 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700393 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700394 f.close()
santhosh518cc672014-08-20 16:32:26 -0700395 print("\n")
396 nbtpavg3n = round(nbtpval)/NBloop
397 print nbtpavg3n
santhosh91195f12014-08-07 13:53:50 -0700398
santhoshbc421422014-08-17 09:48:49 -0700399 main.ONOS3.handle.expect("\$", timeout=900)
santhosh483a4162014-08-20 22:40:51 -0700400 time.sleep(180)
santhoshbc421422014-08-17 09:48:49 -0700401
402 def CASE4(self,main):
santhosh91195f12014-08-07 13:53:50 -0700403
404 main.case("Starting ONOS scale-up to 4 nodes ")
405 import time
406 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700407 main.ONOS5.handle.sendline("./onos.sh core stop")
408 main.ONOS6.handle.sendline("./onos.sh core stop")
409 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700410
411
412 main.Zookeeper4.start()
santhoshf6863782014-08-11 15:28:24 -0700413 time.sleep(5)
414
415 main.RamCloud4.del_db()
416 time.sleep(3)
417 main.RamCloud4.start_serv()
418 time.sleep(3)
santhosh91195f12014-08-07 13:53:50 -0700419 main.ONOS4.start()
420 main.ONOS4.start_rest()
421 time.sleep(5)
422 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
423 for i in range(3):
424 if data == main.FALSE:
425 #main.log.report("Something is funny... restarting ONOS")
426 #main.ONOS1.stop()
427 time.sleep(3)
428 #main.ONOS1.start()
429 #time.sleep(5)
430 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
431 else:
432 break
433 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700434
435 time.sleep(10)
436
437 def CASE5(self,main):
438
439 main.case("Starting ONOS scale-up/down to 5 nodes ")
440 import time
441 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700442 main.ONOS6.handle.sendline("./onos.sh core stop")
443 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700444 #pdata = main.ONOS5.isup()
445
446 main.Zookeeper5.start()
447 time.sleep(5)
448
449 main.RamCloud5.del_db()
450 time.sleep(3)
451 main.RamCloud5.start_serv()
452 time.sleep(3)
453 main.ONOS5.start()
454 main.ONOS5.start_rest()
455 time.sleep(5)
456 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
457 for i in range(3):
458 if data == main.FALSE:
459 #main.log.report("Something is funny... restarting ONOS")
460 #main.ONOS1.stop()
461 time.sleep(3)
462 #main.ONOS1.start()
463 #time.sleep(5)
464 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
465 else:
466 break
467 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
santhosh91195f12014-08-07 13:53:50 -0700468 time.sleep(10)
469
470 def CASE6(self,main):
471
santhoshbc421422014-08-17 09:48:49 -0700472 main.case("Starting ONOS scale-up/down to 6 nodes ")
473 import time
474 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700475 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700476 #pdata = main.ONOS6.isup()
477
478 main.Zookeeper6.start()
479 time.sleep(5)
480
481 main.RamCloud6.del_db()
482 time.sleep(3)
483 main.RamCloud6.start_serv()
484 time.sleep(3)
485 main.ONOS6.start()
486 main.ONOS6.start_rest()
487 time.sleep(5)
488 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
489 for i in range(3):
490 if data == main.FALSE:
491 #main.log.report("Something is funny... restarting ONOS")
492 #main.ONOS1.stop()
493 time.sleep(3)
494 #main.ONOS1.start()
495 #time.sleep(5)
496 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
497 else:
498 break
499 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
500 time.sleep(10)
501
502 def CASE7(self,main):
503
504 main.case("Starting ONOS scale-up/down to 7 nodes ")
505 import time
506 # main.RamCloud4.start_serv()
507 #pdata = main.ONOS7.isup()
508
509 main.Zookeeper7.start()
510 time.sleep(5)
511
512 main.RamCloud7.del_db()
513 time.sleep(3)
514 main.RamCloud7.start_serv()
515 time.sleep(3)
516 main.ONOS7.start()
517 main.ONOS7.start_rest()
518 time.sleep(5)
519 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()
520 for i in range(3):
521 if data == main.FALSE:
522 #main.log.report("Something is funny... restarting ONOS")
523 #main.ONOS1.stop()
524 time.sleep(3)
525 #main.ONOS1.start()
526 #time.sleep(5)
527 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()
528 else:
529 break
530 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
531 time.sleep(10)
532
533
534
535 def CASE41(self,main):
536 main.case("Starting SB test for 4 nodes")
santhosh91195f12014-08-07 13:53:50 -0700537 ip1 = main.params['CTRL']['ip1']
538 ip2 = main.params['CTRL']['ip2']
539 ip3 = main.params['CTRL']['ip3']
540 ip4 = main.params['CTRL']['ip4']
541 rate1 = main.params['RATE1']
542 run_dur = main.params['RUN_DUR']
543 loop = int( main.params['loop'])
544 switches_num = main.params['switches_num']
545 port = main.params['port']
546 print loop
santhoshbc421422014-08-17 09:48:49 -0700547 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700548 sleep_t =int( main.params['sleep_t'])
549 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700550 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
551 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)
552 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700553 import time
554 import json
santhoshfe88a202014-08-19 18:53:23 -0700555 import math
santhoshbc421422014-08-17 09:48:49 -0700556 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700557 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
558 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
559 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
560 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
561 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
santhoshfe88a202014-08-19 18:53:23 -0700562 tpval = 0.0
563 global tpavg4n
564 tpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700565
566 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
567 #time.sleep(10)
568 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700569 j1 = main.ONOS2.get_json(url1)
570 j2 = main.ONOS2.get_json(url2)
571 j3 = main.ONOS2.get_json(url3)
572 j4 = main.ONOS2.get_json(url4)
573 json_str = []
574 json_str.append(0)
575 json_str.append(j1)
576 json_str.append(j2)
577 json_str.append(j3)
578 json_str.append(j4)
579 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
santhosh91195f12014-08-07 13:53:50 -0700580 # write_str = str(json_str["meters"][4]["meter"][2])
581 #print str(json_str["meters"][4])
582 #f.write(str(json_str["meters"][4]))
583 #f.write('\n')
584 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700585 for j in range(1,5):
586 f.write("ONOS" + str(j) + "\n")
587 f.write(str(json_str[j]["meters"][4]['meter']['count']))
588 f.write('\t')
589 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
590 f.write('\t')
591 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
592 f.write('\t')
593 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
594 f.write('\t')
595 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
596 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700597 if j == 3:
598 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
599 # print tpval
santhoshbc421422014-08-17 09:48:49 -0700600
santhosh91195f12014-08-07 13:53:50 -0700601 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700602 f.write('\n')
603
santhoshbc421422014-08-17 09:48:49 -0700604 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700605 time.sleep(sleep_t)
606 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700607 # print tpval
608 print("\n")
609 tpavg4n = round(tpval)/loop
610 print tpavg4n
santhoshbc421422014-08-17 09:48:49 -0700611
santhosh91195f12014-08-07 13:53:50 -0700612 #main.Mininet2.handle.expect("\$", timeout=900)
613 #main.Mininet2.handle.sendline("sudo mn -c")
614 #main.Mininet2.handle.expect("\$")
615 time.sleep(5)
616 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700617 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700618
619
santhoshbc421422014-08-17 09:48:49 -0700620 def CASE42(self,main):
santhosh91195f12014-08-07 13:53:50 -0700621
622 ip1 = main.params['CTRL']['ip1']
623 ip2 = main.params['CTRL']['ip2']
624 ip3 = main.params['CTRL']['ip3']
625 ip4 = main.params['CTRL']['ip4']
626
627 import time
628 import json
629 rate2 = main.params['RATE2']
630 run_dur = main.params['RUN_DUR']
631 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700632 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700633 sleep_t = int(main.params['sleep_t'])
santhoshf6863782014-08-11 15:28:24 -0700634 switches_num = main.params['switches_num']
santhosh91195f12014-08-07 13:53:50 -0700635 port = main.params['port']
636 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700637 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
638 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)
639 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700640 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700641 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close()
642 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
643 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
644 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
645 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
646 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a")
647 #time.sleep(10)
648 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700649 j1 = main.ONOS2.get_json(url1)
650 j2 = main.ONOS2.get_json(url2)
651 j3 = main.ONOS2.get_json(url3)
652 j4 = main.ONOS2.get_json(url4)
653 json_str = []
654 json_str.append(0)
655 json_str.append(j1)
656 json_str.append(j2)
657 json_str.append(j3)
658 json_str.append(j4)
659 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
660 # write_str = str(json_str["meters"][4]["meter"][2])
661 #print str(json_str["meters"][4])
662 #f.write(str(json_str["meters"][4]))
663 #f.write('\n')
664 #time.sleep(3)
665 for j in range(1,5):
666 f.write("ONOS" + str(j) + "\n")
667 f.write(str(json_str[j]["meters"][4]['meter']['count']))
668 f.write('\t')
669 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
670 f.write('\t')
671 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
672 f.write('\t')
673 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
674 f.write('\t')
675 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
676 f.write('\n')
677
678 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700679 f.write('\n')
680
santhoshbc421422014-08-17 09:48:49 -0700681 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700682 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700683 f.close()
684 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700685
santhoshbc421422014-08-17 09:48:49 -0700686 def CASE43(self,main):
santhosh91195f12014-08-07 13:53:50 -0700687
688 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
689 ip1 = main.params['CTRL']['ip1']
690 ip2 = main.params['CTRL']['ip2']
691 ip3 = main.params['CTRL']['ip3']
692 ip4 = main.params['CTRL']['ip4']
693
694 import time
695 import json
santhoshfe88a202014-08-19 18:53:23 -0700696 int_num = main.params['int_num']
697 addrate = main.params['addrate']
698 NBdur = main.params['NBdur']
699 NBsleep = int(main.params['NBsleep'])
700 NBsleep_init = int(main.params['NBsleep_init'])
701 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700702 nbtpval = 0.0
703 global nbtpavg4n
704 nbtpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700705
706 main.Mininet4.handle.expect("\$")
707 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
708 #main.Mininet2.handle.expect("mininet>" , timeout=400)
709 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
710 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
711 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
712 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
713 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633")
714 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633")
715 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633")
santhoshd3957122014-08-21 19:33:58 -0700716
santhosh91195f12014-08-07 13:53:50 -0700717 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
718 main.ONOS3.handle.expect("\$")
719
santhosh518cc672014-08-20 16:32:26 -0700720 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 -0700721 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700722
723
santhoshfe88a202014-08-19 18:53:23 -0700724 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700725 import json
726
727 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
728 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
729 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
730 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
731 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
732 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
733 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700734 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700735 j1 = main.ONOS2.get_json(url1)
736 j2 = main.ONOS2.get_json(url2)
737 j3 = main.ONOS2.get_json(url3)
738 j4 = main.ONOS2.get_json(url4)
739 json_str = []
740 json_str.append(0)
741 json_str.append(j1)
742 json_str.append(j2)
743 json_str.append(j3)
744 json_str.append(j4)
745 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
746 for j in range(1,5):
747 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
748 f.write(str(json_str[j]["meters"][0]['meter']['count']))
749 f.write('\t')
750 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
751 f.write('\t')
752 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
753 f.write('\t')
754 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
755 f.write('\t')
756 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
757 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700758
santhoshbc421422014-08-17 09:48:49 -0700759 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700760
santhoshbc421422014-08-17 09:48:49 -0700761 f.write("--------------------------------------------------------------------------------- \n")
762
763 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
764 f.write(str(json_str[j]["meters"][1]['meter']['count']))
765 f.write('\t')
766 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
767 f.write('\t')
768 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
769 f.write('\t')
770 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
771 f.write('\t')
772 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
773 f.write('\n')
774 f.write('\n')
775 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -0700776 if j == 3:
777 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh91195f12014-08-07 13:53:50 -0700778
santhoshbc421422014-08-17 09:48:49 -0700779 f.write("--------------------------------------------------------------------------------- \n")
780 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700781 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700782 f.close()
santhosh518cc672014-08-20 16:32:26 -0700783 print("\n")
784 nbtpavg4n = round(nbtpval)/NBloop
785 print nbtpavg4n
santhoshbc421422014-08-17 09:48:49 -0700786
santhosh91195f12014-08-07 13:53:50 -0700787
788 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -0700789 time.sleep(180)
santhoshbc421422014-08-17 09:48:49 -0700790
791 def CASE51(self,main):
792 main.case("Starting SB test for 5 nodes")
793 ip1 = main.params['CTRL']['ip1']
794 ip2 = main.params['CTRL']['ip2']
795 ip3 = main.params['CTRL']['ip3']
796 ip4 = main.params['CTRL']['ip4']
797 ip5 = main.params['CTRL']['ip5']
798 rate1 = main.params['RATE1']
799 run_dur = main.params['RUN_DUR']
800 loop = int( main.params['loop'])
801 switches_num = main.params['switches_num']
802 port = main.params['port']
803 print loop
804 sleep_init = int(main.params['sleep_init'])
805 sleep_t =int( main.params['sleep_t'])
806 main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
807 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
808 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)
809 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
810 import time
811 import json
santhoshfe88a202014-08-19 18:53:23 -0700812 tpval = 0.0
813 global tpavg5n
814 tpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700815 time.sleep(sleep_init)
816
817 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close()
818 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
819 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
820 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
821 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
822 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
823
824 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a")
825 #time.sleep(10)
826 for i in range(int (loop)):
827 j1 = main.ONOS2.get_json(url1)
828 j2 = main.ONOS2.get_json(url2)
829 j3 = main.ONOS2.get_json(url3)
830 j4 = main.ONOS2.get_json(url4)
831 j5 = main.ONOS2.get_json(url5)
832 json_str = []
833 json_str.append(0)
834 json_str.append(j1)
835 json_str.append(j2)
836 json_str.append(j3)
837 json_str.append(j4)
838 json_str.append(j5)
839 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
840 # write_str = str(json_str["meters"][4]["meter"][2])
841 #print str(json_str["meters"][4])
842 #f.write(str(json_str["meters"][4]))
843 #f.write('\n')
844 #time.sleep(3)
845 for j in range(1,6):
846 f.write("ONOS" + str(j) + "\n")
847 f.write(str(json_str[j]["meters"][4]['meter']['count']))
848 f.write('\t')
849 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
850 f.write('\t')
851 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
852 f.write('\t')
853 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
854 f.write('\t')
855 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
856 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700857 if j == 3:
858 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
859 #print tpval
santhoshbc421422014-08-17 09:48:49 -0700860
861 f.write('\n')
862 f.write('\n')
863
864 f.write("--------------------------------------------------------------------------------- \n")
865 time.sleep(sleep_t)
866 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700867 #print tpval
868 print("\n")
869 tpavg5n = round(tpval)/loop
870 print tpavg5n
santhoshbc421422014-08-17 09:48:49 -0700871
872 #main.Mininet2.handle.expect("\$", timeout=900)
873 #main.Mininet2.handle.sendline("sudo mn -c")
874 #main.Mininet2.handle.expect("\$")
875 time.sleep(5)
876 main.Mininet2.handle.expect("\$", timeout=900)
877 time.sleep(180)
878
879
880 def CASE52(self,main):
881
882 ip1 = main.params['CTRL']['ip1']
883 ip2 = main.params['CTRL']['ip2']
884 ip3 = main.params['CTRL']['ip3']
885 ip4 = main.params['CTRL']['ip4']
886 ip5 = main.params['CTRL']['ip5']
887
888 import time
889 import json
890 rate2 = main.params['RATE2']
891 run_dur = main.params['RUN_DUR']
892 loop = int(main.params['loop'])
893 sleep_t = int(main.params['sleep_t'])
894 sleep_init = int(main.params['sleep_init'])
895 switches_num = main.params['switches_num']
896 port = main.params['port']
897 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
898 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
899 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)
900 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
901 time.sleep(sleep_init)
902 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", 'w').close()
903 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
904 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
905 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
906 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
907 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
908 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", "a")
909 #time.sleep(10)
910 for i in range(int (loop)):
911 j1 = main.ONOS2.get_json(url1)
912 j2 = main.ONOS2.get_json(url2)
913 j3 = main.ONOS2.get_json(url3)
914 j4 = main.ONOS2.get_json(url4)
915 j5 = main.ONOS2.get_json(url5)
916 json_str = []
917 json_str.append(0)
918 json_str.append(j1)
919 json_str.append(j2)
920 json_str.append(j3)
921 json_str.append(j4)
922 json_str.append(j5)
923 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[4] != "":
924 # write_str = str(json_str["meters"][4]["meter"][2])
925 #print str(json_str["meters"][4])
926 #f.write(str(json_str["meters"][4]))
927 #f.write('\n')
928 #time.sleep(3)
929 for j in range(1,6):
930 f.write("ONOS" + str(j) + "\n")
931 f.write(str(json_str[j]["meters"][4]['meter']['count']))
932 f.write('\t')
933 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
934 f.write('\t')
935 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
936 f.write('\t')
937 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
938 f.write('\t')
939 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
940 f.write('\n')
941
942 f.write('\n')
943 f.write('\n')
944
945 f.write("--------------------------------------------------------------------------------- \n")
946 time.sleep(sleep_t)
947 f.close()
948 time.sleep(180)
949
950 def CASE53(self,main):
951
santhosh518cc672014-08-20 16:32:26 -0700952 main.case("Starting NB Throughput test after scaling up to 5 onos nodes")
santhoshbc421422014-08-17 09:48:49 -0700953 ip1 = main.params['CTRL']['ip1']
954 ip2 = main.params['CTRL']['ip2']
955 ip3 = main.params['CTRL']['ip3']
956 ip4 = main.params['CTRL']['ip4']
957
958 import time
959 import json
santhoshfe88a202014-08-19 18:53:23 -0700960 int_num = main.params['int_num']
961 addrate = main.params['addrate']
962 NBdur = main.params['NBdur']
963 NBsleep = int(main.params['NBsleep'])
964 NBsleep_init = int(main.params['NBsleep_init'])
965 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700966 nbtpval = 0.0
967 global nbtpavg5n
968 nbtpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700969
970 main.Mininet4.handle.expect("\$")
971 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
972 #main.Mininet2.handle.expect("mininet>" , timeout=400)
973 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
974 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
975 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
976 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -0700977 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
978 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
979 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.5:6633")
santhoshd3957122014-08-21 19:33:58 -0700980
santhoshbc421422014-08-17 09:48:49 -0700981 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
982 main.ONOS3.handle.expect("\$")
983
santhosh518cc672014-08-20 16:32:26 -0700984 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 -0700985 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700986
987
santhoshfe88a202014-08-19 18:53:23 -0700988 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -0700989 import json
990
991 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close()
992 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
993 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
994 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
995 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
996 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
997 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a")
998 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700999 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001000 j1 = main.ONOS2.get_json(url1)
1001 j2 = main.ONOS2.get_json(url2)
1002 j3 = main.ONOS2.get_json(url3)
1003 j4 = main.ONOS2.get_json(url4)
1004 j5 = main.ONOS2.get_json(url5)
1005 json_str = []
1006 json_str.append(0)
1007 json_str.append(j1)
1008 json_str.append(j2)
1009 json_str.append(j3)
1010 json_str.append(j4)
1011 json_str.append(j5)
1012 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
1013 for j in range(1,6):
1014 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1015 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1016 f.write('\t')
1017 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1018 f.write('\t')
1019 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1020 f.write('\t')
1021 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1022 f.write('\t')
1023 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1024 f.write('\n')
1025
1026 f.write('\n')
1027
1028 f.write("--------------------------------------------------------------------------------- \n")
1029
1030 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1031 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1032 f.write('\t')
1033 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1034 f.write('\t')
1035 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1036 f.write('\t')
1037 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1038 f.write('\t')
1039 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1040 f.write('\n')
1041 f.write('\n')
1042 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001043 if j == 3:
1044 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1045
santhoshbc421422014-08-17 09:48:49 -07001046
1047 f.write("--------------------------------------------------------------------------------- \n")
1048 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001049 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001050 f.close()
santhosh518cc672014-08-20 16:32:26 -07001051 print("\n")
1052 nbtpavg5n = round(nbtpval)/NBloop
1053 print nbtpavg5n
santhoshbc421422014-08-17 09:48:49 -07001054
1055
1056 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001057 time.sleep(180)
1058
santhoshbc421422014-08-17 09:48:49 -07001059 def CASE61(self,main):
1060 main.case("Starting SB test for 5 nodes")
1061 ip1 = main.params['CTRL']['ip1']
1062 ip2 = main.params['CTRL']['ip2']
1063 ip3 = main.params['CTRL']['ip3']
1064 ip4 = main.params['CTRL']['ip4']
1065 ip5 = main.params['CTRL']['ip5']
1066 ip6 = main.params['CTRL']['ip6']
1067 rate1 = main.params['RATE1']
1068 run_dur = main.params['RUN_DUR']
1069 loop = int( main.params['loop'])
1070 switches_num = main.params['switches_num']
1071 port = main.params['port']
1072 print loop
1073 sleep_t =int( main.params['sleep_t'])
1074 sleep_init = int(main.params['sleep_init'])
1075 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1076 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1077 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)
1078 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1079
1080 import time
1081 import json
santhoshfe88a202014-08-19 18:53:23 -07001082 tpval = 0.0
1083 global tpavg6n
1084 tpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001085 time.sleep(sleep_init)
1086 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close()
1087 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1088 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1089 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1090 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1091 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1092 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1093 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1094
1095 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a")
1096 #time.sleep(10)
1097 for i in range(int (loop)):
1098 j1 = main.ONOS2.get_json(url1)
1099 j2 = main.ONOS2.get_json(url2)
1100 j3 = main.ONOS2.get_json(url3)
1101 j4 = main.ONOS2.get_json(url4)
1102 j5 = main.ONOS2.get_json(url5)
1103 j6 = main.ONOS2.get_json(url6)
1104 json_str = []
1105 json_str.append(0)
1106 json_str.append(j1)
1107 json_str.append(j2)
1108 json_str.append(j3)
1109 json_str.append(j4)
1110 json_str.append(j5)
1111 json_str.append(j6)
1112 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1113 # write_str = str(json_str["meters"][4]["meter"][2])
1114 #print str(json_str["meters"][4])
1115 #f.write(str(json_str["meters"][4]))
1116 #f.write('\n')
1117 #time.sleep(3)
1118 for j in range(1,7):
1119 f.write("ONOS" + str(j) + "\n")
1120 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1121 f.write('\t')
1122 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1123 f.write('\t')
1124 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1125 f.write('\t')
1126 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1127 f.write('\t')
1128 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1129 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001130 if j == 3:
1131 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1132 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001133
1134 f.write('\n')
1135 f.write('\n')
1136
1137 f.write("--------------------------------------------------------------------------------- \n")
1138 time.sleep(sleep_t)
1139 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001140 #print tpval
1141 print("\n")
1142 tpavg6n = round(tpval)/loop
1143 print tpavg6n
santhoshbc421422014-08-17 09:48:49 -07001144
1145 #main.Mininet2.handle.expect("\$", timeout=900)
1146 #main.Mininet2.handle.sendline("sudo mn -c")
1147 #main.Mininet2.handle.expect("\$")
1148 time.sleep(5)
1149 main.Mininet2.handle.expect("\$", timeout=900)
1150 time.sleep(180)
1151
1152
1153 def CASE62(self,main):
1154
1155 ip1 = main.params['CTRL']['ip1']
1156 ip2 = main.params['CTRL']['ip2']
1157 ip3 = main.params['CTRL']['ip3']
1158 ip4 = main.params['CTRL']['ip4']
1159 ip5 = main.params['CTRL']['ip5']
1160 ip6 = main.params['CTRL']['ip6']
1161
1162 import time
1163 import json
1164 rate2 = main.params['RATE2']
1165 run_dur = main.params['RUN_DUR']
1166 loop = int(main.params['loop'])
1167 sleep_t = int(main.params['sleep_t'])
1168 switches_num = main.params['switches_num']
1169 sleep_init = int(main.params['sleep_init'])
1170 port = main.params['port']
1171 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1172 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1173 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)
1174 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1175 time.sleep(sleep_init)
1176 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", 'w').close()
1177 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1178 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1179 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1180 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1181 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1182 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1183 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1184 #time.sleep(10)
1185 for i in range(int (loop)):
1186 j1 = main.ONOS2.get_json(url1)
1187 j2 = main.ONOS2.get_json(url2)
1188 j3 = main.ONOS2.get_json(url3)
1189 j4 = main.ONOS2.get_json(url4)
1190 j5 = main.ONOS2.get_json(url5)
1191 j6 = main.ONOS2.get_json(url6)
1192 json_str = []
1193 json_str.append(0)
1194 json_str.append(j1)
1195 json_str.append(j2)
1196 json_str.append(j3)
1197 json_str.append(j4)
1198 json_str.append(j5)
1199 json_str.append(j6)
1200 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1201 # write_str = str(json_str["meters"][4]["meter"][2])
1202 #print str(json_str["meters"][4])
1203 #f.write(str(json_str["meters"][4]))
1204 #f.write('\n')
1205 #time.sleep(3)
1206 for j in range(1,7):
1207 f.write("ONOS" + str(j) + "\n")
1208 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1209 f.write('\t')
1210 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1211 f.write('\t')
1212 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1213 f.write('\t')
1214 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1215 f.write('\t')
1216 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1217 f.write('\n')
1218
1219 f.write('\n')
1220 f.write('\n')
1221
1222 f.write("--------------------------------------------------------------------------------- \n")
1223 time.sleep(sleep_t)
1224 f.close()
1225 time.sleep(180)
1226
1227 def CASE63(self,main):
1228
1229 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1230 ip1 = main.params['CTRL']['ip1']
1231 ip2 = main.params['CTRL']['ip2']
1232 ip3 = main.params['CTRL']['ip3']
1233 ip4 = main.params['CTRL']['ip4']
1234
1235 import time
1236 import json
santhoshfe88a202014-08-19 18:53:23 -07001237 int_num = main.params['int_num']
1238 addrate = main.params['addrate']
1239 NBdur = main.params['NBdur']
1240 NBsleep = int(main.params['NBsleep'])
1241 NBsleep_init = int(main.params['NBsleep_init'])
1242 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -07001243 nbtpval = 0.0
1244 global nbtpavg6n
1245 nbtpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001246
1247 main.Mininet4.handle.expect("\$")
1248 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1249 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1250 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1251 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1252 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1253 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001254 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1255 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1256 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.6:6633")
santhoshd3957122014-08-21 19:33:58 -07001257
santhoshbc421422014-08-17 09:48:49 -07001258 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1259 main.ONOS3.handle.expect("\$")
1260
santhosh518cc672014-08-20 16:32:26 -07001261 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 -07001262 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001263
1264
santhoshfe88a202014-08-19 18:53:23 -07001265 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001266 import json
1267
1268 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close()
1269 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1270 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1271 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1272 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1273 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1274 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1275 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a")
1276 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001277 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001278 j1 = main.ONOS2.get_json(url1)
1279 j2 = main.ONOS2.get_json(url2)
1280 j3 = main.ONOS2.get_json(url3)
1281 j4 = main.ONOS2.get_json(url4)
1282 j5 = main.ONOS2.get_json(url5)
1283 j6 = main.ONOS2.get_json(url6)
1284 json_str = []
1285 json_str.append(0)
1286 json_str.append(j1)
1287 json_str.append(j2)
1288 json_str.append(j3)
1289 json_str.append(j4)
1290 json_str.append(j5)
1291 json_str.append(j6)
1292 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1293 for j in range(1,7):
1294 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1295 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1296 f.write('\t')
1297 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1298 f.write('\t')
1299 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1300 f.write('\t')
1301 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1302 f.write('\t')
1303 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1304 f.write('\n')
1305
1306 f.write('\n')
1307
1308 f.write("--------------------------------------------------------------------------------- \n")
1309
1310 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1311 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1312 f.write('\t')
1313 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1314 f.write('\t')
1315 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1316 f.write('\t')
1317 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1318 f.write('\t')
1319 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1320 f.write('\n')
1321 f.write('\n')
1322 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001323 if j == 3:
1324 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1325
santhoshbc421422014-08-17 09:48:49 -07001326
1327 f.write("--------------------------------------------------------------------------------- \n")
1328 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001329 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001330 f.close()
santhosh518cc672014-08-20 16:32:26 -07001331 print("\n")
1332 nbtpavg6n = round(nbtpval)/NBloop
1333 print nbtpavg6n
1334
santhoshbc421422014-08-17 09:48:49 -07001335
1336
1337 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001338 time.sleep(180)
1339
santhoshbc421422014-08-17 09:48:49 -07001340 def CASE71(self,main):
1341 main.case("Starting SB test for 7 nodes")
1342 ip1 = main.params['CTRL']['ip1']
1343 ip2 = main.params['CTRL']['ip2']
1344 ip3 = main.params['CTRL']['ip3']
1345 ip4 = main.params['CTRL']['ip4']
1346 ip5 = main.params['CTRL']['ip5']
1347 ip6 = main.params['CTRL']['ip6']
1348 ip7 = main.params['CTRL']['ip7']
1349 rate1 = main.params['RATE1']
1350 run_dur = main.params['RUN_DUR']
1351 loop = int( main.params['loop'])
1352 switches_num = main.params['switches_num']
1353 port = main.params['port']
1354 print loop
1355 sleep_t =int( main.params['sleep_t'])
1356 sleep_init = int(main.params['sleep_init'])
1357 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1358 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1359 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)
1360 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1361 import time
1362 import json
santhoshfe88a202014-08-19 18:53:23 -07001363 tpval = 0.0
1364 global tpavg7n
1365 tpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001366 time.sleep(sleep_init)
1367
1368 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close()
1369 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1370 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1371 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1372 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1373 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1374 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1375 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1376 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1377
1378 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a")
1379 #time.sleep(10)
1380 for i in range(int (loop)):
1381 j1 = main.ONOS2.get_json(url1)
1382 j2 = main.ONOS2.get_json(url2)
1383 j3 = main.ONOS2.get_json(url3)
1384 j4 = main.ONOS2.get_json(url4)
1385 j5 = main.ONOS2.get_json(url5)
1386 j6 = main.ONOS2.get_json(url6)
1387 j7 = main.ONOS2.get_json(url7)
1388 json_str = []
1389 json_str.append(0)
1390 json_str.append(j1)
1391 json_str.append(j2)
1392 json_str.append(j3)
1393 json_str.append(j4)
1394 json_str.append(j5)
1395 json_str.append(j6)
1396 json_str.append(j7)
1397 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] != "":
1398 # write_str = str(json_str["meters"][4]["meter"][2])
1399 #print str(json_str["meters"][4])
1400 #f.write(str(json_str["meters"][4]))
1401 #f.write('\n')
1402 #time.sleep(3)
1403 for j in range(1,8):
1404 f.write("ONOS" + str(j) + "\n")
1405 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1406 f.write('\t')
1407 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1408 f.write('\t')
1409 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1410 f.write('\t')
1411 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1412 f.write('\t')
1413 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1414 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001415 if j == 3:
1416 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1417 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001418
1419 f.write('\n')
1420 f.write('\n')
1421
1422 f.write("--------------------------------------------------------------------------------- \n")
1423 time.sleep(sleep_t)
1424 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001425 #print tpval
1426 print("\n")
1427 tpavg7n = round(tpval)/loop
1428 print tpavg7n
santhoshbc421422014-08-17 09:48:49 -07001429
1430 #main.Mininet2.handle.expect("\$", timeout=900)
1431 #main.Mininet2.handle.sendline("sudo mn -c")
1432 #main.Mininet2.handle.expect("\$")
1433 time.sleep(5)
1434 main.Mininet2.handle.expect("\$", timeout=900)
1435 time.sleep(180)
1436
1437
1438 def CASE72(self,main):
1439
1440 ip1 = main.params['CTRL']['ip1']
1441 ip2 = main.params['CTRL']['ip2']
1442 ip3 = main.params['CTRL']['ip3']
1443 ip4 = main.params['CTRL']['ip4']
1444 ip5 = main.params['CTRL']['ip5']
1445 ip6 = main.params['CTRL']['ip6']
1446 ip7 = main.params['CTRL']['ip7']
1447
1448 import time
1449 import json
1450 rate2 = main.params['RATE2']
1451 run_dur = main.params['RUN_DUR']
1452 loop = int(main.params['loop'])
1453 sleep_t = int(main.params['sleep_t'])
1454 sleep_init = int(main.params['sleep_init'])
1455 switches_num = main.params['switches_num']
1456 port = main.params['port']
1457 main.case("Starting SB load on 7 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1458 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1459 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)
1460 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1461
1462 time.sleep(sleep_init)
1463
1464 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate2", 'w').close()
1465 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1466 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1467 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1468 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1469 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1470 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1471 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1472 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1473 #time.sleep(10)
1474 for i in range(int (loop)):
1475 j1 = main.ONOS2.get_json(url1)
1476 j2 = main.ONOS2.get_json(url2)
1477 j3 = main.ONOS2.get_json(url3)
1478 j4 = main.ONOS2.get_json(url4)
1479 j5 = main.ONOS2.get_json(url5)
1480 j6 = main.ONOS2.get_json(url6)
1481 j7 = main.ONOS2.get_json(url7)
1482 json_str = []
1483 json_str.append(0)
1484 json_str.append(j1)
1485 json_str.append(j2)
1486 json_str.append(j3)
1487 json_str.append(j4)
1488 json_str.append(j5)
1489 json_str.append(j6)
1490 json_str.append(j7)
1491 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] != "":
1492 # write_str = str(json_str["meters"][4]["meter"][2])
1493 #print str(json_str["meters"][4])
1494 #f.write(str(json_str["meters"][4]))
1495 #f.write('\n')
1496 #time.sleep(3)
1497 for j in range(1,8):
1498 f.write("ONOS" + str(j) + "\n")
1499 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1500 f.write('\t')
1501 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1502 f.write('\t')
1503 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1504 f.write('\t')
1505 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1506 f.write('\t')
1507 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1508 f.write('\n')
1509
1510 f.write('\n')
1511 f.write('\n')
1512
1513 f.write("--------------------------------------------------------------------------------- \n")
1514 time.sleep(sleep_t)
1515 f.close()
1516 time.sleep(180)
1517
1518 def CASE73(self,main):
1519
1520 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1521 ip1 = main.params['CTRL']['ip1']
1522 ip2 = main.params['CTRL']['ip2']
1523 ip3 = main.params['CTRL']['ip3']
1524 ip4 = main.params['CTRL']['ip4']
1525
1526 import time
1527 import json
santhoshfe88a202014-08-19 18:53:23 -07001528 int_num = main.params['int_num']
1529 addrate = main.params['addrate']
1530 NBdur = main.params['NBdur']
1531 NBsleep = int(main.params['NBsleep'])
1532 NBsleep_init = int(main.params['NBsleep_init'])
1533 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -07001534 nbtpval = 0.0
1535 global nbtpavg7n
1536 nbtpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001537
1538 main.Mininet4.handle.expect("\$")
1539 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1540 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1541 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1542 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1543 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1544 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001545 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1546 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1547 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.7:6633")
santhoshd3957122014-08-21 19:33:58 -07001548
santhoshbc421422014-08-17 09:48:49 -07001549 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1550 main.ONOS3.handle.expect("\$")
1551
santhosh518cc672014-08-20 16:32:26 -07001552 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 -07001553 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001554
1555
santhoshfe88a202014-08-19 18:53:23 -07001556 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001557 import json
1558
1559 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close()
1560 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1561 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1562 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1563 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1564 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1565 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1566 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1567 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a")
1568 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001569 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001570 j1 = main.ONOS2.get_json(url1)
1571 j2 = main.ONOS2.get_json(url2)
1572 j3 = main.ONOS2.get_json(url3)
1573 j4 = main.ONOS2.get_json(url4)
1574 j5 = main.ONOS2.get_json(url5)
1575 j6 = main.ONOS2.get_json(url6)
1576 j7 = main.ONOS2.get_json(url7)
1577 json_str = []
1578 json_str.append(0)
1579 json_str.append(j1)
1580 json_str.append(j2)
1581 json_str.append(j3)
1582 json_str.append(j4)
1583 json_str.append(j5)
1584 json_str.append(j6)
1585 json_str.append(j7)
1586 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] != "":
1587 for j in range(1,8):
1588 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1589 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1590 f.write('\t')
1591 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1592 f.write('\t')
1593 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1594 f.write('\t')
1595 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1596 f.write('\t')
1597 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1598 f.write('\n')
1599
1600 f.write('\n')
1601
1602 f.write("--------------------------------------------------------------------------------- \n")
1603
1604 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1605 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1606 f.write('\t')
1607 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1608 f.write('\t')
1609 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1610 f.write('\t')
1611 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1612 f.write('\t')
1613 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1614 f.write('\n')
1615 f.write('\n')
1616 f.write('\n')
santhosh518cc672014-08-20 16:32:26 -07001617 if j == 3:
1618 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
1619
santhoshbc421422014-08-17 09:48:49 -07001620
1621 f.write("--------------------------------------------------------------------------------- \n")
1622 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001623 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001624 f.close()
santhosh518cc672014-08-20 16:32:26 -07001625 print("\n")
1626 nbtpavg7n = round(nbtpval)/NBloop
1627 print nbtpavg7n
santhoshbc421422014-08-17 09:48:49 -07001628
1629
1630 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001631 time.sleep(180)
1632
santhoshbc421422014-08-17 09:48:49 -07001633 def CASE8(self,main):
1634 import time
1635 main.case("Scaling ONOS down to 6 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001636 main.ONOS7.handle.sendline("./onos.sh core stop")
1637 time.sleep(8)
1638 pdata = main.ONOS7.isup()
1639 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
1640 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001641 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1642 for i in range(3):
1643 if data == main.FALSE:
1644 #main.log.report("Something is funny... restarting ONOS")
1645 #main.ONOS1.stop()
1646 time.sleep(3)
1647 #main.ONOS1.start()
1648 #time.sleep(5)
1649 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1650 else:
1651 break
1652 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1653
1654 def CASE9(self,main):
1655
1656 main.case("Scaling ONOS down to 5 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001657 main.ONOS6.handle.sendline("./onos.sh core stop")
1658 time.sleep(8)
1659 pdata = main.ONOS6.isup() and main.ONOS7.isup()
1660 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001661 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1662 for i in range(3):
1663 if data == main.FALSE:
1664 #main.log.report("Something is funny... restarting ONOS")
1665 #main.ONOS1.stop()
1666 time.sleep(3)
1667 #main.ONOS1.start()
1668 #time.sleep(5)
1669 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1670 else:
1671 break
1672 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1673
1674 def CASE10(self,main):
1675
1676 main.case("Scaling ONOS down to 4 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001677
1678 main.ONOS5.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001679 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001680 pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1681 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001682 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1683 for i in range(3):
1684 if data == main.FALSE:
1685 #main.log.report("Something is funny... restarting ONOS")
1686 #main.ONOS1.stop()
1687 time.sleep(3)
1688 #main.ONOS1.start()
1689 #time.sleep(5)
1690 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1691 else:
1692 break
1693 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1694
1695 def CASE11(self,main):
1696
1697 main.case("Scaling ONOS down to 3 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001698 main.ONOS4.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001699 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001700 pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1701 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001702 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1703 for i in range(3):
1704 if data == main.FALSE:
1705 #main.log.report("Something is funny... restarting ONOS")
1706 #main.ONOS1.stop()
1707 time.sleep(3)
1708 #main.ONOS1.start()
1709 #time.sleep(5)
1710 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1711 else:
1712 break
1713 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1714
1715 def CASE100(self,main):
1716 import os
1717 import time
1718 global timestr
1719 timestr = time.strftime("%Y%m%d-%H%M%S")
1720 main.case("Scale-up tests complete...now making final changes")
1721 main.log.info("moving logs....")
1722 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001723 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001724 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001725 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
1726 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001727 time.sleep(2)
1728 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
santhoshfe88a202014-08-19 18:53:23 -07001729 time.sleep(180)
1730
santhoshbc421422014-08-17 09:48:49 -07001731 def CASE101(self,main):
1732
1733 import os
1734 import time
1735 main.case("Scale-down tests complete...now making final changes")
1736 global timestr
1737 main.case("Scale-down tests complete...now making final changes")
1738 main.log.info("moving logs....")
1739 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001740 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001741 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001742 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
1743 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001744 time.sleep(2)
1745 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
1746 time.sleep(2)
1747
santhoshfe88a202014-08-19 18:53:23 -07001748 def CASE103(self,main):
1749 import os
1750 import time
1751 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1752 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001753 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 -07001754
1755 def CASE104(self,main):
1756 import os
1757 import time
1758 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1759 db_script = main.params['db_script']
santhosh483a4162014-08-20 22:40:51 -07001760 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 -07001761
1762
santhosh518cc672014-08-20 16:32:26 -07001763 def CASE105(self,main):
1764 import os
1765 import time
1766 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1767 db_script = main.params['db_script']
1768 os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'")
1769
1770 def CASE106(self,main):
1771 import os
1772 import time
1773 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1774 db_script = main.params['db_script']
santhoshd3957122014-08-21 19:33:58 -07001775 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 -07001776
santhoshfe88a202014-08-19 18:53:23 -07001777
santhosh91195f12014-08-07 13:53:50 -07001778