blob: 0de3025a1a35d2b6773727220190e66695b9c29e [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")
329
330 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
338
339 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
340 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
341 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
342 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
343 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
344 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700345 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700346 j1 = main.ONOS1.get_json(url1)
347 j2 = main.ONOS1.get_json(url2)
348 j3 = main.ONOS1.get_json(url3)
349 json_str = []
350 json_str.append(0)
351 json_str.append(j1)
352 json_str.append(j2)
353 json_str.append(j3)
354 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
355 for j in range(1,4):
356 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
357 f.write(str(json_str[j]["meters"][0]['meter']['count']))
358 f.write('\t')
359 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
360 f.write('\t')
361 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
362 f.write('\t')
363 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
364 f.write('\t')
365 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
366 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700367
santhoshbc421422014-08-17 09:48:49 -0700368 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700369
santhoshbc421422014-08-17 09:48:49 -0700370 f.write("--------------------------------------------------------------------------------- \n")
371
372 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
373 f.write(str(json_str[j]["meters"][1]['meter']['count']))
374 f.write('\t')
375 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
376 f.write('\t')
377 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
378 f.write('\t')
379 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
380 f.write('\t')
381 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
382 f.write('\n')
383 f.write('\n')
384 f.write('\n')
385
386 f.write("--------------------------------------------------------------------------------- \n")
387 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700388 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700389 f.close()
santhosh91195f12014-08-07 13:53:50 -0700390
santhoshbc421422014-08-17 09:48:49 -0700391 main.ONOS3.handle.expect("\$", timeout=900)
392
393
394 def CASE4(self,main):
santhosh91195f12014-08-07 13:53:50 -0700395
396 main.case("Starting ONOS scale-up to 4 nodes ")
397 import time
398 # main.RamCloud4.start_serv()
santhoshbc421422014-08-17 09:48:49 -0700399 main.ONOS5.stop_all()
400 main.ONOS6.stop_all()
401 main.ONOS7.stop_all()
402
403
404 main.Zookeeper4.start()
santhoshf6863782014-08-11 15:28:24 -0700405 time.sleep(5)
406
407 main.RamCloud4.del_db()
408 time.sleep(3)
409 main.RamCloud4.start_serv()
410 time.sleep(3)
santhosh91195f12014-08-07 13:53:50 -0700411 main.ONOS4.start()
412 main.ONOS4.start_rest()
413 time.sleep(5)
414 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
415 for i in range(3):
416 if data == main.FALSE:
417 #main.log.report("Something is funny... restarting ONOS")
418 #main.ONOS1.stop()
419 time.sleep(3)
420 #main.ONOS1.start()
421 #time.sleep(5)
422 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
423 else:
424 break
425 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 -0700426
427 time.sleep(10)
428
429 def CASE5(self,main):
430
431 main.case("Starting ONOS scale-up/down to 5 nodes ")
432 import time
433 # main.RamCloud4.start_serv()
434 main.ONOS6.stop_all()
435 main.ONOS7.stop_all()
436 #pdata = main.ONOS5.isup()
437
438 main.Zookeeper5.start()
439 time.sleep(5)
440
441 main.RamCloud5.del_db()
442 time.sleep(3)
443 main.RamCloud5.start_serv()
444 time.sleep(3)
445 main.ONOS5.start()
446 main.ONOS5.start_rest()
447 time.sleep(5)
448 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
449 for i in range(3):
450 if data == main.FALSE:
451 #main.log.report("Something is funny... restarting ONOS")
452 #main.ONOS1.stop()
453 time.sleep(3)
454 #main.ONOS1.start()
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 else:
458 break
459 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 -0700460 time.sleep(10)
461
462 def CASE6(self,main):
463
santhoshbc421422014-08-17 09:48:49 -0700464 main.case("Starting ONOS scale-up/down to 6 nodes ")
465 import time
466 # main.RamCloud4.start_serv()
467 main.ONOS7.stop_all()
468 #pdata = main.ONOS6.isup()
469
470 main.Zookeeper6.start()
471 time.sleep(5)
472
473 main.RamCloud6.del_db()
474 time.sleep(3)
475 main.RamCloud6.start_serv()
476 time.sleep(3)
477 main.ONOS6.start()
478 main.ONOS6.start_rest()
479 time.sleep(5)
480 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
481 for i in range(3):
482 if data == main.FALSE:
483 #main.log.report("Something is funny... restarting ONOS")
484 #main.ONOS1.stop()
485 time.sleep(3)
486 #main.ONOS1.start()
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 else:
490 break
491 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
492 time.sleep(10)
493
494 def CASE7(self,main):
495
496 main.case("Starting ONOS scale-up/down to 7 nodes ")
497 import time
498 # main.RamCloud4.start_serv()
499 #pdata = main.ONOS7.isup()
500
501 main.Zookeeper7.start()
502 time.sleep(5)
503
504 main.RamCloud7.del_db()
505 time.sleep(3)
506 main.RamCloud7.start_serv()
507 time.sleep(3)
508 main.ONOS7.start()
509 main.ONOS7.start_rest()
510 time.sleep(5)
511 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()
512 for i in range(3):
513 if data == main.FALSE:
514 #main.log.report("Something is funny... restarting ONOS")
515 #main.ONOS1.stop()
516 time.sleep(3)
517 #main.ONOS1.start()
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 else:
521 break
522 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
523 time.sleep(10)
524
525
526
527 def CASE41(self,main):
528 main.case("Starting SB test for 4 nodes")
santhosh91195f12014-08-07 13:53:50 -0700529 ip1 = main.params['CTRL']['ip1']
530 ip2 = main.params['CTRL']['ip2']
531 ip3 = main.params['CTRL']['ip3']
532 ip4 = main.params['CTRL']['ip4']
533 rate1 = main.params['RATE1']
534 run_dur = main.params['RUN_DUR']
535 loop = int( main.params['loop'])
536 switches_num = main.params['switches_num']
537 port = main.params['port']
538 print loop
santhoshbc421422014-08-17 09:48:49 -0700539 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700540 sleep_t =int( main.params['sleep_t'])
541 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700542 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
543 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)
544 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700545 import time
546 import json
santhoshfe88a202014-08-19 18:53:23 -0700547 import math
santhoshbc421422014-08-17 09:48:49 -0700548 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700549 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
550 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
551 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
552 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
553 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
santhoshfe88a202014-08-19 18:53:23 -0700554 tpval = 0.0
555 global tpavg4n
556 tpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700557
558 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
559 #time.sleep(10)
560 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700561 j1 = main.ONOS2.get_json(url1)
562 j2 = main.ONOS2.get_json(url2)
563 j3 = main.ONOS2.get_json(url3)
564 j4 = main.ONOS2.get_json(url4)
565 json_str = []
566 json_str.append(0)
567 json_str.append(j1)
568 json_str.append(j2)
569 json_str.append(j3)
570 json_str.append(j4)
571 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
santhosh91195f12014-08-07 13:53:50 -0700572 # write_str = str(json_str["meters"][4]["meter"][2])
573 #print str(json_str["meters"][4])
574 #f.write(str(json_str["meters"][4]))
575 #f.write('\n')
576 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700577 for j in range(1,5):
578 f.write("ONOS" + str(j) + "\n")
579 f.write(str(json_str[j]["meters"][4]['meter']['count']))
580 f.write('\t')
581 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
582 f.write('\t')
583 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
584 f.write('\t')
585 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
586 f.write('\t')
587 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
588 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700589 if j == 3:
590 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
591 # print tpval
santhoshbc421422014-08-17 09:48:49 -0700592
santhosh91195f12014-08-07 13:53:50 -0700593 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700594 f.write('\n')
595
santhoshbc421422014-08-17 09:48:49 -0700596 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700597 time.sleep(sleep_t)
598 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700599 # print tpval
600 print("\n")
601 tpavg4n = round(tpval)/loop
602 print tpavg4n
santhoshbc421422014-08-17 09:48:49 -0700603
santhosh91195f12014-08-07 13:53:50 -0700604 #main.Mininet2.handle.expect("\$", timeout=900)
605 #main.Mininet2.handle.sendline("sudo mn -c")
606 #main.Mininet2.handle.expect("\$")
607 time.sleep(5)
608 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700609 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700610
611
santhoshbc421422014-08-17 09:48:49 -0700612 def CASE42(self,main):
santhosh91195f12014-08-07 13:53:50 -0700613
614 ip1 = main.params['CTRL']['ip1']
615 ip2 = main.params['CTRL']['ip2']
616 ip3 = main.params['CTRL']['ip3']
617 ip4 = main.params['CTRL']['ip4']
618
619 import time
620 import json
621 rate2 = main.params['RATE2']
622 run_dur = main.params['RUN_DUR']
623 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700624 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700625 sleep_t = int(main.params['sleep_t'])
santhoshf6863782014-08-11 15:28:24 -0700626 switches_num = main.params['switches_num']
santhosh91195f12014-08-07 13:53:50 -0700627 port = main.params['port']
628 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700629 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
630 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)
631 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700632 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700633 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close()
634 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
635 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
636 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
637 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
638 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a")
639 #time.sleep(10)
640 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700641 j1 = main.ONOS2.get_json(url1)
642 j2 = main.ONOS2.get_json(url2)
643 j3 = main.ONOS2.get_json(url3)
644 j4 = main.ONOS2.get_json(url4)
645 json_str = []
646 json_str.append(0)
647 json_str.append(j1)
648 json_str.append(j2)
649 json_str.append(j3)
650 json_str.append(j4)
651 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
652 # write_str = str(json_str["meters"][4]["meter"][2])
653 #print str(json_str["meters"][4])
654 #f.write(str(json_str["meters"][4]))
655 #f.write('\n')
656 #time.sleep(3)
657 for j in range(1,5):
658 f.write("ONOS" + str(j) + "\n")
659 f.write(str(json_str[j]["meters"][4]['meter']['count']))
660 f.write('\t')
661 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
662 f.write('\t')
663 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
664 f.write('\t')
665 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
666 f.write('\t')
667 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
668 f.write('\n')
669
670 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700671 f.write('\n')
672
santhoshbc421422014-08-17 09:48:49 -0700673 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700674 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700675 f.close()
676 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700677
santhoshbc421422014-08-17 09:48:49 -0700678 def CASE43(self,main):
santhosh91195f12014-08-07 13:53:50 -0700679
680 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
681 ip1 = main.params['CTRL']['ip1']
682 ip2 = main.params['CTRL']['ip2']
683 ip3 = main.params['CTRL']['ip3']
684 ip4 = main.params['CTRL']['ip4']
685
686 import time
687 import json
santhoshfe88a202014-08-19 18:53:23 -0700688 int_num = main.params['int_num']
689 addrate = main.params['addrate']
690 NBdur = main.params['NBdur']
691 NBsleep = int(main.params['NBsleep'])
692 NBsleep_init = int(main.params['NBsleep_init'])
693 NBloop = int(main.params['NBloop'])
santhosh91195f12014-08-07 13:53:50 -0700694
695 main.Mininet4.handle.expect("\$")
696 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
697 #main.Mininet2.handle.expect("mininet>" , timeout=400)
698 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
699 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
700 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
701 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
702 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633")
703 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633")
704 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633")
705
706 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
707 main.ONOS3.handle.expect("\$")
708
santhoshfe88a202014-08-19 18:53:23 -0700709 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 10.128.10.4:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
710 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700711
712
santhoshfe88a202014-08-19 18:53:23 -0700713 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700714 import json
715
716 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
717 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
718 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
719 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
720 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
721 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
722 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700723 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700724 j1 = main.ONOS2.get_json(url1)
725 j2 = main.ONOS2.get_json(url2)
726 j3 = main.ONOS2.get_json(url3)
727 j4 = main.ONOS2.get_json(url4)
728 json_str = []
729 json_str.append(0)
730 json_str.append(j1)
731 json_str.append(j2)
732 json_str.append(j3)
733 json_str.append(j4)
734 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
735 for j in range(1,5):
736 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
737 f.write(str(json_str[j]["meters"][0]['meter']['count']))
738 f.write('\t')
739 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
740 f.write('\t')
741 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
742 f.write('\t')
743 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
744 f.write('\t')
745 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
746 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700747
santhoshbc421422014-08-17 09:48:49 -0700748 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700749
santhoshbc421422014-08-17 09:48:49 -0700750 f.write("--------------------------------------------------------------------------------- \n")
751
752 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
753 f.write(str(json_str[j]["meters"][1]['meter']['count']))
754 f.write('\t')
755 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
756 f.write('\t')
757 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
758 f.write('\t')
759 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
760 f.write('\t')
761 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
762 f.write('\n')
763 f.write('\n')
764 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700765
santhoshbc421422014-08-17 09:48:49 -0700766 f.write("--------------------------------------------------------------------------------- \n")
767 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700768 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700769 f.close()
santhoshbc421422014-08-17 09:48:49 -0700770
santhosh91195f12014-08-07 13:53:50 -0700771
772 main.ONOS3.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700773
774
775 def CASE51(self,main):
776 main.case("Starting SB test for 5 nodes")
777 ip1 = main.params['CTRL']['ip1']
778 ip2 = main.params['CTRL']['ip2']
779 ip3 = main.params['CTRL']['ip3']
780 ip4 = main.params['CTRL']['ip4']
781 ip5 = main.params['CTRL']['ip5']
782 rate1 = main.params['RATE1']
783 run_dur = main.params['RUN_DUR']
784 loop = int( main.params['loop'])
785 switches_num = main.params['switches_num']
786 port = main.params['port']
787 print loop
788 sleep_init = int(main.params['sleep_init'])
789 sleep_t =int( main.params['sleep_t'])
790 main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
791 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
792 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)
793 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
794 import time
795 import json
santhoshfe88a202014-08-19 18:53:23 -0700796 tpval = 0.0
797 global tpavg5n
798 tpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700799 time.sleep(sleep_init)
800
801 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close()
802 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
803 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
804 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
805 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
806 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
807
808 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a")
809 #time.sleep(10)
810 for i in range(int (loop)):
811 j1 = main.ONOS2.get_json(url1)
812 j2 = main.ONOS2.get_json(url2)
813 j3 = main.ONOS2.get_json(url3)
814 j4 = main.ONOS2.get_json(url4)
815 j5 = main.ONOS2.get_json(url5)
816 json_str = []
817 json_str.append(0)
818 json_str.append(j1)
819 json_str.append(j2)
820 json_str.append(j3)
821 json_str.append(j4)
822 json_str.append(j5)
823 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
824 # write_str = str(json_str["meters"][4]["meter"][2])
825 #print str(json_str["meters"][4])
826 #f.write(str(json_str["meters"][4]))
827 #f.write('\n')
828 #time.sleep(3)
829 for j in range(1,6):
830 f.write("ONOS" + str(j) + "\n")
831 f.write(str(json_str[j]["meters"][4]['meter']['count']))
832 f.write('\t')
833 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
834 f.write('\t')
835 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
836 f.write('\t')
837 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
838 f.write('\t')
839 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
840 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700841 if j == 3:
842 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
843 #print tpval
santhoshbc421422014-08-17 09:48:49 -0700844
845 f.write('\n')
846 f.write('\n')
847
848 f.write("--------------------------------------------------------------------------------- \n")
849 time.sleep(sleep_t)
850 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700851 #print tpval
852 print("\n")
853 tpavg5n = round(tpval)/loop
854 print tpavg5n
santhoshbc421422014-08-17 09:48:49 -0700855
856 #main.Mininet2.handle.expect("\$", timeout=900)
857 #main.Mininet2.handle.sendline("sudo mn -c")
858 #main.Mininet2.handle.expect("\$")
859 time.sleep(5)
860 main.Mininet2.handle.expect("\$", timeout=900)
861 time.sleep(180)
862
863
864 def CASE52(self,main):
865
866 ip1 = main.params['CTRL']['ip1']
867 ip2 = main.params['CTRL']['ip2']
868 ip3 = main.params['CTRL']['ip3']
869 ip4 = main.params['CTRL']['ip4']
870 ip5 = main.params['CTRL']['ip5']
871
872 import time
873 import json
874 rate2 = main.params['RATE2']
875 run_dur = main.params['RUN_DUR']
876 loop = int(main.params['loop'])
877 sleep_t = int(main.params['sleep_t'])
878 sleep_init = int(main.params['sleep_init'])
879 switches_num = main.params['switches_num']
880 port = main.params['port']
881 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
882 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
883 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)
884 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
885 time.sleep(sleep_init)
886 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", 'w').close()
887 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
888 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
889 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
890 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
891 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
892 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", "a")
893 #time.sleep(10)
894 for i in range(int (loop)):
895 j1 = main.ONOS2.get_json(url1)
896 j2 = main.ONOS2.get_json(url2)
897 j3 = main.ONOS2.get_json(url3)
898 j4 = main.ONOS2.get_json(url4)
899 j5 = main.ONOS2.get_json(url5)
900 json_str = []
901 json_str.append(0)
902 json_str.append(j1)
903 json_str.append(j2)
904 json_str.append(j3)
905 json_str.append(j4)
906 json_str.append(j5)
907 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[4] != "":
908 # write_str = str(json_str["meters"][4]["meter"][2])
909 #print str(json_str["meters"][4])
910 #f.write(str(json_str["meters"][4]))
911 #f.write('\n')
912 #time.sleep(3)
913 for j in range(1,6):
914 f.write("ONOS" + str(j) + "\n")
915 f.write(str(json_str[j]["meters"][4]['meter']['count']))
916 f.write('\t')
917 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
918 f.write('\t')
919 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
920 f.write('\t')
921 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
922 f.write('\t')
923 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
924 f.write('\n')
925
926 f.write('\n')
927 f.write('\n')
928
929 f.write("--------------------------------------------------------------------------------- \n")
930 time.sleep(sleep_t)
931 f.close()
932 time.sleep(180)
933
934 def CASE53(self,main):
935
936 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
937 ip1 = main.params['CTRL']['ip1']
938 ip2 = main.params['CTRL']['ip2']
939 ip3 = main.params['CTRL']['ip3']
940 ip4 = main.params['CTRL']['ip4']
941
942 import time
943 import json
santhoshfe88a202014-08-19 18:53:23 -0700944 int_num = main.params['int_num']
945 addrate = main.params['addrate']
946 NBdur = main.params['NBdur']
947 NBsleep = int(main.params['NBsleep'])
948 NBsleep_init = int(main.params['NBsleep_init'])
949 NBloop = int(main.params['NBloop'])
santhoshbc421422014-08-17 09:48:49 -0700950
951 main.Mininet4.handle.expect("\$")
952 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
953 #main.Mininet2.handle.expect("mininet>" , timeout=400)
954 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
955 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
956 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
957 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -0700958 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
959 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
960 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.5:6633")
santhoshbc421422014-08-17 09:48:49 -0700961
962 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
963 main.ONOS3.handle.expect("\$")
964
santhoshfe88a202014-08-19 18:53:23 -0700965 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 10.128.10.4:8080 10.128.10.5:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
966 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700967
968
santhoshfe88a202014-08-19 18:53:23 -0700969 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -0700970 import json
971
972 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close()
973 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
974 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
975 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
976 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
977 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
978 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a")
979 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700980 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700981 j1 = main.ONOS2.get_json(url1)
982 j2 = main.ONOS2.get_json(url2)
983 j3 = main.ONOS2.get_json(url3)
984 j4 = main.ONOS2.get_json(url4)
985 j5 = main.ONOS2.get_json(url5)
986 json_str = []
987 json_str.append(0)
988 json_str.append(j1)
989 json_str.append(j2)
990 json_str.append(j3)
991 json_str.append(j4)
992 json_str.append(j5)
993 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
994 for j in range(1,6):
995 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
996 f.write(str(json_str[j]["meters"][0]['meter']['count']))
997 f.write('\t')
998 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
999 f.write('\t')
1000 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1001 f.write('\t')
1002 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1003 f.write('\t')
1004 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1005 f.write('\n')
1006
1007 f.write('\n')
1008
1009 f.write("--------------------------------------------------------------------------------- \n")
1010
1011 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1012 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1013 f.write('\t')
1014 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1015 f.write('\t')
1016 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1017 f.write('\t')
1018 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1019 f.write('\t')
1020 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1021 f.write('\n')
1022 f.write('\n')
1023 f.write('\n')
1024
1025 f.write("--------------------------------------------------------------------------------- \n")
1026 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001027 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001028 f.close()
1029
1030
1031 main.ONOS3.handle.expect("\$", timeout=900)
1032
1033 def CASE61(self,main):
1034 main.case("Starting SB test for 5 nodes")
1035 ip1 = main.params['CTRL']['ip1']
1036 ip2 = main.params['CTRL']['ip2']
1037 ip3 = main.params['CTRL']['ip3']
1038 ip4 = main.params['CTRL']['ip4']
1039 ip5 = main.params['CTRL']['ip5']
1040 ip6 = main.params['CTRL']['ip6']
1041 rate1 = main.params['RATE1']
1042 run_dur = main.params['RUN_DUR']
1043 loop = int( main.params['loop'])
1044 switches_num = main.params['switches_num']
1045 port = main.params['port']
1046 print loop
1047 sleep_t =int( main.params['sleep_t'])
1048 sleep_init = int(main.params['sleep_init'])
1049 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1050 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1051 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)
1052 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1053
1054 import time
1055 import json
santhoshfe88a202014-08-19 18:53:23 -07001056 tpval = 0.0
1057 global tpavg6n
1058 tpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001059 time.sleep(sleep_init)
1060 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close()
1061 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1062 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1063 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1064 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1065 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1066 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1067 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1068
1069 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a")
1070 #time.sleep(10)
1071 for i in range(int (loop)):
1072 j1 = main.ONOS2.get_json(url1)
1073 j2 = main.ONOS2.get_json(url2)
1074 j3 = main.ONOS2.get_json(url3)
1075 j4 = main.ONOS2.get_json(url4)
1076 j5 = main.ONOS2.get_json(url5)
1077 j6 = main.ONOS2.get_json(url6)
1078 json_str = []
1079 json_str.append(0)
1080 json_str.append(j1)
1081 json_str.append(j2)
1082 json_str.append(j3)
1083 json_str.append(j4)
1084 json_str.append(j5)
1085 json_str.append(j6)
1086 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1087 # write_str = str(json_str["meters"][4]["meter"][2])
1088 #print str(json_str["meters"][4])
1089 #f.write(str(json_str["meters"][4]))
1090 #f.write('\n')
1091 #time.sleep(3)
1092 for j in range(1,7):
1093 f.write("ONOS" + str(j) + "\n")
1094 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1095 f.write('\t')
1096 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1097 f.write('\t')
1098 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1099 f.write('\t')
1100 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1101 f.write('\t')
1102 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1103 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001104 if j == 3:
1105 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1106 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001107
1108 f.write('\n')
1109 f.write('\n')
1110
1111 f.write("--------------------------------------------------------------------------------- \n")
1112 time.sleep(sleep_t)
1113 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001114 #print tpval
1115 print("\n")
1116 tpavg6n = round(tpval)/loop
1117 print tpavg6n
santhoshbc421422014-08-17 09:48:49 -07001118
1119 #main.Mininet2.handle.expect("\$", timeout=900)
1120 #main.Mininet2.handle.sendline("sudo mn -c")
1121 #main.Mininet2.handle.expect("\$")
1122 time.sleep(5)
1123 main.Mininet2.handle.expect("\$", timeout=900)
1124 time.sleep(180)
1125
1126
1127 def CASE62(self,main):
1128
1129 ip1 = main.params['CTRL']['ip1']
1130 ip2 = main.params['CTRL']['ip2']
1131 ip3 = main.params['CTRL']['ip3']
1132 ip4 = main.params['CTRL']['ip4']
1133 ip5 = main.params['CTRL']['ip5']
1134 ip6 = main.params['CTRL']['ip6']
1135
1136 import time
1137 import json
1138 rate2 = main.params['RATE2']
1139 run_dur = main.params['RUN_DUR']
1140 loop = int(main.params['loop'])
1141 sleep_t = int(main.params['sleep_t'])
1142 switches_num = main.params['switches_num']
1143 sleep_init = int(main.params['sleep_init'])
1144 port = main.params['port']
1145 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1146 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1147 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)
1148 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1149 time.sleep(sleep_init)
1150 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", 'w').close()
1151 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1152 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1153 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1154 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1155 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1156 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1157 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1158 #time.sleep(10)
1159 for i in range(int (loop)):
1160 j1 = main.ONOS2.get_json(url1)
1161 j2 = main.ONOS2.get_json(url2)
1162 j3 = main.ONOS2.get_json(url3)
1163 j4 = main.ONOS2.get_json(url4)
1164 j5 = main.ONOS2.get_json(url5)
1165 j6 = main.ONOS2.get_json(url6)
1166 json_str = []
1167 json_str.append(0)
1168 json_str.append(j1)
1169 json_str.append(j2)
1170 json_str.append(j3)
1171 json_str.append(j4)
1172 json_str.append(j5)
1173 json_str.append(j6)
1174 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1175 # write_str = str(json_str["meters"][4]["meter"][2])
1176 #print str(json_str["meters"][4])
1177 #f.write(str(json_str["meters"][4]))
1178 #f.write('\n')
1179 #time.sleep(3)
1180 for j in range(1,7):
1181 f.write("ONOS" + str(j) + "\n")
1182 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1183 f.write('\t')
1184 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1185 f.write('\t')
1186 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1187 f.write('\t')
1188 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1189 f.write('\t')
1190 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1191 f.write('\n')
1192
1193 f.write('\n')
1194 f.write('\n')
1195
1196 f.write("--------------------------------------------------------------------------------- \n")
1197 time.sleep(sleep_t)
1198 f.close()
1199 time.sleep(180)
1200
1201 def CASE63(self,main):
1202
1203 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1204 ip1 = main.params['CTRL']['ip1']
1205 ip2 = main.params['CTRL']['ip2']
1206 ip3 = main.params['CTRL']['ip3']
1207 ip4 = main.params['CTRL']['ip4']
1208
1209 import time
1210 import json
santhoshfe88a202014-08-19 18:53:23 -07001211 int_num = main.params['int_num']
1212 addrate = main.params['addrate']
1213 NBdur = main.params['NBdur']
1214 NBsleep = int(main.params['NBsleep'])
1215 NBsleep_init = int(main.params['NBsleep_init'])
1216 NBloop = int(main.params['NBloop'])
santhoshbc421422014-08-17 09:48:49 -07001217
1218 main.Mininet4.handle.expect("\$")
1219 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1220 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1221 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1222 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1223 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1224 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001225 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1226 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1227 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.6:6633")
santhoshbc421422014-08-17 09:48:49 -07001228
1229 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1230 main.ONOS3.handle.expect("\$")
1231
santhoshfe88a202014-08-19 18:53:23 -07001232 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 10.128.10.4:8080 10.128.10.5:8080 10.128.10.6:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
1233 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001234
1235
santhoshfe88a202014-08-19 18:53:23 -07001236 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001237 import json
1238
1239 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close()
1240 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1241 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1242 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1243 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1244 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1245 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1246 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a")
1247 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001248 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001249 j1 = main.ONOS2.get_json(url1)
1250 j2 = main.ONOS2.get_json(url2)
1251 j3 = main.ONOS2.get_json(url3)
1252 j4 = main.ONOS2.get_json(url4)
1253 j5 = main.ONOS2.get_json(url5)
1254 j6 = main.ONOS2.get_json(url6)
1255 json_str = []
1256 json_str.append(0)
1257 json_str.append(j1)
1258 json_str.append(j2)
1259 json_str.append(j3)
1260 json_str.append(j4)
1261 json_str.append(j5)
1262 json_str.append(j6)
1263 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1264 for j in range(1,7):
1265 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1266 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1267 f.write('\t')
1268 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1269 f.write('\t')
1270 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1271 f.write('\t')
1272 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1273 f.write('\t')
1274 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1275 f.write('\n')
1276
1277 f.write('\n')
1278
1279 f.write("--------------------------------------------------------------------------------- \n")
1280
1281 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1282 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1283 f.write('\t')
1284 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1285 f.write('\t')
1286 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1287 f.write('\t')
1288 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1289 f.write('\t')
1290 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1291 f.write('\n')
1292 f.write('\n')
1293 f.write('\n')
1294
1295 f.write("--------------------------------------------------------------------------------- \n")
1296 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001297 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001298 f.close()
1299
1300
1301 main.ONOS3.handle.expect("\$", timeout=900)
1302
1303 def CASE71(self,main):
1304 main.case("Starting SB test for 7 nodes")
1305 ip1 = main.params['CTRL']['ip1']
1306 ip2 = main.params['CTRL']['ip2']
1307 ip3 = main.params['CTRL']['ip3']
1308 ip4 = main.params['CTRL']['ip4']
1309 ip5 = main.params['CTRL']['ip5']
1310 ip6 = main.params['CTRL']['ip6']
1311 ip7 = main.params['CTRL']['ip7']
1312 rate1 = main.params['RATE1']
1313 run_dur = main.params['RUN_DUR']
1314 loop = int( main.params['loop'])
1315 switches_num = main.params['switches_num']
1316 port = main.params['port']
1317 print loop
1318 sleep_t =int( main.params['sleep_t'])
1319 sleep_init = int(main.params['sleep_init'])
1320 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1321 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1322 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)
1323 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1324 import time
1325 import json
santhoshfe88a202014-08-19 18:53:23 -07001326 tpval = 0.0
1327 global tpavg7n
1328 tpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001329 time.sleep(sleep_init)
1330
1331 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close()
1332 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1333 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1334 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1335 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1336 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1337 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1338 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1339 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1340
1341 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a")
1342 #time.sleep(10)
1343 for i in range(int (loop)):
1344 j1 = main.ONOS2.get_json(url1)
1345 j2 = main.ONOS2.get_json(url2)
1346 j3 = main.ONOS2.get_json(url3)
1347 j4 = main.ONOS2.get_json(url4)
1348 j5 = main.ONOS2.get_json(url5)
1349 j6 = main.ONOS2.get_json(url6)
1350 j7 = main.ONOS2.get_json(url7)
1351 json_str = []
1352 json_str.append(0)
1353 json_str.append(j1)
1354 json_str.append(j2)
1355 json_str.append(j3)
1356 json_str.append(j4)
1357 json_str.append(j5)
1358 json_str.append(j6)
1359 json_str.append(j7)
1360 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] != "":
1361 # write_str = str(json_str["meters"][4]["meter"][2])
1362 #print str(json_str["meters"][4])
1363 #f.write(str(json_str["meters"][4]))
1364 #f.write('\n')
1365 #time.sleep(3)
1366 for j in range(1,8):
1367 f.write("ONOS" + str(j) + "\n")
1368 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1369 f.write('\t')
1370 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1371 f.write('\t')
1372 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1373 f.write('\t')
1374 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1375 f.write('\t')
1376 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1377 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001378 if j == 3:
1379 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1380 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001381
1382 f.write('\n')
1383 f.write('\n')
1384
1385 f.write("--------------------------------------------------------------------------------- \n")
1386 time.sleep(sleep_t)
1387 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001388 #print tpval
1389 print("\n")
1390 tpavg7n = round(tpval)/loop
1391 print tpavg7n
santhoshbc421422014-08-17 09:48:49 -07001392
1393 #main.Mininet2.handle.expect("\$", timeout=900)
1394 #main.Mininet2.handle.sendline("sudo mn -c")
1395 #main.Mininet2.handle.expect("\$")
1396 time.sleep(5)
1397 main.Mininet2.handle.expect("\$", timeout=900)
1398 time.sleep(180)
1399
1400
1401 def CASE72(self,main):
1402
1403 ip1 = main.params['CTRL']['ip1']
1404 ip2 = main.params['CTRL']['ip2']
1405 ip3 = main.params['CTRL']['ip3']
1406 ip4 = main.params['CTRL']['ip4']
1407 ip5 = main.params['CTRL']['ip5']
1408 ip6 = main.params['CTRL']['ip6']
1409 ip7 = main.params['CTRL']['ip7']
1410
1411 import time
1412 import json
1413 rate2 = main.params['RATE2']
1414 run_dur = main.params['RUN_DUR']
1415 loop = int(main.params['loop'])
1416 sleep_t = int(main.params['sleep_t'])
1417 sleep_init = int(main.params['sleep_init'])
1418 switches_num = main.params['switches_num']
1419 port = main.params['port']
1420 main.case("Starting SB load on 7 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1421 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1422 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)
1423 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1424
1425 time.sleep(sleep_init)
1426
1427 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate2", 'w').close()
1428 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1429 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1430 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1431 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1432 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1433 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1434 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1435 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1436 #time.sleep(10)
1437 for i in range(int (loop)):
1438 j1 = main.ONOS2.get_json(url1)
1439 j2 = main.ONOS2.get_json(url2)
1440 j3 = main.ONOS2.get_json(url3)
1441 j4 = main.ONOS2.get_json(url4)
1442 j5 = main.ONOS2.get_json(url5)
1443 j6 = main.ONOS2.get_json(url6)
1444 j7 = main.ONOS2.get_json(url7)
1445 json_str = []
1446 json_str.append(0)
1447 json_str.append(j1)
1448 json_str.append(j2)
1449 json_str.append(j3)
1450 json_str.append(j4)
1451 json_str.append(j5)
1452 json_str.append(j6)
1453 json_str.append(j7)
1454 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] != "":
1455 # write_str = str(json_str["meters"][4]["meter"][2])
1456 #print str(json_str["meters"][4])
1457 #f.write(str(json_str["meters"][4]))
1458 #f.write('\n')
1459 #time.sleep(3)
1460 for j in range(1,8):
1461 f.write("ONOS" + str(j) + "\n")
1462 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1463 f.write('\t')
1464 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1465 f.write('\t')
1466 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1467 f.write('\t')
1468 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1469 f.write('\t')
1470 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1471 f.write('\n')
1472
1473 f.write('\n')
1474 f.write('\n')
1475
1476 f.write("--------------------------------------------------------------------------------- \n")
1477 time.sleep(sleep_t)
1478 f.close()
1479 time.sleep(180)
1480
1481 def CASE73(self,main):
1482
1483 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1484 ip1 = main.params['CTRL']['ip1']
1485 ip2 = main.params['CTRL']['ip2']
1486 ip3 = main.params['CTRL']['ip3']
1487 ip4 = main.params['CTRL']['ip4']
1488
1489 import time
1490 import json
santhoshfe88a202014-08-19 18:53:23 -07001491 int_num = main.params['int_num']
1492 addrate = main.params['addrate']
1493 NBdur = main.params['NBdur']
1494 NBsleep = int(main.params['NBsleep'])
1495 NBsleep_init = int(main.params['NBsleep_init'])
1496 NBloop = int(main.params['NBloop'])
santhoshbc421422014-08-17 09:48:49 -07001497
1498 main.Mininet4.handle.expect("\$")
1499 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1500 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1501 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1502 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1503 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1504 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001505 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1506 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1507 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.7:6633")
santhoshbc421422014-08-17 09:48:49 -07001508
1509 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1510 main.ONOS3.handle.expect("\$")
1511
santhoshfe88a202014-08-19 18:53:23 -07001512 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 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")
1513 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001514
1515
santhoshfe88a202014-08-19 18:53:23 -07001516 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001517 import json
1518
1519 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close()
1520 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1521 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1522 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1523 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1524 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1525 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1526 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1527 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a")
1528 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001529 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001530 j1 = main.ONOS2.get_json(url1)
1531 j2 = main.ONOS2.get_json(url2)
1532 j3 = main.ONOS2.get_json(url3)
1533 j4 = main.ONOS2.get_json(url4)
1534 j5 = main.ONOS2.get_json(url5)
1535 j6 = main.ONOS2.get_json(url6)
1536 j7 = main.ONOS2.get_json(url7)
1537 json_str = []
1538 json_str.append(0)
1539 json_str.append(j1)
1540 json_str.append(j2)
1541 json_str.append(j3)
1542 json_str.append(j4)
1543 json_str.append(j5)
1544 json_str.append(j6)
1545 json_str.append(j7)
1546 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] != "":
1547 for j in range(1,8):
1548 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1549 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1550 f.write('\t')
1551 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1552 f.write('\t')
1553 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1554 f.write('\t')
1555 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1556 f.write('\t')
1557 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1558 f.write('\n')
1559
1560 f.write('\n')
1561
1562 f.write("--------------------------------------------------------------------------------- \n")
1563
1564 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1565 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1566 f.write('\t')
1567 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1568 f.write('\t')
1569 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1570 f.write('\t')
1571 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1572 f.write('\t')
1573 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1574 f.write('\n')
1575 f.write('\n')
1576 f.write('\n')
1577
1578 f.write("--------------------------------------------------------------------------------- \n")
1579 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001580 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001581 f.close()
1582
1583
1584 main.ONOS3.handle.expect("\$", timeout=900)
1585
1586 def CASE8(self,main):
1587 import time
1588 main.case("Scaling ONOS down to 6 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001589 main.ONOS7.handle.sendline("./onos.sh core stop")
1590 time.sleep(8)
1591 pdata = main.ONOS7.isup()
1592 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
1593 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001594 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1595 for i in range(3):
1596 if data == main.FALSE:
1597 #main.log.report("Something is funny... restarting ONOS")
1598 #main.ONOS1.stop()
1599 time.sleep(3)
1600 #main.ONOS1.start()
1601 #time.sleep(5)
1602 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1603 else:
1604 break
1605 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1606
1607 def CASE9(self,main):
1608
1609 main.case("Scaling ONOS down to 5 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001610 main.ONOS6.handle.sendline("./onos.sh core stop")
1611 time.sleep(8)
1612 pdata = main.ONOS6.isup() and main.ONOS7.isup()
1613 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001614 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1615 for i in range(3):
1616 if data == main.FALSE:
1617 #main.log.report("Something is funny... restarting ONOS")
1618 #main.ONOS1.stop()
1619 time.sleep(3)
1620 #main.ONOS1.start()
1621 #time.sleep(5)
1622 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1623 else:
1624 break
1625 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1626
1627 def CASE10(self,main):
1628
1629 main.case("Scaling ONOS down to 4 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001630
1631 main.ONOS5.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001632 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001633 pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1634 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001635 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1636 for i in range(3):
1637 if data == main.FALSE:
1638 #main.log.report("Something is funny... restarting ONOS")
1639 #main.ONOS1.stop()
1640 time.sleep(3)
1641 #main.ONOS1.start()
1642 #time.sleep(5)
1643 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1644 else:
1645 break
1646 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1647
1648 def CASE11(self,main):
1649
1650 main.case("Scaling ONOS down to 3 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001651 main.ONOS4.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001652 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001653 pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1654 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001655 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1656 for i in range(3):
1657 if data == main.FALSE:
1658 #main.log.report("Something is funny... restarting ONOS")
1659 #main.ONOS1.stop()
1660 time.sleep(3)
1661 #main.ONOS1.start()
1662 #time.sleep(5)
1663 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1664 else:
1665 break
1666 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
1667
1668 def CASE100(self,main):
1669 import os
1670 import time
1671 global timestr
1672 timestr = time.strftime("%Y%m%d-%H%M%S")
1673 main.case("Scale-up tests complete...now making final changes")
1674 main.log.info("moving logs....")
1675 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001676 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001677 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001678 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
1679 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001680 time.sleep(2)
1681 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
santhoshfe88a202014-08-19 18:53:23 -07001682 time.sleep(180)
1683
santhoshbc421422014-08-17 09:48:49 -07001684 def CASE101(self,main):
1685
1686 import os
1687 import time
1688 main.case("Scale-down tests complete...now making final changes")
1689 global timestr
1690 main.case("Scale-down tests complete...now making final changes")
1691 main.log.info("moving logs....")
1692 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001693 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001694 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001695 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
1696 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001697 time.sleep(2)
1698 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
1699 time.sleep(2)
1700
santhoshfe88a202014-08-19 18:53:23 -07001701 def CASE103(self,main):
1702 import os
1703 import time
1704 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1705 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001706 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 -07001707
1708 def CASE104(self,main):
1709 import os
1710 import time
1711 main.case("Posting the results to http://10.128.5.54/scale.html ....")
1712 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001713 os.system(db_script + " -n='100SwitchScaleDown" + "' -rate3='" + str(tpavg7n) + "' -rate4='" + str(tpavg6n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg4n) + "' -rate7='" + str(tpavg3n) + "' -table='onos_scale'")
santhoshfe88a202014-08-19 18:53:23 -07001714
1715
1716
santhosh91195f12014-08-07 13:53:50 -07001717