blob: ba21e6180fad020aa3bc5ee7937c1e858826821f [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")
santhosh11cbaed2014-08-26 15:17:36 -070016 main.log.report("Starting 3-node ONOS cluster.")
santhosh91195f12014-08-07 13:53:50 -070017 main.step("Stop ONOS")
18 import time
santhoshbc421422014-08-17 09:48:49 -070019 main.log.info("Stopping all ONOS nodes...")
santhosh91195f12014-08-07 13:53:50 -070020 main.ONOS1.stop_all()
21 main.ONOS2.stop_all()
22 main.ONOS3.stop_all()
23# main.print_hello_world()
24 main.ONOS4.stop_all()
santhoshbc421422014-08-17 09:48:49 -070025 main.ONOS5.stop_all()
26 main.ONOS6.stop_all()
27 main.ONOS7.stop_all()
28 #main.ONOS2.stop_rest()
santhoshf6863782014-08-11 15:28:24 -070029 time.sleep(5)
santhosh91195f12014-08-07 13:53:50 -070030 #main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
31 #main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
32 #main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
33 #main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties")
34 #main.step("Start tcpdump on mn")
35 #main.Mininet2.start_tcpdump(main.params['tcpdump']['filename'], intf = main.params['tcpdump']['intf'], port = main.params['tcpdump']['port'])
santhoshbc421422014-08-17 09:48:49 -070036 main.step("Starting 3 ONOS nodes...")
santhosh91195f12014-08-07 13:53:50 -070037 main.Zookeeper1.start()
38 main.Zookeeper2.start()
39 main.Zookeeper3.start()
40 main.Zookeeper4.start()
santhoshbc421422014-08-17 09:48:49 -070041 main.Zookeeper5.start()
42 main.Zookeeper6.start()
43 main.Zookeeper7.start()
44
santhosh91195f12014-08-07 13:53:50 -070045 time.sleep(5)
46
santhoshfe0c27d2014-08-29 11:18:25 -070047 """
santhosh91195f12014-08-07 13:53:50 -070048 main.RamCloud1.del_db()
49 main.RamCloud2.del_db()
50 main.RamCloud3.del_db()
santhoshbc421422014-08-17 09:48:49 -070051 # main.RamCloud4.del_db()
santhosh91195f12014-08-07 13:53:50 -070052
53 time.sleep(5)
54 #main.log.report("Pulling latest code from github to all nodes")
55
santhoshfe0c27d2014-08-29 11:18:25 -070056
santhosh91195f12014-08-07 13:53:50 -070057 for i in range(2):
58 uptodate = main.ONOS1.git_pull()
59 main.ONOS2.git_pull()
60 main.ONOS3.git_pull()
61 # main.ONOS4.git_pull()
62 ver1 = main.ONOS1.get_version()
63 ver2 = main.ONOS3.get_version()
64 if ver1==ver2:
65 break
66 elif i==1:
67 main.ONOS2.git_pull("ONOS1 master")
68 main.ONOS3.git_pull("ONOS1 master")
69 # main.ONOS4.git_pull("ONOS1 master")
70 if uptodate==0:
71 # if 1:
72 main.ONOS1.git_compile()
73 main.ONOS2.git_compile()
74 main.ONOS3.git_compile()
75 # main.ONOS4.git_compile()
76 main.ONOS1.print_version()
77 # main.RamCloud1.git_pull()
78 # main.RamCloud2.git_pull()
79 # main.RamCloud3.git_pull()
80 # main.RamCloud4.git_pull()
81 # main.ONOS1.get_version()
82 # main.ONOS2.get_version()
83 # main.ONOS3.get_version()
84 # main.ONOS4.get_version()
85 # main.ONOS1.start_all()
86 # main.ONOS2.start_all()
87 # main.ONOS3.start_all()
88 # main.ONOS4.start_all()
89
santhoshfe0c27d2014-08-29 11:18:25 -070090
santhosh91195f12014-08-07 13:53:50 -070091 main.RamCloud1.start_coor()
92 main.RamCloud1.start_serv()
93 main.RamCloud2.start_serv()
94 main.RamCloud3.start_serv()
santhoshbc421422014-08-17 09:48:49 -070095 time.sleep(5)
santhosh91195f12014-08-07 13:53:50 -070096 main.ONOS1.start()
97 main.ONOS2.start()
98 main.ONOS3.start()
99 #main.ONOS4.start()
santhoshbc421422014-08-17 09:48:49 -0700100 time.sleep(5)
santhoshfe0c27d2014-08-29 11:18:25 -0700101 """
102 main.ONOS1.handle.sendline("./onos.sh core start")
103 main.ONOS2.handle.sendline("./onos.sh core start")
104 main.ONOS3.handle.sendline("./onos.sh core start")
santhosh91195f12014-08-07 13:53:50 -0700105
106 main.ONOS1.start_rest()
107 main.ONOS2.start_rest()
108 main.ONOS3.start_rest()
109 test= main.ONOS2.rest_status()
110 if test == main.FALSE:
111 main.ONOS1.start_rest()
112 main.ONOS1.get_version()
santhoshc5877502014-09-08 12:07:23 -0700113 main.log.report("Startup check Zookeeper, and ONOS connections")
santhosh91195f12014-08-07 13:53:50 -0700114 main.step("Testing startup Zookeeper")
115 data = main.Zookeeper1.isup() and main.Zookeeper2.isup() and main.Zookeeper3.isup()
116 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...")
santhoshfe0c27d2014-08-29 11:18:25 -0700117 """
santhosh91195f12014-08-07 13:53:50 -0700118 main.step("Testing startup RamCloud")
119 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
120 if data == main.FALSE:
121 main.RamCloud1.stop_coor()
122 main.RamCloud1.stop_serv()
123 main.RamCloud2.stop_serv()
124 main.RamCloud3.stop_serv()
125 # main.RamCloud4.stop_serv()
126
127 time.sleep(5)
128 main.RamCloud1.start_coor()
129 main.RamCloud1.start_serv()
130 main.RamCloud2.start_serv()
131 main.RamCloud3.start_serv()
132 # main.RamCloud4.start_serv()
133 time.sleep(5)
134 data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv()
135
136
137
138 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...")
santhoshfe0c27d2014-08-29 11:18:25 -0700139 """
santhosh91195f12014-08-07 13:53:50 -0700140 main.step("Testing startup ONOS")
141 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
142 for i in range(3):
143 if data == main.FALSE:
144 #main.log.report("Something is funny... restarting ONOS")
145 #main.ONOS1.stop()
146 time.sleep(3)
147 #main.ONOS1.start()
148 #time.sleep(5)
149 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup()
150 else:
151 break
152 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...")
153 time.sleep(10)
154
155
santhoshbc421422014-08-17 09:48:49 -0700156 def CASE31(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700157 main.log.report("SB Throughput test: loading ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -0700158 main.case("Staring SB load with 3 ONOS nodes")
santhosh91195f12014-08-07 13:53:50 -0700159 ip1 = main.params['CTRL']['ip1']
160 ip2 = main.params['CTRL']['ip2']
161 ip3 = main.params['CTRL']['ip3']
162 rate1 = main.params['RATE1']
163 run_dur = main.params['RUN_DUR']
164 loop = int( main.params['loop'])
165 port = main.params['port']
166 switches_num = main.params['switches_num']
167 print loop
santhoshbc421422014-08-17 09:48:49 -0700168 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700169 sleep_t =int( main.params['sleep_t'])
170 main.case("Starting SB load on 3 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700171 main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur)
172 main.log.info("Adding switches and ports.....")
173 main.Mininet2.handle.expect("Starting SB load....", timeout=400)
174 main.log.info("Starting SB load....")
santhosh91195f12014-08-07 13:53:50 -0700175 import time
176 import json
santhoshfe88a202014-08-19 18:53:23 -0700177 import math
santhoshbc421422014-08-17 09:48:49 -0700178 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700179 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700180 url1 = main.params['url1']
181 url2 = main.params['url2']
182 url3 = main.params['url3']
santhosh91195f12014-08-07 13:53:50 -0700183 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", "a")
184 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700185 tpval = 0.0
186 global tpavg3n
187 tpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700188 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700189 j1 = main.ONOS2.get_json(url1)
190 j2 = main.ONOS2.get_json(url2)
191 j3 = main.ONOS2.get_json(url3)
192 json_str = []
193 json_str.append(0)
194 json_str.append(j1)
195 json_str.append(j2)
196 json_str.append(j3)
santhoshfe88a202014-08-19 18:53:23 -0700197 #float jval = 0
santhoshbc421422014-08-17 09:48:49 -0700198 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
santhosh91195f12014-08-07 13:53:50 -0700199 # write_str = str(json_str["meters"][4]["meter"][2])
200 #print str(json_str["meters"][4])
201 #f.write(str(json_str["meters"][4]))
202 #f.write('\n')
203 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700204 for j in range(1,4):
205 f.write("ONOS" + str(j) + "\n")
206 f.write(str(json_str[j]["meters"][4]['meter']['count']))
207 f.write('\t')
208 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
209 f.write('\t')
210 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
211 f.write('\t')
212 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
213 f.write('\t')
214 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
215 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700216 if j == 3:
217 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
218 #print tpval
219 #print ("\n")
220
santhoshbc421422014-08-17 09:48:49 -0700221
santhosh91195f12014-08-07 13:53:50 -0700222 f.write('\n')
223 f.write('\n')
224
225 f.write("--------------------------------------------------------------------------------- \n")
226 time.sleep(sleep_t)
227 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700228 # print tpval
229 print("\n")
230 tpavg3n = round(tpval)/loop
231 print tpavg3n
santhosh5d159cc2014-08-25 14:24:53 -0700232 main.log.report("Topology Event Throughput for 3-node ONOS cluster = " +str(tpavg3n) + " Events/sec")
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
santhoshbc421422014-08-17 09:48:49 -0700236 def CASE33(self,main):
santhosh91195f12014-08-07 13:53:50 -0700237
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 import json
santhoshfe0c27d2014-08-29 11:18:25 -0700243 int_num = int(main.params['int_num'])
santhoshfe88a202014-08-19 18:53:23 -0700244 addrate = main.params['addrate']
245 NBdur = main.params['NBdur']
246 NBsleep = int(main.params['NBsleep'])
247 NBsleep_init = int(main.params['NBsleep_init'])
248 NBloop = int(main.params['NBloop'])
santhoshfe0c27d2014-08-29 11:18:25 -0700249 int_r = 3 * int_num
250 main.log.report("Starting NB Throughput test: loading 3-node ONOS cluster with " + str(int_num) + " Intents/s on each node" )
santhosh91195f12014-08-07 13:53:50 -0700251 main.Mininet4.handle.expect("\$")
santhoshc5877502014-09-08 12:07:23 -0700252 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633")
253 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip1 + ":6633")
254 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip2 + ":6633")
255 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip2 + ":6633")
256 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip3 + ":6633")
257 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip3 + ":6633")
258 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip3 + ":6633")
santhoshd3957122014-08-21 19:33:58 -0700259
santhosh91195f12014-08-07 13:53:50 -0700260 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
261 main.ONOS3.handle.expect("\$")
262
santhoshc5877502014-09-08 12:07:23 -0700263 main.ONOS3.handle.sendline("./loadgen_NB.py -n 3 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshbc421422014-08-17 09:48:49 -0700264 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshfe88a202014-08-19 18:53:23 -0700265 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700266 import json
santhosh518cc672014-08-20 16:32:26 -0700267 nbtpval = 0.0
268 global nbtpavg3n
269 nbtpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700270
271 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700272 url1 = main.params['url1']
273 url2 = main.params['url2']
274 url3 = main.params['url3']
santhosh91195f12014-08-07 13:53:50 -0700275 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
santhoshfe88a202014-08-19 18:53:23 -0700276 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700277 j1 = main.ONOS1.get_json(url1)
278 j2 = main.ONOS1.get_json(url2)
279 j3 = main.ONOS1.get_json(url3)
280 json_str = []
281 json_str.append(0)
282 json_str.append(j1)
283 json_str.append(j2)
284 json_str.append(j3)
285 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
286 for j in range(1,4):
287 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
288 f.write(str(json_str[j]["meters"][0]['meter']['count']))
289 f.write('\t')
290 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
291 f.write('\t')
292 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
293 f.write('\t')
294 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
295 f.write('\t')
296 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
297 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700298
santhoshbc421422014-08-17 09:48:49 -0700299 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700300
santhoshbc421422014-08-17 09:48:49 -0700301 f.write("--------------------------------------------------------------------------------- \n")
302
303 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
304 f.write(str(json_str[j]["meters"][1]['meter']['count']))
305 f.write('\t')
306 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
307 f.write('\t')
308 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
309 f.write('\t')
310 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
311 f.write('\t')
312 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
313 f.write('\n')
314 f.write('\n')
315 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700316 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700317
318 f.write("--------------------------------------------------------------------------------- \n")
319 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700320 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700321 f.close()
santhosh518cc672014-08-20 16:32:26 -0700322 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700323 nbtpavg3n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -0700324 print nbtpavg3n
santhosh91195f12014-08-07 13:53:50 -0700325
santhoshbc421422014-08-17 09:48:49 -0700326 main.ONOS3.handle.expect("\$", timeout=900)
santhosh11cbaed2014-08-26 15:17:36 -0700327 #time.sleep(180)
328 main.log.report("Intent Throughput for 3-node ONOS cluster = " + str(nbtpavg3n) + " Intents/sec")
santhoshbc421422014-08-17 09:48:49 -0700329
330 def CASE4(self,main):
santhosh91195f12014-08-07 13:53:50 -0700331
santhosh11cbaed2014-08-26 15:17:36 -0700332 main.log.report("Scale-up ONOS to 4-nodes ")
santhosh91195f12014-08-07 13:53:50 -0700333 main.case("Starting ONOS scale-up to 4 nodes ")
334 import time
335 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700336 main.ONOS5.handle.sendline("./onos.sh core stop")
337 main.ONOS6.handle.sendline("./onos.sh core stop")
338 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700339
340
341 main.Zookeeper4.start()
santhoshf6863782014-08-11 15:28:24 -0700342 time.sleep(5)
santhoshfe0c27d2014-08-29 11:18:25 -0700343 """
santhoshf6863782014-08-11 15:28:24 -0700344 main.RamCloud4.del_db()
345 time.sleep(3)
346 main.RamCloud4.start_serv()
347 time.sleep(3)
santhoshfe0c27d2014-08-29 11:18:25 -0700348 """
santhosh91195f12014-08-07 13:53:50 -0700349 main.ONOS4.start()
350 main.ONOS4.start_rest()
351 time.sleep(5)
352 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
353 for i in range(3):
354 if data == main.FALSE:
santhosh91195f12014-08-07 13:53:50 -0700355 time.sleep(3)
santhosh91195f12014-08-07 13:53:50 -0700356 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
357 else:
358 break
santhosh5d159cc2014-08-25 14:24:53 -0700359 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 4-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700360
361 time.sleep(10)
362
363 def CASE5(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700364 main.log.report("Scale-up ONOS to 5-nodes")
santhoshbc421422014-08-17 09:48:49 -0700365 main.case("Starting ONOS scale-up/down to 5 nodes ")
366 import time
santhosh483a4162014-08-20 22:40:51 -0700367 main.ONOS6.handle.sendline("./onos.sh core stop")
368 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700369
370 main.Zookeeper5.start()
371 time.sleep(5)
santhoshfe0c27d2014-08-29 11:18:25 -0700372 """
santhoshbc421422014-08-17 09:48:49 -0700373 main.RamCloud5.del_db()
374 time.sleep(3)
375 main.RamCloud5.start_serv()
376 time.sleep(3)
santhoshfe0c27d2014-08-29 11:18:25 -0700377 """
santhoshbc421422014-08-17 09:48:49 -0700378 main.ONOS5.start()
379 main.ONOS5.start_rest()
380 time.sleep(5)
381 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
382 for i in range(3):
383 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -0700384 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700385 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
386 else:
387 break
santhosh5d159cc2014-08-25 14:24:53 -0700388 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 5-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhosh91195f12014-08-07 13:53:50 -0700389 time.sleep(10)
390
391 def CASE6(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700392 main.log.report("Scale-up ONOS to 6-nodes")
santhoshbc421422014-08-17 09:48:49 -0700393 main.case("Starting ONOS scale-up/down to 6 nodes ")
394 import time
santhosh483a4162014-08-20 22:40:51 -0700395 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700396
397 main.Zookeeper6.start()
398 time.sleep(5)
santhoshfe0c27d2014-08-29 11:18:25 -0700399 """
santhoshbc421422014-08-17 09:48:49 -0700400 main.RamCloud6.del_db()
401 time.sleep(3)
402 main.RamCloud6.start_serv()
403 time.sleep(3)
santhoshfe0c27d2014-08-29 11:18:25 -0700404 """
santhoshbc421422014-08-17 09:48:49 -0700405 main.ONOS6.start()
406 main.ONOS6.start_rest()
407 time.sleep(5)
408 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
409 for i in range(3):
410 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -0700411 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700412 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
413 else:
414 break
santhosh5d159cc2014-08-25 14:24:53 -0700415 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 6-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700416 time.sleep(10)
417
418 def CASE7(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700419 main.log.report("Scale-up ONOS to 7-nodes")
santhoshbc421422014-08-17 09:48:49 -0700420 main.case("Starting ONOS scale-up/down to 7 nodes ")
421 import time
santhoshbc421422014-08-17 09:48:49 -0700422
423 main.Zookeeper7.start()
424 time.sleep(5)
santhoshfe0c27d2014-08-29 11:18:25 -0700425 """
santhoshbc421422014-08-17 09:48:49 -0700426 main.RamCloud7.del_db()
427 time.sleep(3)
428 main.RamCloud7.start_serv()
429 time.sleep(3)
santhoshfe0c27d2014-08-29 11:18:25 -0700430 """
santhoshbc421422014-08-17 09:48:49 -0700431 main.ONOS7.start()
432 main.ONOS7.start_rest()
433 time.sleep(5)
434 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()
435 for i in range(3):
436 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -0700437 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700438 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()
439 else:
440 break
santhosh5d159cc2014-08-25 14:24:53 -0700441 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 7-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -0700442 time.sleep(10)
443
444
445
446 def CASE41(self,main):
447 main.case("Starting SB test for 4 nodes")
santhosh11cbaed2014-08-26 15:17:36 -0700448 main.log.report("SB Throughput test: loading 4-node ONOS cluster with 740 Topo Events/s")
santhosh91195f12014-08-07 13:53:50 -0700449 ip1 = main.params['CTRL']['ip1']
450 ip2 = main.params['CTRL']['ip2']
451 ip3 = main.params['CTRL']['ip3']
452 ip4 = main.params['CTRL']['ip4']
453 rate1 = main.params['RATE1']
454 run_dur = main.params['RUN_DUR']
455 loop = int( main.params['loop'])
456 switches_num = main.params['switches_num']
457 port = main.params['port']
458 print loop
santhoshbc421422014-08-17 09:48:49 -0700459 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700460 sleep_t =int( main.params['sleep_t'])
461 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700462 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)
463 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700464 import time
465 import json
santhoshfe88a202014-08-19 18:53:23 -0700466 import math
santhoshbc421422014-08-17 09:48:49 -0700467 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700468 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700469 url1 = main.params['url1']
470 url2 = main.params['url2']
471 url3 = main.params['url3']
472 url4 = main.params['url4']
santhoshfe88a202014-08-19 18:53:23 -0700473 tpval = 0.0
474 global tpavg4n
475 tpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700476
477 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
santhosh91195f12014-08-07 13:53:50 -0700478 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700479 j1 = main.ONOS2.get_json(url1)
480 j2 = main.ONOS2.get_json(url2)
481 j3 = main.ONOS2.get_json(url3)
482 j4 = main.ONOS2.get_json(url4)
483 json_str = []
484 json_str.append(0)
485 json_str.append(j1)
486 json_str.append(j2)
487 json_str.append(j3)
488 json_str.append(j4)
489 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
santhoshbc421422014-08-17 09:48:49 -0700490 for j in range(1,5):
491 f.write("ONOS" + str(j) + "\n")
492 f.write(str(json_str[j]["meters"][4]['meter']['count']))
493 f.write('\t')
494 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
495 f.write('\t')
496 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
497 f.write('\t')
498 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
499 f.write('\t')
500 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
501 f.write('\n')
santhoshc5877502014-09-08 12:07:23 -0700502 if j == 4:
santhoshfe88a202014-08-19 18:53:23 -0700503 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700504
santhosh91195f12014-08-07 13:53:50 -0700505 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700506 f.write('\n')
507
santhoshbc421422014-08-17 09:48:49 -0700508 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700509 time.sleep(sleep_t)
510 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700511 print("\n")
512 tpavg4n = round(tpval)/loop
513 print tpavg4n
santhosh5d159cc2014-08-25 14:24:53 -0700514 main.log.report("Topology Event Throughput for 4-node ONOS cluster = " + str(tpavg4n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700515
santhosh91195f12014-08-07 13:53:50 -0700516 time.sleep(5)
517 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700518 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700519
520
santhoshbc421422014-08-17 09:48:49 -0700521 def CASE43(self,main):
santhosh91195f12014-08-07 13:53:50 -0700522
523 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
524 ip1 = main.params['CTRL']['ip1']
525 ip2 = main.params['CTRL']['ip2']
526 ip3 = main.params['CTRL']['ip3']
527 ip4 = main.params['CTRL']['ip4']
528
529 import time
530 import json
santhoshfe0c27d2014-08-29 11:18:25 -0700531 int_num = int(main.params['int_num'])
santhoshfe88a202014-08-19 18:53:23 -0700532 addrate = main.params['addrate']
533 NBdur = main.params['NBdur']
534 NBsleep = int(main.params['NBsleep'])
535 NBsleep_init = int(main.params['NBsleep_init'])
536 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700537 nbtpval = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700538 main.log.report("Starting NB Throughput test: loading 4-node ONOS cluster with " +str(int_num) + " Intents/s on each node" )
santhosh518cc672014-08-20 16:32:26 -0700539 global nbtpavg4n
540 nbtpavg4n = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700541 int_r = 4 * int_num
santhosh91195f12014-08-07 13:53:50 -0700542 main.Mininet4.handle.expect("\$")
santhoshc5877502014-09-08 12:07:23 -0700543 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633")
544 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633")
545 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633")
546 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633")
547 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip1 + ":6633")
548 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip2 + ":6633")
549 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip4 + ":6633")
santhoshd3957122014-08-21 19:33:58 -0700550
santhosh91195f12014-08-07 13:53:50 -0700551 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
552 main.ONOS3.handle.expect("\$")
553
santhoshc5877502014-09-08 12:07:23 -0700554 main.ONOS3.handle.sendline("./loadgen_NB.py -n 4 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700555 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700556
557
santhoshfe88a202014-08-19 18:53:23 -0700558 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700559 import json
560
561 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700562 url1 = main.params['url1']
563 url2 = main.params['url2']
564 url3 = main.params['url3']
565 url4 = main.params['url4']
santhosh91195f12014-08-07 13:53:50 -0700566 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
santhoshfe88a202014-08-19 18:53:23 -0700567 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700568 j1 = main.ONOS2.get_json(url1)
569 j2 = main.ONOS2.get_json(url2)
570 j3 = main.ONOS2.get_json(url3)
571 j4 = main.ONOS2.get_json(url4)
572 json_str = []
573 json_str.append(0)
574 json_str.append(j1)
575 json_str.append(j2)
576 json_str.append(j3)
577 json_str.append(j4)
578 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
579 for j in range(1,5):
580 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
581 f.write(str(json_str[j]["meters"][0]['meter']['count']))
582 f.write('\t')
583 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
584 f.write('\t')
585 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
586 f.write('\t')
587 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
588 f.write('\t')
589 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
590 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700591
santhoshbc421422014-08-17 09:48:49 -0700592 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700593
santhoshbc421422014-08-17 09:48:49 -0700594 f.write("--------------------------------------------------------------------------------- \n")
595
596 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
597 f.write(str(json_str[j]["meters"][1]['meter']['count']))
598 f.write('\t')
599 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
600 f.write('\t')
601 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
602 f.write('\t')
603 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
604 f.write('\t')
605 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
606 f.write('\n')
607 f.write('\n')
608 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700609
610 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh91195f12014-08-07 13:53:50 -0700611
santhoshbc421422014-08-17 09:48:49 -0700612 f.write("--------------------------------------------------------------------------------- \n")
613 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700614 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700615 f.close()
santhosh518cc672014-08-20 16:32:26 -0700616 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700617 nbtpavg4n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -0700618 print nbtpavg4n
santhoshbc421422014-08-17 09:48:49 -0700619
santhosh91195f12014-08-07 13:53:50 -0700620
621 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -0700622 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -0700623 main.log.report("Intent Throughput for 4-node ONOS cluster = " + str(nbtpavg4n) + " Intents/sec")
santhoshbc421422014-08-17 09:48:49 -0700624
625 def CASE51(self,main):
626 main.case("Starting SB test for 5 nodes")
santhosh11cbaed2014-08-26 15:17:36 -0700627 main.log.report("SB Throughput test: loading 5-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -0700628 ip1 = main.params['CTRL']['ip1']
629 ip2 = main.params['CTRL']['ip2']
630 ip3 = main.params['CTRL']['ip3']
631 ip4 = main.params['CTRL']['ip4']
632 ip5 = main.params['CTRL']['ip5']
633 rate1 = main.params['RATE1']
634 run_dur = main.params['RUN_DUR']
635 loop = int( main.params['loop'])
636 switches_num = main.params['switches_num']
637 port = main.params['port']
638 print loop
639 sleep_init = int(main.params['sleep_init'])
640 sleep_t =int( main.params['sleep_t'])
641 main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshbc421422014-08-17 09:48:49 -0700642 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)
643 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
644 import time
645 import json
santhoshfe88a202014-08-19 18:53:23 -0700646 tpval = 0.0
647 global tpavg5n
648 tpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700649 time.sleep(sleep_init)
650
651 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700652 url1 = main.params['url1']
653 url2 = main.params['url2']
654 url3 = main.params['url3']
655 url4 = main.params['url4']
656 url5 = main.params['url5']
santhoshbc421422014-08-17 09:48:49 -0700657 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a")
santhoshbc421422014-08-17 09:48:49 -0700658 for i in range(int (loop)):
659 j1 = main.ONOS2.get_json(url1)
660 j2 = main.ONOS2.get_json(url2)
661 j3 = main.ONOS2.get_json(url3)
662 j4 = main.ONOS2.get_json(url4)
663 j5 = main.ONOS2.get_json(url5)
664 json_str = []
665 json_str.append(0)
666 json_str.append(j1)
667 json_str.append(j2)
668 json_str.append(j3)
669 json_str.append(j4)
670 json_str.append(j5)
671 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
santhoshbc421422014-08-17 09:48:49 -0700672 for j in range(1,6):
673 f.write("ONOS" + str(j) + "\n")
674 f.write(str(json_str[j]["meters"][4]['meter']['count']))
675 f.write('\t')
676 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
677 f.write('\t')
678 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
679 f.write('\t')
680 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
681 f.write('\t')
682 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
683 f.write('\n')
santhoshc5877502014-09-08 12:07:23 -0700684 if j == 4:
santhoshfe88a202014-08-19 18:53:23 -0700685 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700686
687 f.write('\n')
688 f.write('\n')
689
690 f.write("--------------------------------------------------------------------------------- \n")
691 time.sleep(sleep_t)
692 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700693 print("\n")
694 tpavg5n = round(tpval)/loop
695 print tpavg5n
santhoshbc421422014-08-17 09:48:49 -0700696
santhoshbc421422014-08-17 09:48:49 -0700697 time.sleep(5)
698 main.Mininet2.handle.expect("\$", timeout=900)
699 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -0700700 main.log.report("Topology Event Throughput for 5-node ONOS cluster = " + str(tpavg5n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700701
702
santhoshbc421422014-08-17 09:48:49 -0700703 def CASE53(self,main):
704
santhosh518cc672014-08-20 16:32:26 -0700705 main.case("Starting NB Throughput test after scaling up to 5 onos nodes")
santhoshbc421422014-08-17 09:48:49 -0700706 ip1 = main.params['CTRL']['ip1']
707 ip2 = main.params['CTRL']['ip2']
708 ip3 = main.params['CTRL']['ip3']
709 ip4 = main.params['CTRL']['ip4']
santhoshc5877502014-09-08 12:07:23 -0700710 ip5 = main.params['CTRL']['ip5']
santhoshbc421422014-08-17 09:48:49 -0700711
712 import time
713 import json
santhoshfe0c27d2014-08-29 11:18:25 -0700714 int_num = int(main.params['int_num'])
santhoshfe88a202014-08-19 18:53:23 -0700715 addrate = main.params['addrate']
716 NBdur = main.params['NBdur']
717 NBsleep = int(main.params['NBsleep'])
718 NBsleep_init = int(main.params['NBsleep_init'])
719 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700720 nbtpval = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700721 main.log.report("Starting NB Throughput test: loading 5-node ONOS cluster with " + str(int_num) + " Intents/s on each node" )
santhosh518cc672014-08-20 16:32:26 -0700722 global nbtpavg5n
723 nbtpavg5n = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700724 int_r = 5 * int_num
santhoshbc421422014-08-17 09:48:49 -0700725 main.Mininet4.handle.expect("\$")
santhoshc5877502014-09-08 12:07:23 -0700726 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633")
727 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633")
728 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633")
729 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633")
730 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633")
731 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip3 + ":6633")
732 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip5 + ":6633")
santhoshd3957122014-08-21 19:33:58 -0700733
santhoshbc421422014-08-17 09:48:49 -0700734 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
735 main.ONOS3.handle.expect("\$")
736
santhoshc5877502014-09-08 12:07:23 -0700737 main.ONOS3.handle.sendline("./loadgen_NB.py -n 5 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip5 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700738 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700739
740
santhoshfe88a202014-08-19 18:53:23 -0700741 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -0700742 import json
743
744 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700745 url1 = main.params['url1']
746 url2 = main.params['url2']
747 url3 = main.params['url3']
748 url4 = main.params['url4']
749 url5 = main.params['url5']
santhoshbc421422014-08-17 09:48:49 -0700750 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a")
santhoshfe88a202014-08-19 18:53:23 -0700751 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700752 j1 = main.ONOS2.get_json(url1)
753 j2 = main.ONOS2.get_json(url2)
754 j3 = main.ONOS2.get_json(url3)
755 j4 = main.ONOS2.get_json(url4)
756 j5 = main.ONOS2.get_json(url5)
757 json_str = []
758 json_str.append(0)
759 json_str.append(j1)
760 json_str.append(j2)
761 json_str.append(j3)
762 json_str.append(j4)
763 json_str.append(j5)
764 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
765 for j in range(1,6):
766 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
767 f.write(str(json_str[j]["meters"][0]['meter']['count']))
768 f.write('\t')
769 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
770 f.write('\t')
771 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
772 f.write('\t')
773 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
774 f.write('\t')
775 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
776 f.write('\n')
777
778 f.write('\n')
779
780 f.write("--------------------------------------------------------------------------------- \n")
781
782 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
783 f.write(str(json_str[j]["meters"][1]['meter']['count']))
784 f.write('\t')
785 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
786 f.write('\t')
787 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
788 f.write('\t')
789 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
790 f.write('\t')
791 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
792 f.write('\n')
793 f.write('\n')
794 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700795
796 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -0700797
santhoshbc421422014-08-17 09:48:49 -0700798
799 f.write("--------------------------------------------------------------------------------- \n")
800 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700801 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -0700802 f.close()
santhosh518cc672014-08-20 16:32:26 -0700803 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700804 nbtpavg5n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -0700805 print nbtpavg5n
santhoshbc421422014-08-17 09:48:49 -0700806
807
808 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -0700809 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -0700810 main.log.report("Intent Throughput for 5-node ONOS cluster = " + str(nbtpavg5n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -0700811
santhoshbc421422014-08-17 09:48:49 -0700812 def CASE61(self,main):
813 main.case("Starting SB test for 5 nodes")
814 ip1 = main.params['CTRL']['ip1']
santhosh11cbaed2014-08-26 15:17:36 -0700815 main.log.report("SB Throughput test: loading 6-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -0700816 ip2 = main.params['CTRL']['ip2']
817 ip3 = main.params['CTRL']['ip3']
818 ip4 = main.params['CTRL']['ip4']
819 ip5 = main.params['CTRL']['ip5']
820 ip6 = main.params['CTRL']['ip6']
821 rate1 = main.params['RATE1']
822 run_dur = main.params['RUN_DUR']
823 loop = int( main.params['loop'])
824 switches_num = main.params['switches_num']
825 port = main.params['port']
826 print loop
827 sleep_t =int( main.params['sleep_t'])
828 sleep_init = int(main.params['sleep_init'])
829 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshbc421422014-08-17 09:48:49 -0700830 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)
831 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
832
833 import time
834 import json
santhoshfe88a202014-08-19 18:53:23 -0700835 tpval = 0.0
836 global tpavg6n
837 tpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700838 time.sleep(sleep_init)
839 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700840 url1 = main.params['url1']
841 url2 = main.params['url2']
842 url3 = main.params['url3']
843 url4 = main.params['url4']
844 url5 = main.params['url5']
845 url6 = main.params['url6']
santhoshbc421422014-08-17 09:48:49 -0700846 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a")
santhoshbc421422014-08-17 09:48:49 -0700847 for i in range(int (loop)):
848 j1 = main.ONOS2.get_json(url1)
849 j2 = main.ONOS2.get_json(url2)
850 j3 = main.ONOS2.get_json(url3)
851 j4 = main.ONOS2.get_json(url4)
852 j5 = main.ONOS2.get_json(url5)
853 j6 = main.ONOS2.get_json(url6)
854 json_str = []
855 json_str.append(0)
856 json_str.append(j1)
857 json_str.append(j2)
858 json_str.append(j3)
859 json_str.append(j4)
860 json_str.append(j5)
861 json_str.append(j6)
862 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
santhoshbc421422014-08-17 09:48:49 -0700863 for j in range(1,7):
864 f.write("ONOS" + str(j) + "\n")
865 f.write(str(json_str[j]["meters"][4]['meter']['count']))
866 f.write('\t')
867 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
868 f.write('\t')
869 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
870 f.write('\t')
871 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
872 f.write('\t')
873 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
874 f.write('\n')
santhoshc5877502014-09-08 12:07:23 -0700875 if j == 4:
santhoshfe88a202014-08-19 18:53:23 -0700876 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700877
878 f.write('\n')
879 f.write('\n')
880
881 f.write("--------------------------------------------------------------------------------- \n")
882 time.sleep(sleep_t)
883 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700884 print("\n")
885 tpavg6n = round(tpval)/loop
886 print tpavg6n
santhoshbc421422014-08-17 09:48:49 -0700887
santhoshbc421422014-08-17 09:48:49 -0700888 time.sleep(5)
889 main.Mininet2.handle.expect("\$", timeout=900)
890 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -0700891 main.log.report("Topology Event Throughput for 6-node ONOS cluster = " + str(tpavg6n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700892
893
santhoshbc421422014-08-17 09:48:49 -0700894 def CASE63(self,main):
895
896 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
897 ip1 = main.params['CTRL']['ip1']
898 ip2 = main.params['CTRL']['ip2']
899 ip3 = main.params['CTRL']['ip3']
900 ip4 = main.params['CTRL']['ip4']
santhoshc5877502014-09-08 12:07:23 -0700901 ip5 = main.params['CTRL']['ip5']
902 ip6 = main.params['CTRL']['ip6']
santhoshbc421422014-08-17 09:48:49 -0700903
904 import time
905 import json
santhoshfe0c27d2014-08-29 11:18:25 -0700906 int_num = int(main.params['int_num'])
santhoshfe88a202014-08-19 18:53:23 -0700907 addrate = main.params['addrate']
908 NBdur = main.params['NBdur']
909 NBsleep = int(main.params['NBsleep'])
910 NBsleep_init = int(main.params['NBsleep_init'])
911 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700912 nbtpval = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700913 main.log.report("Starting NB Throughput test: loading 6-node ONOS cluster with " + str(int_num) + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -0700914 global nbtpavg6n
915 nbtpavg6n = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -0700916 int_r = 6 * int_num
santhoshbc421422014-08-17 09:48:49 -0700917 main.Mininet4.handle.expect("\$")
santhoshc5877502014-09-08 12:07:23 -0700918 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633")
919 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633")
920 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633")
921 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633")
922 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633")
923 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip6 + ":6633")
924 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip6 + ":6633")
santhoshd3957122014-08-21 19:33:58 -0700925
santhoshbc421422014-08-17 09:48:49 -0700926 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
927 main.ONOS3.handle.expect("\$")
928
santhoshc5877502014-09-08 12:07:23 -0700929 main.ONOS3.handle.sendline("./loadgen_NB.py -n 6 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip5 + ":8080 " + ip6 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700930 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700931
932
santhoshfe88a202014-08-19 18:53:23 -0700933 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -0700934 import json
935
936 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -0700937 url1 = main.params['url1']
938 url2 = main.params['url2']
939 url3 = main.params['url3']
940 url4 = main.params['url4']
941 url5 = main.params['url5']
942 url6 = main.params['url6']
santhoshbc421422014-08-17 09:48:49 -0700943 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a")
santhoshfe88a202014-08-19 18:53:23 -0700944 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700945 j1 = main.ONOS2.get_json(url1)
946 j2 = main.ONOS2.get_json(url2)
947 j3 = main.ONOS2.get_json(url3)
948 j4 = main.ONOS2.get_json(url4)
949 j5 = main.ONOS2.get_json(url5)
950 j6 = main.ONOS2.get_json(url6)
951 json_str = []
952 json_str.append(0)
953 json_str.append(j1)
954 json_str.append(j2)
955 json_str.append(j3)
956 json_str.append(j4)
957 json_str.append(j5)
958 json_str.append(j6)
959 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
960 for j in range(1,7):
961 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
962 f.write(str(json_str[j]["meters"][0]['meter']['count']))
963 f.write('\t')
964 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
965 f.write('\t')
966 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
967 f.write('\t')
968 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
969 f.write('\t')
970 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
971 f.write('\n')
972
973 f.write('\n')
974
975 f.write("--------------------------------------------------------------------------------- \n")
976
977 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
978 f.write(str(json_str[j]["meters"][1]['meter']['count']))
979 f.write('\t')
980 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
981 f.write('\t')
982 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
983 f.write('\t')
984 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
985 f.write('\t')
986 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
987 f.write('\n')
988 f.write('\n')
989 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700990
991 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -0700992
santhoshbc421422014-08-17 09:48:49 -0700993
994 f.write("--------------------------------------------------------------------------------- \n")
995 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700996 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -0700997 f.close()
santhosh518cc672014-08-20 16:32:26 -0700998 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700999 nbtpavg6n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -07001000 print nbtpavg6n
1001
santhoshbc421422014-08-17 09:48:49 -07001002
1003
1004 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001005 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001006 main.log.report("Intent Throughput for 6-node ONOS cluster = " + str(nbtpavg6n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -07001007
santhoshbc421422014-08-17 09:48:49 -07001008 def CASE71(self,main):
1009 main.case("Starting SB test for 7 nodes")
santhosh11cbaed2014-08-26 15:17:36 -07001010 main.log.report("SB Throughput test: loading 7-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -07001011 ip1 = main.params['CTRL']['ip1']
1012 ip2 = main.params['CTRL']['ip2']
1013 ip3 = main.params['CTRL']['ip3']
1014 ip4 = main.params['CTRL']['ip4']
1015 ip5 = main.params['CTRL']['ip5']
1016 ip6 = main.params['CTRL']['ip6']
1017 ip7 = main.params['CTRL']['ip7']
1018 rate1 = main.params['RATE1']
1019 run_dur = main.params['RUN_DUR']
1020 loop = int( main.params['loop'])
1021 switches_num = main.params['switches_num']
1022 port = main.params['port']
1023 print loop
1024 sleep_t =int( main.params['sleep_t'])
1025 sleep_init = int(main.params['sleep_init'])
1026 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshbc421422014-08-17 09:48:49 -07001027 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)
1028 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1029 import time
1030 import json
santhoshfe88a202014-08-19 18:53:23 -07001031 tpval = 0.0
1032 global tpavg7n
1033 tpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001034 time.sleep(sleep_init)
1035
1036 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -07001037 url1 = main.params['url1']
1038 url2 = main.params['url2']
1039 url3 = main.params['url3']
1040 url4 = main.params['url4']
1041 url5 = main.params['url5']
1042 url6 = main.params['url6']
1043 url7 = main.params['url7']
santhoshbc421422014-08-17 09:48:49 -07001044
1045 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a")
santhoshbc421422014-08-17 09:48:49 -07001046 for i in range(int (loop)):
1047 j1 = main.ONOS2.get_json(url1)
1048 j2 = main.ONOS2.get_json(url2)
1049 j3 = main.ONOS2.get_json(url3)
1050 j4 = main.ONOS2.get_json(url4)
1051 j5 = main.ONOS2.get_json(url5)
1052 j6 = main.ONOS2.get_json(url6)
1053 j7 = main.ONOS2.get_json(url7)
1054 json_str = []
1055 json_str.append(0)
1056 json_str.append(j1)
1057 json_str.append(j2)
1058 json_str.append(j3)
1059 json_str.append(j4)
1060 json_str.append(j5)
1061 json_str.append(j6)
1062 json_str.append(j7)
1063 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] != "":
santhoshbc421422014-08-17 09:48:49 -07001064 for j in range(1,8):
1065 f.write("ONOS" + str(j) + "\n")
1066 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1067 f.write('\t')
1068 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1069 f.write('\t')
1070 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1071 f.write('\t')
1072 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1073 f.write('\t')
1074 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1075 f.write('\n')
santhoshc5877502014-09-08 12:07:23 -07001076 if j == 4:
santhoshfe88a202014-08-19 18:53:23 -07001077 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -07001078
1079 f.write('\n')
1080 f.write('\n')
1081
1082 f.write("--------------------------------------------------------------------------------- \n")
1083 time.sleep(sleep_t)
1084 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001085 print("\n")
1086 tpavg7n = round(tpval)/loop
1087 print tpavg7n
santhoshbc421422014-08-17 09:48:49 -07001088
santhoshbc421422014-08-17 09:48:49 -07001089 time.sleep(5)
1090 main.Mininet2.handle.expect("\$", timeout=900)
1091 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001092 main.log.report("Topology Event Throughput for 7-node ONOS cluster = " + str(tpavg7n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -07001093
1094
santhoshbc421422014-08-17 09:48:49 -07001095 def CASE73(self,main):
1096
santhoshfe0c27d2014-08-29 11:18:25 -07001097 main.case("Starting NB Throughput test after scaling up to 7 onos nodes")
santhoshbc421422014-08-17 09:48:49 -07001098 ip1 = main.params['CTRL']['ip1']
1099 ip2 = main.params['CTRL']['ip2']
1100 ip3 = main.params['CTRL']['ip3']
1101 ip4 = main.params['CTRL']['ip4']
santhoshc5877502014-09-08 12:07:23 -07001102 ip5 = main.params['CTRL']['ip5']
1103 ip6 = main.params['CTRL']['ip6']
1104 ip7 = main.params['CTRL']['ip7']
santhoshbc421422014-08-17 09:48:49 -07001105
1106 import time
1107 import json
santhoshfe0c27d2014-08-29 11:18:25 -07001108 int_num = int(main.params['int_num'])
santhoshfe88a202014-08-19 18:53:23 -07001109 addrate = main.params['addrate']
1110 NBdur = main.params['NBdur']
1111 NBsleep = int(main.params['NBsleep'])
1112 NBsleep_init = int(main.params['NBsleep_init'])
1113 NBloop = int(main.params['NBloop'])
santhoshfe0c27d2014-08-29 11:18:25 -07001114 main.log.report("Starting NB Throughput test: loading 7-node ONOS cluster with " + str(int_num) + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -07001115 nbtpval = 0.0
1116 global nbtpavg7n
1117 nbtpavg7n = 0.0
santhoshfe0c27d2014-08-29 11:18:25 -07001118 int_r = 7 * int_num
santhoshbc421422014-08-17 09:48:49 -07001119 main.Mininet4.handle.expect("\$")
santhoshc5877502014-09-08 12:07:23 -07001120 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633")
1121 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633")
1122 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633")
1123 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633")
1124 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633")
1125 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip6 + ":6633")
1126 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip7 + ":6633")
santhoshd3957122014-08-21 19:33:58 -07001127
santhoshbc421422014-08-17 09:48:49 -07001128 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1129 main.ONOS3.handle.expect("\$")
1130
santhoshc5877502014-09-08 12:07:23 -07001131 main.ONOS3.handle.sendline("./loadgen_NB.py -n 7 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip6 + ":8080 " + ip5 + ":8080 " + ip7 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -07001132 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001133
1134
santhoshfe88a202014-08-19 18:53:23 -07001135 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001136 import json
1137
1138 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close()
santhoshc5877502014-09-08 12:07:23 -07001139 url1 = main.params['url1']
1140 url2 = main.params['url2']
1141 url3 = main.params['url3']
1142 url4 = main.params['url4']
1143 url5 = main.params['url5']
1144 url6 = main.params['url6']
1145 url7 = main.params['url7']
santhoshbc421422014-08-17 09:48:49 -07001146 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a")
santhoshfe88a202014-08-19 18:53:23 -07001147 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001148 j1 = main.ONOS2.get_json(url1)
1149 j2 = main.ONOS2.get_json(url2)
1150 j3 = main.ONOS2.get_json(url3)
1151 j4 = main.ONOS2.get_json(url4)
1152 j5 = main.ONOS2.get_json(url5)
1153 j6 = main.ONOS2.get_json(url6)
1154 j7 = main.ONOS2.get_json(url7)
1155 json_str = []
1156 json_str.append(0)
1157 json_str.append(j1)
1158 json_str.append(j2)
1159 json_str.append(j3)
1160 json_str.append(j4)
1161 json_str.append(j5)
1162 json_str.append(j6)
1163 json_str.append(j7)
1164 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] != "":
1165 for j in range(1,8):
1166 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1167 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1168 f.write('\t')
1169 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1170 f.write('\t')
1171 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1172 f.write('\t')
1173 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1174 f.write('\t')
1175 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1176 f.write('\n')
1177
1178 f.write('\n')
1179
1180 f.write("--------------------------------------------------------------------------------- \n")
1181
1182 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1183 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1184 f.write('\t')
1185 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1186 f.write('\t')
1187 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1188 f.write('\t')
1189 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1190 f.write('\t')
1191 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1192 f.write('\n')
1193 f.write('\n')
1194 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -07001195
1196 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -07001197
santhoshbc421422014-08-17 09:48:49 -07001198
1199 f.write("--------------------------------------------------------------------------------- \n")
1200 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001201 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001202 f.close()
santhosh518cc672014-08-20 16:32:26 -07001203 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -07001204 nbtpavg7n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -07001205 print nbtpavg7n
santhoshbc421422014-08-17 09:48:49 -07001206
1207
1208 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001209 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001210 main.log.report("Intent Throughput for 7-node ONOS cluster = " + str(nbtpavg7n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -07001211
santhoshbc421422014-08-17 09:48:49 -07001212 def CASE8(self,main):
1213 import time
santhosh11cbaed2014-08-26 15:17:36 -07001214 main.log.report("Scaling ONOS down to 6 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001215 main.ONOS7.handle.sendline("./onos.sh core stop")
1216 time.sleep(8)
1217 pdata = main.ONOS7.isup()
1218 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
1219 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001220 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1221 for i in range(3):
1222 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -07001223 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001224 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1225 else:
1226 break
santhosh5d159cc2014-08-25 14:24:53 -07001227 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull -6-node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001228
1229 def CASE9(self,main):
1230
santhosh11cbaed2014-08-26 15:17:36 -07001231 main.log.report("Scaling ONOS down to 5 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001232 main.ONOS6.handle.sendline("./onos.sh core stop")
1233 time.sleep(8)
1234 pdata = main.ONOS6.isup() and main.ONOS7.isup()
1235 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001236 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1237 for i in range(3):
1238 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -07001239 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001240 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1241 else:
1242 break
santhosh5d159cc2014-08-25 14:24:53 -07001243 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull - 5 node ONOS clsuter is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001244
1245 def CASE10(self,main):
1246
santhosh11cbaed2014-08-26 15:17:36 -07001247 main.log.report("Scaling ONOS down to 4 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001248
1249 main.ONOS5.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001250 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001251 pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1252 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001253 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1254 for i in range(3):
1255 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -07001256 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001257 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1258 else:
1259 break
santhosh5d159cc2014-08-25 14:24:53 -07001260 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 4 node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001261
1262 def CASE11(self,main):
1263
santhosh11cbaed2014-08-26 15:17:36 -07001264 main.log.report("Scaling ONOS down to 3 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001265 main.ONOS4.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001266 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001267 pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1268 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001269 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1270 for i in range(3):
1271 if data == main.FALSE:
santhoshbc421422014-08-17 09:48:49 -07001272 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001273 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1274 else:
1275 break
santhosh5d159cc2014-08-25 14:24:53 -07001276 utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 3 node ONOS cluster is up and running!",onfail="ONOS didn't start...")
santhoshbc421422014-08-17 09:48:49 -07001277
1278 def CASE100(self,main):
1279 import os
1280 import time
1281 global timestr
1282 timestr = time.strftime("%Y%m%d-%H%M%S")
1283 main.case("Scale-up tests complete...now making final changes")
1284 main.log.info("moving logs....")
1285 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001286 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001287 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001288 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
1289 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001290 time.sleep(2)
1291 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
santhoshfe88a202014-08-19 18:53:23 -07001292 time.sleep(180)
1293
santhoshbc421422014-08-17 09:48:49 -07001294 def CASE101(self,main):
1295
1296 import os
1297 import time
1298 main.case("Scale-down tests complete...now making final changes")
1299 global timestr
1300 main.case("Scale-down tests complete...now making final changes")
1301 main.log.info("moving logs....")
1302 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001303 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001304 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001305 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
1306 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001307 time.sleep(2)
1308 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
1309 time.sleep(2)
1310
santhoshfe88a202014-08-19 18:53:23 -07001311 def CASE103(self,main):
1312 import os
1313 import time
santhosh11cbaed2014-08-26 15:17:36 -07001314 main.log.report("Posting the results to http://10.128.5.54/scale.html")
santhoshfe88a202014-08-19 18:53:23 -07001315 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001316 os.system(db_script + " -n='100SwitchScaleUp" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'")
santhosh11cbaed2014-08-26 15:17:36 -07001317 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
1318
santhoshfe88a202014-08-19 18:53:23 -07001319 def CASE104(self,main):
1320 import os
1321 import time
santhosh11cbaed2014-08-26 15:17:36 -07001322 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhoshfe88a202014-08-19 18:53:23 -07001323 db_script = main.params['db_script']
santhosh483a4162014-08-20 22:40:51 -07001324 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 -07001325
santhosh11cbaed2014-08-26 15:17:36 -07001326 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
santhoshfe88a202014-08-19 18:53:23 -07001327
santhosh518cc672014-08-20 16:32:26 -07001328 def CASE105(self,main):
1329 import os
1330 import time
santhosh11cbaed2014-08-26 15:17:36 -07001331 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhosh518cc672014-08-20 16:32:26 -07001332 db_script = main.params['db_script']
1333 os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'")
1334
santhosh11cbaed2014-08-26 15:17:36 -07001335 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
1336
santhosh518cc672014-08-20 16:32:26 -07001337 def CASE106(self,main):
1338 import os
1339 import time
santhosh11cbaed2014-08-26 15:17:36 -07001340 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhosh518cc672014-08-20 16:32:26 -07001341 db_script = main.params['db_script']
santhoshd3957122014-08-21 19:33:58 -07001342 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 -07001343
santhosh11cbaed2014-08-26 15:17:36 -07001344 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
santhoshfe88a202014-08-19 18:53:23 -07001345
santhosh91195f12014-08-07 13:53:50 -07001346