blob: 57c0ada7f91983d4ddaf0d74c5c4fedd9a1507f4 [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
47
48 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
56 """
57 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
90 """
91 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)
101
102 #main.ONOS1.handle.sendline("./onos.sh core start")
103 #main.ONOS1.handle.sendline("./onos.sh core start")
104 #main.ONOS1.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()
113 main.log.report("Startup check Zookeeper1, RamCloud1, and ONOS1 connections")
114 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...")
117
118 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...")
139
140 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()
180 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
181 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
182 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
183 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)
234 # main.Mininet2.handle.sendline("sudo mn -c")
235 #main.Mininet2.handle.expect("\$")
santhosh91195f12014-08-07 13:53:50 -0700236 # main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700237 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700238
239
santhoshbc421422014-08-17 09:48:49 -0700240 def CASE32(self,main):
santhosh91195f12014-08-07 13:53:50 -0700241 ip1 = main.params['CTRL']['ip1']
242 ip2 = main.params['CTRL']['ip2']
243 ip3 = main.params['CTRL']['ip3']
244 import time
245 rate2 = main.params['RATE2']
246 run_dur = main.params['RUN_DUR']
247 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700248 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700249 sleep_t = int(main.params['sleep_t'])
250 port = main.params['port']
251 switches_num = main.params['switches_num']
252 main.case("Starting SB load on 3 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700253 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
254 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 -0700255 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"10.128.10.1\" 100 50 1200 \"11\"")
santhoshf6863782014-08-11 15:28:24 -0700256 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700257 time.sleep(sleep_init )
santhosh91195f12014-08-07 13:53:50 -0700258 import json
santhoshbc421422014-08-17 09:48:49 -0700259 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700260 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", 'w').close()
261 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
262 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
263 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
264 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", "a")
santhosh91195f12014-08-07 13:53:50 -0700265 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700266 j1 = main.ONOS1.get_json(url1)
267 j2 = main.ONOS1.get_json(url2)
268 j3 = main.ONOS1.get_json(url3)
269 json_str = []
270 json_str.append(0)
271 json_str.append(j1)
272 json_str.append(j2)
273 json_str.append(j3)
274 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
santhosh91195f12014-08-07 13:53:50 -0700275 # write_str = str(json_str["meters"][4]["meter"][2])
276 #print str(json_str["meters"][4])
277 #f.write(str(json_str["meters"][4]))
278 #f.write('\n')
279 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700280 for j in range(1,4):
281 f.write("ONOS" + str(j) + "\n")
282 f.write(str(json_str[j]["meters"][4]['meter']['count']))
283 f.write('\t')
284 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
285 f.write('\t')
286 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
287 f.write('\t')
288 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
289 f.write('\t')
290 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
291 f.write('\n')
292
santhosh91195f12014-08-07 13:53:50 -0700293 f.write('\n')
294 f.write('\n')
santhoshbc421422014-08-17 09:48:49 -0700295
santhosh91195f12014-08-07 13:53:50 -0700296 f.write("--------------------------------------------------------------------------------- \n")
297 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700298 f.close()
299 #time.sleep(10)
santhosh91195f12014-08-07 13:53:50 -0700300 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700301 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700302 # main.Mininet2.handle.sendline("sudo mn -c")
303 #time.sleep(5)
304 # main.Mininet2.handle.expect("\$", timeout=900)
305
306
santhoshbc421422014-08-17 09:48:49 -0700307 def CASE33(self,main):
santhosh91195f12014-08-07 13:53:50 -0700308
santhosh91195f12014-08-07 13:53:50 -0700309 ip1 = main.params['CTRL']['ip1']
310 ip2 = main.params['CTRL']['ip2']
311 ip3 = main.params['CTRL']['ip3']
312 import time
313 import json
santhoshfe88a202014-08-19 18:53:23 -0700314 int_num = main.params['int_num']
315 addrate = main.params['addrate']
316 NBdur = main.params['NBdur']
317 NBsleep = int(main.params['NBsleep'])
318 NBsleep_init = int(main.params['NBsleep_init'])
319 NBloop = int(main.params['NBloop'])
320
santhosh11cbaed2014-08-26 15:17:36 -0700321 main.log.report("Starting NB Throughput test: loading 3-node ONOS cluster with " + int_num + " Intents/s" )
santhosh91195f12014-08-07 13:53:50 -0700322 main.Mininet4.handle.expect("\$")
323 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
324 #main.Mininet2.handle.expect("mininet>" , timeout=400)
325 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
326 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.1:6633")
327 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.2:6633")
328 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.2:6633")
329 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.3:6633")
330 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
331 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.3:6633")
santhoshd3957122014-08-21 19:33:58 -0700332
santhosh91195f12014-08-07 13:53:50 -0700333 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
334 main.ONOS3.handle.expect("\$")
335
santhoshfe88a202014-08-19 18:53:23 -0700336 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 -0700337 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshfe88a202014-08-19 18:53:23 -0700338 time.sleep(NBsleep_init)
339 #time.sleep(60)
santhosh91195f12014-08-07 13:53:50 -0700340 import json
santhosh518cc672014-08-20 16:32:26 -0700341 nbtpval = 0.0
342 global nbtpavg3n
343 nbtpavg3n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700344
345 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close()
346 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
347 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
348 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
349 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a")
350 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700351 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700352 j1 = main.ONOS1.get_json(url1)
353 j2 = main.ONOS1.get_json(url2)
354 j3 = main.ONOS1.get_json(url3)
355 json_str = []
356 json_str.append(0)
357 json_str.append(j1)
358 json_str.append(j2)
359 json_str.append(j3)
360 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "":
361 for j in range(1,4):
362 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
363 f.write(str(json_str[j]["meters"][0]['meter']['count']))
364 f.write('\t')
365 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
366 f.write('\t')
367 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
368 f.write('\t')
369 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
370 f.write('\t')
371 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
372 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700373
santhoshbc421422014-08-17 09:48:49 -0700374 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700375
santhoshbc421422014-08-17 09:48:49 -0700376 f.write("--------------------------------------------------------------------------------- \n")
377
378 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
379 f.write(str(json_str[j]["meters"][1]['meter']['count']))
380 f.write('\t')
381 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
382 f.write('\t')
383 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
384 f.write('\t')
385 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
386 f.write('\t')
387 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
388 f.write('\n')
389 f.write('\n')
390 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700391 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhoshbc421422014-08-17 09:48:49 -0700392
393 f.write("--------------------------------------------------------------------------------- \n")
394 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700395 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700396 f.close()
santhosh518cc672014-08-20 16:32:26 -0700397 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700398 nbtpavg3n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -0700399 print nbtpavg3n
santhosh91195f12014-08-07 13:53:50 -0700400
santhoshbc421422014-08-17 09:48:49 -0700401 main.ONOS3.handle.expect("\$", timeout=900)
santhosh11cbaed2014-08-26 15:17:36 -0700402 #time.sleep(180)
403 main.log.report("Intent Throughput for 3-node ONOS cluster = " + str(nbtpavg3n) + " Intents/sec")
santhoshbc421422014-08-17 09:48:49 -0700404
405 def CASE4(self,main):
santhosh91195f12014-08-07 13:53:50 -0700406
santhosh11cbaed2014-08-26 15:17:36 -0700407 main.log.report("Scale-up ONOS to 4-nodes ")
santhosh91195f12014-08-07 13:53:50 -0700408 main.case("Starting ONOS scale-up to 4 nodes ")
409 import time
410 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700411 main.ONOS5.handle.sendline("./onos.sh core stop")
412 main.ONOS6.handle.sendline("./onos.sh core stop")
413 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700414
415
416 main.Zookeeper4.start()
santhoshf6863782014-08-11 15:28:24 -0700417 time.sleep(5)
418
419 main.RamCloud4.del_db()
420 time.sleep(3)
421 main.RamCloud4.start_serv()
422 time.sleep(3)
santhosh91195f12014-08-07 13:53:50 -0700423 main.ONOS4.start()
424 main.ONOS4.start_rest()
425 time.sleep(5)
426 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
427 for i in range(3):
428 if data == main.FALSE:
429 #main.log.report("Something is funny... restarting ONOS")
430 #main.ONOS1.stop()
431 time.sleep(3)
432 #main.ONOS1.start()
433 #time.sleep(5)
434 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
435 else:
436 break
santhosh5d159cc2014-08-25 14:24:53 -0700437 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 -0700438
439 time.sleep(10)
440
441 def CASE5(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700442 main.log.report("Scale-up ONOS to 5-nodes")
santhoshbc421422014-08-17 09:48:49 -0700443 main.case("Starting ONOS scale-up/down to 5 nodes ")
444 import time
445 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700446 main.ONOS6.handle.sendline("./onos.sh core stop")
447 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700448 #pdata = main.ONOS5.isup()
449
450 main.Zookeeper5.start()
451 time.sleep(5)
452
453 main.RamCloud5.del_db()
454 time.sleep(3)
455 main.RamCloud5.start_serv()
456 time.sleep(3)
457 main.ONOS5.start()
458 main.ONOS5.start_rest()
459 time.sleep(5)
460 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
461 for i in range(3):
462 if data == main.FALSE:
463 #main.log.report("Something is funny... restarting ONOS")
464 #main.ONOS1.stop()
465 time.sleep(3)
466 #main.ONOS1.start()
467 #time.sleep(5)
468 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
469 else:
470 break
santhosh5d159cc2014-08-25 14:24:53 -0700471 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 -0700472 time.sleep(10)
473
474 def CASE6(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700475 main.log.report("Scale-up ONOS to 6-nodes")
santhoshbc421422014-08-17 09:48:49 -0700476 main.case("Starting ONOS scale-up/down to 6 nodes ")
477 import time
478 # main.RamCloud4.start_serv()
santhosh483a4162014-08-20 22:40:51 -0700479 main.ONOS7.handle.sendline("./onos.sh core stop")
santhoshbc421422014-08-17 09:48:49 -0700480 #pdata = main.ONOS6.isup()
481
482 main.Zookeeper6.start()
483 time.sleep(5)
484
485 main.RamCloud6.del_db()
486 time.sleep(3)
487 main.RamCloud6.start_serv()
488 time.sleep(3)
489 main.ONOS6.start()
490 main.ONOS6.start_rest()
491 time.sleep(5)
492 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
493 for i in range(3):
494 if data == main.FALSE:
495 #main.log.report("Something is funny... restarting ONOS")
496 #main.ONOS1.stop()
497 time.sleep(3)
498 #main.ONOS1.start()
499 #time.sleep(5)
500 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
501 else:
502 break
santhosh5d159cc2014-08-25 14:24:53 -0700503 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 -0700504 time.sleep(10)
505
506 def CASE7(self,main):
santhosh11cbaed2014-08-26 15:17:36 -0700507 main.log.report("Scale-up ONOS to 7-nodes")
santhoshbc421422014-08-17 09:48:49 -0700508 main.case("Starting ONOS scale-up/down to 7 nodes ")
509 import time
510 # main.RamCloud4.start_serv()
511 #pdata = main.ONOS7.isup()
512
513 main.Zookeeper7.start()
514 time.sleep(5)
515
516 main.RamCloud7.del_db()
517 time.sleep(3)
518 main.RamCloud7.start_serv()
519 time.sleep(3)
520 main.ONOS7.start()
521 main.ONOS7.start_rest()
522 time.sleep(5)
523 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()
524 for i in range(3):
525 if data == main.FALSE:
526 #main.log.report("Something is funny... restarting ONOS")
527 #main.ONOS1.stop()
528 time.sleep(3)
529 #main.ONOS1.start()
530 #time.sleep(5)
531 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()
532 else:
533 break
santhosh5d159cc2014-08-25 14:24:53 -0700534 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 -0700535 time.sleep(10)
536
537
538
539 def CASE41(self,main):
540 main.case("Starting SB test for 4 nodes")
santhosh11cbaed2014-08-26 15:17:36 -0700541 main.log.report("SB Throughput test: loading 4-node ONOS cluster with 740 Topo Events/s")
santhosh91195f12014-08-07 13:53:50 -0700542 ip1 = main.params['CTRL']['ip1']
543 ip2 = main.params['CTRL']['ip2']
544 ip3 = main.params['CTRL']['ip3']
545 ip4 = main.params['CTRL']['ip4']
546 rate1 = main.params['RATE1']
547 run_dur = main.params['RUN_DUR']
548 loop = int( main.params['loop'])
549 switches_num = main.params['switches_num']
550 port = main.params['port']
551 print loop
santhoshbc421422014-08-17 09:48:49 -0700552 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700553 sleep_t =int( main.params['sleep_t'])
554 main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700555 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
556 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)
557 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700558 import time
559 import json
santhoshfe88a202014-08-19 18:53:23 -0700560 import math
santhoshbc421422014-08-17 09:48:49 -0700561 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700562 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close()
563 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
564 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
565 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
566 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
santhoshfe88a202014-08-19 18:53:23 -0700567 tpval = 0.0
568 global tpavg4n
569 tpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700570
571 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a")
572 #time.sleep(10)
573 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700574 j1 = main.ONOS2.get_json(url1)
575 j2 = main.ONOS2.get_json(url2)
576 j3 = main.ONOS2.get_json(url3)
577 j4 = main.ONOS2.get_json(url4)
578 json_str = []
579 json_str.append(0)
580 json_str.append(j1)
581 json_str.append(j2)
582 json_str.append(j3)
583 json_str.append(j4)
584 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
santhosh91195f12014-08-07 13:53:50 -0700585 # write_str = str(json_str["meters"][4]["meter"][2])
586 #print str(json_str["meters"][4])
587 #f.write(str(json_str["meters"][4]))
588 #f.write('\n')
589 #time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -0700590 for j in range(1,5):
591 f.write("ONOS" + str(j) + "\n")
592 f.write(str(json_str[j]["meters"][4]['meter']['count']))
593 f.write('\t')
594 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
595 f.write('\t')
596 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
597 f.write('\t')
598 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
599 f.write('\t')
600 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
601 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700602 if j == 3:
603 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
604 # print tpval
santhoshbc421422014-08-17 09:48:49 -0700605
santhosh91195f12014-08-07 13:53:50 -0700606 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700607 f.write('\n')
608
santhoshbc421422014-08-17 09:48:49 -0700609 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700610 time.sleep(sleep_t)
611 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700612 # print tpval
613 print("\n")
614 tpavg4n = round(tpval)/loop
615 print tpavg4n
santhosh5d159cc2014-08-25 14:24:53 -0700616 main.log.report("Topology Event Throughput for 4-node ONOS cluster = " + str(tpavg4n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700617
santhosh91195f12014-08-07 13:53:50 -0700618 #main.Mininet2.handle.expect("\$", timeout=900)
619 #main.Mininet2.handle.sendline("sudo mn -c")
620 #main.Mininet2.handle.expect("\$")
621 time.sleep(5)
622 main.Mininet2.handle.expect("\$", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700623 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700624
625
santhoshbc421422014-08-17 09:48:49 -0700626 def CASE42(self,main):
santhosh91195f12014-08-07 13:53:50 -0700627
628 ip1 = main.params['CTRL']['ip1']
629 ip2 = main.params['CTRL']['ip2']
630 ip3 = main.params['CTRL']['ip3']
631 ip4 = main.params['CTRL']['ip4']
632
633 import time
634 import json
635 rate2 = main.params['RATE2']
636 run_dur = main.params['RUN_DUR']
637 loop = int(main.params['loop'])
santhoshbc421422014-08-17 09:48:49 -0700638 sleep_init = int(main.params['sleep_init'])
santhosh91195f12014-08-07 13:53:50 -0700639 sleep_t = int(main.params['sleep_t'])
santhoshf6863782014-08-11 15:28:24 -0700640 switches_num = main.params['switches_num']
santhosh91195f12014-08-07 13:53:50 -0700641 port = main.params['port']
642 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
santhoshf6863782014-08-11 15:28:24 -0700643 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
644 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)
645 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
santhoshbc421422014-08-17 09:48:49 -0700646 time.sleep(sleep_init)
santhosh91195f12014-08-07 13:53:50 -0700647 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close()
648 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
649 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
650 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
651 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
652 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a")
653 #time.sleep(10)
654 for i in range(int (loop)):
santhoshbc421422014-08-17 09:48:49 -0700655 j1 = main.ONOS2.get_json(url1)
656 j2 = main.ONOS2.get_json(url2)
657 j3 = main.ONOS2.get_json(url3)
658 j4 = main.ONOS2.get_json(url4)
659 json_str = []
660 json_str.append(0)
661 json_str.append(j1)
662 json_str.append(j2)
663 json_str.append(j3)
664 json_str.append(j4)
665 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
666 # write_str = str(json_str["meters"][4]["meter"][2])
667 #print str(json_str["meters"][4])
668 #f.write(str(json_str["meters"][4]))
669 #f.write('\n')
670 #time.sleep(3)
671 for j in range(1,5):
672 f.write("ONOS" + str(j) + "\n")
673 f.write(str(json_str[j]["meters"][4]['meter']['count']))
674 f.write('\t')
675 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
676 f.write('\t')
677 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
678 f.write('\t')
679 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
680 f.write('\t')
681 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
682 f.write('\n')
683
684 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700685 f.write('\n')
686
santhoshbc421422014-08-17 09:48:49 -0700687 f.write("--------------------------------------------------------------------------------- \n")
santhosh91195f12014-08-07 13:53:50 -0700688 time.sleep(sleep_t)
santhoshbc421422014-08-17 09:48:49 -0700689 f.close()
690 time.sleep(180)
santhosh91195f12014-08-07 13:53:50 -0700691
santhoshbc421422014-08-17 09:48:49 -0700692 def CASE43(self,main):
santhosh91195f12014-08-07 13:53:50 -0700693
694 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
695 ip1 = main.params['CTRL']['ip1']
696 ip2 = main.params['CTRL']['ip2']
697 ip3 = main.params['CTRL']['ip3']
698 ip4 = main.params['CTRL']['ip4']
699
700 import time
701 import json
santhoshfe88a202014-08-19 18:53:23 -0700702 int_num = main.params['int_num']
703 addrate = main.params['addrate']
704 NBdur = main.params['NBdur']
705 NBsleep = int(main.params['NBsleep'])
706 NBsleep_init = int(main.params['NBsleep_init'])
707 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700708 nbtpval = 0.0
santhosh11cbaed2014-08-26 15:17:36 -0700709 main.log.report("Starting NB Throughput test: loading 4-node ONOS cluster with " + int_num + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -0700710 global nbtpavg4n
711 nbtpavg4n = 0.0
santhosh91195f12014-08-07 13:53:50 -0700712
713 main.Mininet4.handle.expect("\$")
714 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
715 #main.Mininet2.handle.expect("mininet>" , timeout=400)
716 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
717 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
718 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
719 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
720 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633")
721 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633")
722 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633")
santhoshd3957122014-08-21 19:33:58 -0700723
santhosh91195f12014-08-07 13:53:50 -0700724 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
725 main.ONOS3.handle.expect("\$")
726
santhosh518cc672014-08-20 16:32:26 -0700727 main.ONOS3.handle.sendline("./loadgen_NB.py -n 4 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700728 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhosh91195f12014-08-07 13:53:50 -0700729
730
santhoshfe88a202014-08-19 18:53:23 -0700731 time.sleep(NBsleep_init)
santhosh91195f12014-08-07 13:53:50 -0700732 import json
733
734 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close()
735 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
736 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
737 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
738 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
739 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a")
740 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -0700741 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -0700742 j1 = main.ONOS2.get_json(url1)
743 j2 = main.ONOS2.get_json(url2)
744 j3 = main.ONOS2.get_json(url3)
745 j4 = main.ONOS2.get_json(url4)
746 json_str = []
747 json_str.append(0)
748 json_str.append(j1)
749 json_str.append(j2)
750 json_str.append(j3)
751 json_str.append(j4)
752 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "":
753 for j in range(1,5):
754 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
755 f.write(str(json_str[j]["meters"][0]['meter']['count']))
756 f.write('\t')
757 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
758 f.write('\t')
759 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
760 f.write('\t')
761 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
762 f.write('\t')
763 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
764 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700765
santhoshbc421422014-08-17 09:48:49 -0700766 f.write('\n')
santhosh91195f12014-08-07 13:53:50 -0700767
santhoshbc421422014-08-17 09:48:49 -0700768 f.write("--------------------------------------------------------------------------------- \n")
769
770 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
771 f.write(str(json_str[j]["meters"][1]['meter']['count']))
772 f.write('\t')
773 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
774 f.write('\t')
775 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
776 f.write('\t')
777 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
778 f.write('\t')
779 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
780 f.write('\n')
781 f.write('\n')
782 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -0700783
784 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh91195f12014-08-07 13:53:50 -0700785
santhoshbc421422014-08-17 09:48:49 -0700786 f.write("--------------------------------------------------------------------------------- \n")
787 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -0700788 time.sleep(NBsleep)
santhosh91195f12014-08-07 13:53:50 -0700789 f.close()
santhosh518cc672014-08-20 16:32:26 -0700790 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -0700791 nbtpavg4n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -0700792 print nbtpavg4n
santhoshbc421422014-08-17 09:48:49 -0700793
santhosh91195f12014-08-07 13:53:50 -0700794
795 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -0700796 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -0700797 main.log.report("Intent Throughput for 4-node ONOS cluster = " + str(nbtpavg4n) + " Intents/sec")
santhoshbc421422014-08-17 09:48:49 -0700798
799 def CASE51(self,main):
800 main.case("Starting SB test for 5 nodes")
santhosh11cbaed2014-08-26 15:17:36 -0700801 main.log.report("SB Throughput test: loading 5-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -0700802 ip1 = main.params['CTRL']['ip1']
803 ip2 = main.params['CTRL']['ip2']
804 ip3 = main.params['CTRL']['ip3']
805 ip4 = main.params['CTRL']['ip4']
806 ip5 = main.params['CTRL']['ip5']
807 rate1 = main.params['RATE1']
808 run_dur = main.params['RUN_DUR']
809 loop = int( main.params['loop'])
810 switches_num = main.params['switches_num']
811 port = main.params['port']
812 print loop
813 sleep_init = int(main.params['sleep_init'])
814 sleep_t =int( main.params['sleep_t'])
815 main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
816 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
817 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)
818 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
819 import time
820 import json
santhoshfe88a202014-08-19 18:53:23 -0700821 tpval = 0.0
822 global tpavg5n
823 tpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700824 time.sleep(sleep_init)
825
826 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close()
827 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
828 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
829 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
830 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
831 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
832
833 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a")
834 #time.sleep(10)
835 for i in range(int (loop)):
836 j1 = main.ONOS2.get_json(url1)
837 j2 = main.ONOS2.get_json(url2)
838 j3 = main.ONOS2.get_json(url3)
839 j4 = main.ONOS2.get_json(url4)
840 j5 = main.ONOS2.get_json(url5)
841 json_str = []
842 json_str.append(0)
843 json_str.append(j1)
844 json_str.append(j2)
845 json_str.append(j3)
846 json_str.append(j4)
847 json_str.append(j5)
848 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
849 # write_str = str(json_str["meters"][4]["meter"][2])
850 #print str(json_str["meters"][4])
851 #f.write(str(json_str["meters"][4]))
852 #f.write('\n')
853 #time.sleep(3)
854 for j in range(1,6):
855 f.write("ONOS" + str(j) + "\n")
856 f.write(str(json_str[j]["meters"][4]['meter']['count']))
857 f.write('\t')
858 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
859 f.write('\t')
860 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
861 f.write('\t')
862 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
863 f.write('\t')
864 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
865 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -0700866 if j == 3:
867 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
868 #print tpval
santhoshbc421422014-08-17 09:48:49 -0700869
870 f.write('\n')
871 f.write('\n')
872
873 f.write("--------------------------------------------------------------------------------- \n")
874 time.sleep(sleep_t)
875 f.close()
santhoshfe88a202014-08-19 18:53:23 -0700876 #print tpval
877 print("\n")
878 tpavg5n = round(tpval)/loop
879 print tpavg5n
santhoshbc421422014-08-17 09:48:49 -0700880
881 #main.Mininet2.handle.expect("\$", timeout=900)
882 #main.Mininet2.handle.sendline("sudo mn -c")
883 #main.Mininet2.handle.expect("\$")
884 time.sleep(5)
885 main.Mininet2.handle.expect("\$", timeout=900)
886 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -0700887 main.log.report("Topology Event Throughput for 5-node ONOS cluster = " + str(tpavg5n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -0700888
889
890 def CASE52(self,main):
891
892 ip1 = main.params['CTRL']['ip1']
893 ip2 = main.params['CTRL']['ip2']
894 ip3 = main.params['CTRL']['ip3']
895 ip4 = main.params['CTRL']['ip4']
896 ip5 = main.params['CTRL']['ip5']
897
898 import time
899 import json
900 rate2 = main.params['RATE2']
901 run_dur = main.params['RUN_DUR']
902 loop = int(main.params['loop'])
903 sleep_t = int(main.params['sleep_t'])
904 sleep_init = int(main.params['sleep_init'])
905 switches_num = main.params['switches_num']
906 port = main.params['port']
907 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
908 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
909 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)
910 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
911 time.sleep(sleep_init)
912 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", 'w').close()
913 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
914 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
915 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
916 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
917 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
918 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", "a")
919 #time.sleep(10)
920 for i in range(int (loop)):
921 j1 = main.ONOS2.get_json(url1)
922 j2 = main.ONOS2.get_json(url2)
923 j3 = main.ONOS2.get_json(url3)
924 j4 = main.ONOS2.get_json(url4)
925 j5 = main.ONOS2.get_json(url5)
926 json_str = []
927 json_str.append(0)
928 json_str.append(j1)
929 json_str.append(j2)
930 json_str.append(j3)
931 json_str.append(j4)
932 json_str.append(j5)
933 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[4] != "":
934 # write_str = str(json_str["meters"][4]["meter"][2])
935 #print str(json_str["meters"][4])
936 #f.write(str(json_str["meters"][4]))
937 #f.write('\n')
938 #time.sleep(3)
939 for j in range(1,6):
940 f.write("ONOS" + str(j) + "\n")
941 f.write(str(json_str[j]["meters"][4]['meter']['count']))
942 f.write('\t')
943 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
944 f.write('\t')
945 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
946 f.write('\t')
947 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
948 f.write('\t')
949 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
950 f.write('\n')
951
952 f.write('\n')
953 f.write('\n')
954
955 f.write("--------------------------------------------------------------------------------- \n")
956 time.sleep(sleep_t)
957 f.close()
958 time.sleep(180)
959
960 def CASE53(self,main):
961
santhosh518cc672014-08-20 16:32:26 -0700962 main.case("Starting NB Throughput test after scaling up to 5 onos nodes")
santhoshbc421422014-08-17 09:48:49 -0700963 ip1 = main.params['CTRL']['ip1']
964 ip2 = main.params['CTRL']['ip2']
965 ip3 = main.params['CTRL']['ip3']
966 ip4 = main.params['CTRL']['ip4']
967
968 import time
969 import json
santhoshfe88a202014-08-19 18:53:23 -0700970 int_num = main.params['int_num']
971 addrate = main.params['addrate']
972 NBdur = main.params['NBdur']
973 NBsleep = int(main.params['NBsleep'])
974 NBsleep_init = int(main.params['NBsleep_init'])
975 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -0700976 nbtpval = 0.0
santhosh11cbaed2014-08-26 15:17:36 -0700977 main.log.report("Starting NB Throughput test: loading 5-node ONOS cluster with " + int_num + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -0700978 global nbtpavg5n
979 nbtpavg5n = 0.0
santhoshbc421422014-08-17 09:48:49 -0700980
981 main.Mininet4.handle.expect("\$")
982 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
983 #main.Mininet2.handle.expect("mininet>" , timeout=400)
984 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
985 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
986 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
987 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -0700988 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
989 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633")
990 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.5:6633")
santhoshd3957122014-08-21 19:33:58 -0700991
santhoshbc421422014-08-17 09:48:49 -0700992 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
993 main.ONOS3.handle.expect("\$")
994
santhosh518cc672014-08-20 16:32:26 -0700995 main.ONOS3.handle.sendline("./loadgen_NB.py -n 5 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -0700996 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -0700997
998
santhoshfe88a202014-08-19 18:53:23 -0700999 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001000 import json
1001
1002 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close()
1003 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1004 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1005 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1006 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1007 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1008 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a")
1009 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001010 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001011 j1 = main.ONOS2.get_json(url1)
1012 j2 = main.ONOS2.get_json(url2)
1013 j3 = main.ONOS2.get_json(url3)
1014 j4 = main.ONOS2.get_json(url4)
1015 j5 = main.ONOS2.get_json(url5)
1016 json_str = []
1017 json_str.append(0)
1018 json_str.append(j1)
1019 json_str.append(j2)
1020 json_str.append(j3)
1021 json_str.append(j4)
1022 json_str.append(j5)
1023 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "":
1024 for j in range(1,6):
1025 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1026 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1027 f.write('\t')
1028 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1029 f.write('\t')
1030 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1031 f.write('\t')
1032 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1033 f.write('\t')
1034 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1035 f.write('\n')
1036
1037 f.write('\n')
1038
1039 f.write("--------------------------------------------------------------------------------- \n")
1040
1041 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1042 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1043 f.write('\t')
1044 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1045 f.write('\t')
1046 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1047 f.write('\t')
1048 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1049 f.write('\t')
1050 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1051 f.write('\n')
1052 f.write('\n')
1053 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -07001054
1055 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -07001056
santhoshbc421422014-08-17 09:48:49 -07001057
1058 f.write("--------------------------------------------------------------------------------- \n")
1059 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001060 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001061 f.close()
santhosh518cc672014-08-20 16:32:26 -07001062 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -07001063 nbtpavg5n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -07001064 print nbtpavg5n
santhoshbc421422014-08-17 09:48:49 -07001065
1066
1067 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001068 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001069 main.log.report("Intent Throughput for 5-node ONOS cluster = " + str(nbtpavg5n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -07001070
santhoshbc421422014-08-17 09:48:49 -07001071 def CASE61(self,main):
1072 main.case("Starting SB test for 5 nodes")
1073 ip1 = main.params['CTRL']['ip1']
santhosh11cbaed2014-08-26 15:17:36 -07001074 main.log.report("SB Throughput test: loading 6-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -07001075 ip2 = main.params['CTRL']['ip2']
1076 ip3 = main.params['CTRL']['ip3']
1077 ip4 = main.params['CTRL']['ip4']
1078 ip5 = main.params['CTRL']['ip5']
1079 ip6 = main.params['CTRL']['ip6']
1080 rate1 = main.params['RATE1']
1081 run_dur = main.params['RUN_DUR']
1082 loop = int( main.params['loop'])
1083 switches_num = main.params['switches_num']
1084 port = main.params['port']
1085 print loop
1086 sleep_t =int( main.params['sleep_t'])
1087 sleep_init = int(main.params['sleep_init'])
1088 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1089 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1090 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)
1091 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1092
1093 import time
1094 import json
santhoshfe88a202014-08-19 18:53:23 -07001095 tpval = 0.0
1096 global tpavg6n
1097 tpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001098 time.sleep(sleep_init)
1099 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close()
1100 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1101 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1102 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1103 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1104 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1105 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1106 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1107
1108 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a")
1109 #time.sleep(10)
1110 for i in range(int (loop)):
1111 j1 = main.ONOS2.get_json(url1)
1112 j2 = main.ONOS2.get_json(url2)
1113 j3 = main.ONOS2.get_json(url3)
1114 j4 = main.ONOS2.get_json(url4)
1115 j5 = main.ONOS2.get_json(url5)
1116 j6 = main.ONOS2.get_json(url6)
1117 json_str = []
1118 json_str.append(0)
1119 json_str.append(j1)
1120 json_str.append(j2)
1121 json_str.append(j3)
1122 json_str.append(j4)
1123 json_str.append(j5)
1124 json_str.append(j6)
1125 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1126 # write_str = str(json_str["meters"][4]["meter"][2])
1127 #print str(json_str["meters"][4])
1128 #f.write(str(json_str["meters"][4]))
1129 #f.write('\n')
1130 #time.sleep(3)
1131 for j in range(1,7):
1132 f.write("ONOS" + str(j) + "\n")
1133 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1134 f.write('\t')
1135 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1136 f.write('\t')
1137 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1138 f.write('\t')
1139 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1140 f.write('\t')
1141 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1142 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001143 if j == 3:
1144 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1145 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001146
1147 f.write('\n')
1148 f.write('\n')
1149
1150 f.write("--------------------------------------------------------------------------------- \n")
1151 time.sleep(sleep_t)
1152 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001153 #print tpval
1154 print("\n")
1155 tpavg6n = round(tpval)/loop
1156 print tpavg6n
santhoshbc421422014-08-17 09:48:49 -07001157
1158 #main.Mininet2.handle.expect("\$", timeout=900)
1159 #main.Mininet2.handle.sendline("sudo mn -c")
1160 #main.Mininet2.handle.expect("\$")
1161 time.sleep(5)
1162 main.Mininet2.handle.expect("\$", timeout=900)
1163 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001164 main.log.report("Topology Event Throughput for 6-node ONOS cluster = " + str(tpavg6n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -07001165
1166
1167 def CASE62(self,main):
1168
1169 ip1 = main.params['CTRL']['ip1']
1170 ip2 = main.params['CTRL']['ip2']
1171 ip3 = main.params['CTRL']['ip3']
1172 ip4 = main.params['CTRL']['ip4']
1173 ip5 = main.params['CTRL']['ip5']
1174 ip6 = main.params['CTRL']['ip6']
1175
1176 import time
1177 import json
1178 rate2 = main.params['RATE2']
1179 run_dur = main.params['RUN_DUR']
1180 loop = int(main.params['loop'])
1181 sleep_t = int(main.params['sleep_t'])
1182 switches_num = main.params['switches_num']
1183 sleep_init = int(main.params['sleep_init'])
1184 port = main.params['port']
1185 main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1186 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1187 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)
1188 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1189 time.sleep(sleep_init)
1190 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", 'w').close()
1191 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1192 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1193 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1194 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1195 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1196 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1197 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1198 #time.sleep(10)
1199 for i in range(int (loop)):
1200 j1 = main.ONOS2.get_json(url1)
1201 j2 = main.ONOS2.get_json(url2)
1202 j3 = main.ONOS2.get_json(url3)
1203 j4 = main.ONOS2.get_json(url4)
1204 j5 = main.ONOS2.get_json(url5)
1205 j6 = main.ONOS2.get_json(url6)
1206 json_str = []
1207 json_str.append(0)
1208 json_str.append(j1)
1209 json_str.append(j2)
1210 json_str.append(j3)
1211 json_str.append(j4)
1212 json_str.append(j5)
1213 json_str.append(j6)
1214 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1215 # write_str = str(json_str["meters"][4]["meter"][2])
1216 #print str(json_str["meters"][4])
1217 #f.write(str(json_str["meters"][4]))
1218 #f.write('\n')
1219 #time.sleep(3)
1220 for j in range(1,7):
1221 f.write("ONOS" + str(j) + "\n")
1222 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1223 f.write('\t')
1224 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1225 f.write('\t')
1226 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1227 f.write('\t')
1228 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1229 f.write('\t')
1230 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1231 f.write('\n')
1232
1233 f.write('\n')
1234 f.write('\n')
1235
1236 f.write("--------------------------------------------------------------------------------- \n")
1237 time.sleep(sleep_t)
1238 f.close()
1239 time.sleep(180)
1240
1241 def CASE63(self,main):
1242
1243 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1244 ip1 = main.params['CTRL']['ip1']
1245 ip2 = main.params['CTRL']['ip2']
1246 ip3 = main.params['CTRL']['ip3']
1247 ip4 = main.params['CTRL']['ip4']
1248
1249 import time
1250 import json
santhoshfe88a202014-08-19 18:53:23 -07001251 int_num = main.params['int_num']
1252 addrate = main.params['addrate']
1253 NBdur = main.params['NBdur']
1254 NBsleep = int(main.params['NBsleep'])
1255 NBsleep_init = int(main.params['NBsleep_init'])
1256 NBloop = int(main.params['NBloop'])
santhosh518cc672014-08-20 16:32:26 -07001257 nbtpval = 0.0
santhosh11cbaed2014-08-26 15:17:36 -07001258 main.log.report("Starting NB Throughput test: loading 6-node ONOS cluster with " + int_num + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -07001259 global nbtpavg6n
1260 nbtpavg6n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001261
1262 main.Mininet4.handle.expect("\$")
1263 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1264 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1265 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1266 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1267 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1268 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001269 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1270 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1271 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.6:6633")
santhoshd3957122014-08-21 19:33:58 -07001272
santhoshbc421422014-08-17 09:48:49 -07001273 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1274 main.ONOS3.handle.expect("\$")
1275
santhosh518cc672014-08-20 16:32:26 -07001276 main.ONOS3.handle.sendline("./loadgen_NB.py -n 6 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 10.128.10.6:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -07001277 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001278
1279
santhoshfe88a202014-08-19 18:53:23 -07001280 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001281 import json
1282
1283 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close()
1284 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1285 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1286 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1287 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1288 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1289 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1290 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a")
1291 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001292 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001293 j1 = main.ONOS2.get_json(url1)
1294 j2 = main.ONOS2.get_json(url2)
1295 j3 = main.ONOS2.get_json(url3)
1296 j4 = main.ONOS2.get_json(url4)
1297 j5 = main.ONOS2.get_json(url5)
1298 j6 = main.ONOS2.get_json(url6)
1299 json_str = []
1300 json_str.append(0)
1301 json_str.append(j1)
1302 json_str.append(j2)
1303 json_str.append(j3)
1304 json_str.append(j4)
1305 json_str.append(j5)
1306 json_str.append(j6)
1307 if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "":
1308 for j in range(1,7):
1309 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1310 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1311 f.write('\t')
1312 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1313 f.write('\t')
1314 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1315 f.write('\t')
1316 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1317 f.write('\t')
1318 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1319 f.write('\n')
1320
1321 f.write('\n')
1322
1323 f.write("--------------------------------------------------------------------------------- \n")
1324
1325 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1326 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1327 f.write('\t')
1328 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1329 f.write('\t')
1330 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1331 f.write('\t')
1332 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1333 f.write('\t')
1334 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1335 f.write('\n')
1336 f.write('\n')
1337 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -07001338
1339 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -07001340
santhoshbc421422014-08-17 09:48:49 -07001341
1342 f.write("--------------------------------------------------------------------------------- \n")
1343 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001344 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001345 f.close()
santhosh518cc672014-08-20 16:32:26 -07001346 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -07001347 nbtpavg6n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -07001348 print nbtpavg6n
1349
santhoshbc421422014-08-17 09:48:49 -07001350
1351
1352 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001353 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001354 main.log.report("Intent Throughput for 6-node ONOS cluster = " + str(nbtpavg6n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -07001355
santhoshbc421422014-08-17 09:48:49 -07001356 def CASE71(self,main):
1357 main.case("Starting SB test for 7 nodes")
santhosh11cbaed2014-08-26 15:17:36 -07001358 main.log.report("SB Throughput test: loading 7-node ONOS cluster with 740 Topo Events/s")
santhoshbc421422014-08-17 09:48:49 -07001359 ip1 = main.params['CTRL']['ip1']
1360 ip2 = main.params['CTRL']['ip2']
1361 ip3 = main.params['CTRL']['ip3']
1362 ip4 = main.params['CTRL']['ip4']
1363 ip5 = main.params['CTRL']['ip5']
1364 ip6 = main.params['CTRL']['ip6']
1365 ip7 = main.params['CTRL']['ip7']
1366 rate1 = main.params['RATE1']
1367 run_dur = main.params['RUN_DUR']
1368 loop = int( main.params['loop'])
1369 switches_num = main.params['switches_num']
1370 port = main.params['port']
1371 print loop
1372 sleep_t =int( main.params['sleep_t'])
1373 sleep_init = int(main.params['sleep_init'])
1374 main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur)
1375 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"")
1376 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)
1377 main.Mininet2.handle.expect("Starting SB load....", timeout=900)
1378 import time
1379 import json
santhoshfe88a202014-08-19 18:53:23 -07001380 tpval = 0.0
1381 global tpavg7n
1382 tpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001383 time.sleep(sleep_init)
1384
1385 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close()
1386 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1387 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1388 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1389 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1390 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1391 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1392 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1393 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1394
1395 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a")
1396 #time.sleep(10)
1397 for i in range(int (loop)):
1398 j1 = main.ONOS2.get_json(url1)
1399 j2 = main.ONOS2.get_json(url2)
1400 j3 = main.ONOS2.get_json(url3)
1401 j4 = main.ONOS2.get_json(url4)
1402 j5 = main.ONOS2.get_json(url5)
1403 j6 = main.ONOS2.get_json(url6)
1404 j7 = main.ONOS2.get_json(url7)
1405 json_str = []
1406 json_str.append(0)
1407 json_str.append(j1)
1408 json_str.append(j2)
1409 json_str.append(j3)
1410 json_str.append(j4)
1411 json_str.append(j5)
1412 json_str.append(j6)
1413 json_str.append(j7)
1414 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] != "":
1415 # write_str = str(json_str["meters"][4]["meter"][2])
1416 #print str(json_str["meters"][4])
1417 #f.write(str(json_str["meters"][4]))
1418 #f.write('\n')
1419 #time.sleep(3)
1420 for j in range(1,8):
1421 f.write("ONOS" + str(j) + "\n")
1422 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1423 f.write('\t')
1424 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1425 f.write('\t')
1426 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1427 f.write('\t')
1428 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1429 f.write('\t')
1430 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1431 f.write('\n')
santhoshfe88a202014-08-19 18:53:23 -07001432 if j == 3:
1433 tpval += float(json_str[j]["meters"][4]['meter']['m1_rate'])
1434 #print tpval
santhoshbc421422014-08-17 09:48:49 -07001435
1436 f.write('\n')
1437 f.write('\n')
1438
1439 f.write("--------------------------------------------------------------------------------- \n")
1440 time.sleep(sleep_t)
1441 f.close()
santhoshfe88a202014-08-19 18:53:23 -07001442 #print tpval
1443 print("\n")
1444 tpavg7n = round(tpval)/loop
1445 print tpavg7n
santhoshbc421422014-08-17 09:48:49 -07001446
1447 #main.Mininet2.handle.expect("\$", timeout=900)
1448 #main.Mininet2.handle.sendline("sudo mn -c")
1449 #main.Mininet2.handle.expect("\$")
1450 time.sleep(5)
1451 main.Mininet2.handle.expect("\$", timeout=900)
1452 time.sleep(180)
santhosh5d159cc2014-08-25 14:24:53 -07001453 main.log.report("Topology Event Throughput for 7-node ONOS cluster = " + str(tpavg7n) + " Events/sec")
santhoshbc421422014-08-17 09:48:49 -07001454
1455
1456 def CASE72(self,main):
1457
1458 ip1 = main.params['CTRL']['ip1']
1459 ip2 = main.params['CTRL']['ip2']
1460 ip3 = main.params['CTRL']['ip3']
1461 ip4 = main.params['CTRL']['ip4']
1462 ip5 = main.params['CTRL']['ip5']
1463 ip6 = main.params['CTRL']['ip6']
1464 ip7 = main.params['CTRL']['ip7']
1465
1466 import time
1467 import json
1468 rate2 = main.params['RATE2']
1469 run_dur = main.params['RUN_DUR']
1470 loop = int(main.params['loop'])
1471 sleep_t = int(main.params['sleep_t'])
1472 sleep_init = int(main.params['sleep_init'])
1473 switches_num = main.params['switches_num']
1474 port = main.params['port']
1475 main.case("Starting SB load on 7 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur)
1476 #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"")
1477 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)
1478 main.Mininet2.handle.expect("Starting SB load....", timeout=900 )
1479
1480 time.sleep(sleep_init)
1481
1482 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate2", 'w').close()
1483 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1484 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1485 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1486 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1487 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1488 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1489 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1490 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a")
1491 #time.sleep(10)
1492 for i in range(int (loop)):
1493 j1 = main.ONOS2.get_json(url1)
1494 j2 = main.ONOS2.get_json(url2)
1495 j3 = main.ONOS2.get_json(url3)
1496 j4 = main.ONOS2.get_json(url4)
1497 j5 = main.ONOS2.get_json(url5)
1498 j6 = main.ONOS2.get_json(url6)
1499 j7 = main.ONOS2.get_json(url7)
1500 json_str = []
1501 json_str.append(0)
1502 json_str.append(j1)
1503 json_str.append(j2)
1504 json_str.append(j3)
1505 json_str.append(j4)
1506 json_str.append(j5)
1507 json_str.append(j6)
1508 json_str.append(j7)
1509 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] != "":
1510 # write_str = str(json_str["meters"][4]["meter"][2])
1511 #print str(json_str["meters"][4])
1512 #f.write(str(json_str["meters"][4]))
1513 #f.write('\n')
1514 #time.sleep(3)
1515 for j in range(1,8):
1516 f.write("ONOS" + str(j) + "\n")
1517 f.write(str(json_str[j]["meters"][4]['meter']['count']))
1518 f.write('\t')
1519 f.write(str(json_str[j]["meters"][4]['meter']['m1_rate']))
1520 f.write('\t')
1521 f.write(str(json_str[j]["meters"][4]['meter']['m5_rate']))
1522 f.write('\t')
1523 f.write(str(json_str[j]["meters"][4]['meter']['m15_rate']))
1524 f.write('\t')
1525 f.write(str(json_str[j]["meters"][4]['meter']['mean_rate']))
1526 f.write('\n')
1527
1528 f.write('\n')
1529 f.write('\n')
1530
1531 f.write("--------------------------------------------------------------------------------- \n")
1532 time.sleep(sleep_t)
1533 f.close()
1534 time.sleep(180)
1535
1536 def CASE73(self,main):
1537
1538 main.case("Starting NB Throughput test after scaling up to 4 onos nodes")
1539 ip1 = main.params['CTRL']['ip1']
1540 ip2 = main.params['CTRL']['ip2']
1541 ip3 = main.params['CTRL']['ip3']
1542 ip4 = main.params['CTRL']['ip4']
1543
1544 import time
1545 import json
santhoshfe88a202014-08-19 18:53:23 -07001546 int_num = main.params['int_num']
1547 addrate = main.params['addrate']
1548 NBdur = main.params['NBdur']
1549 NBsleep = int(main.params['NBsleep'])
1550 NBsleep_init = int(main.params['NBsleep_init'])
1551 NBloop = int(main.params['NBloop'])
santhosh11cbaed2014-08-26 15:17:36 -07001552 main.log.report("Starting NB Throughput test: loading 7-node ONOS cluster with " + int_num + " Intents/s" )
santhosh518cc672014-08-20 16:32:26 -07001553 nbtpval = 0.0
1554 global nbtpavg7n
1555 nbtpavg7n = 0.0
santhoshbc421422014-08-17 09:48:49 -07001556
1557 main.Mininet4.handle.expect("\$")
1558 #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp")
1559 #main.Mininet2.handle.expect("mininet>" , timeout=400)
1560 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633")
1561 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633")
1562 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633")
1563 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633")
santhoshfe88a202014-08-19 18:53:23 -07001564 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633")
1565 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633")
1566 main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.7:6633")
santhoshd3957122014-08-21 19:33:58 -07001567
santhoshbc421422014-08-17 09:48:49 -07001568 main.ONOS3.handle.sendline("cd ~admin/suibin-dev")
1569 main.ONOS3.handle.expect("\$")
1570
santhosh518cc672014-08-20 16:32:26 -07001571 main.ONOS3.handle.sendline("./loadgen_NB.py -n 7 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.6:8080 10.128.10.5:8080 10.128.10.7:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20")
santhoshfe88a202014-08-19 18:53:23 -07001572 main.ONOS3.handle.expect("Pause between add and delete:", timeout=900)
santhoshbc421422014-08-17 09:48:49 -07001573
1574
santhoshfe88a202014-08-19 18:53:23 -07001575 time.sleep(NBsleep_init)
santhoshbc421422014-08-17 09:48:49 -07001576 import json
1577
1578 open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close()
1579 url1 = "http://10.128.10.1:8080/wm/onos/metrics"
1580 url2 = "http://10.128.10.2:8080/wm/onos/metrics"
1581 url3 = "http://10.128.10.3:8080/wm/onos/metrics"
1582 url4 = "http://10.128.10.4:8080/wm/onos/metrics"
1583 url5 = "http://10.128.10.5:8080/wm/onos/metrics"
1584 url6 = "http://10.128.10.6:8080/wm/onos/metrics"
1585 url7 = "http://10.128.10.7:8080/wm/onos/metrics"
1586 f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a")
1587 #time.sleep(10)
santhoshfe88a202014-08-19 18:53:23 -07001588 for i in range(NBloop):
santhoshbc421422014-08-17 09:48:49 -07001589 j1 = main.ONOS2.get_json(url1)
1590 j2 = main.ONOS2.get_json(url2)
1591 j3 = main.ONOS2.get_json(url3)
1592 j4 = main.ONOS2.get_json(url4)
1593 j5 = main.ONOS2.get_json(url5)
1594 j6 = main.ONOS2.get_json(url6)
1595 j7 = main.ONOS2.get_json(url7)
1596 json_str = []
1597 json_str.append(0)
1598 json_str.append(j1)
1599 json_str.append(j2)
1600 json_str.append(j3)
1601 json_str.append(j4)
1602 json_str.append(j5)
1603 json_str.append(j6)
1604 json_str.append(j7)
1605 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] != "":
1606 for j in range(1,8):
1607 f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n")
1608 f.write(str(json_str[j]["meters"][0]['meter']['count']))
1609 f.write('\t')
1610 f.write(str(json_str[j]["meters"][0]['meter']['m1_rate']))
1611 f.write('\t')
1612 f.write(str(json_str[j]["meters"][0]['meter']['m5_rate']))
1613 f.write('\t')
1614 f.write(str(json_str[j]["meters"][0]['meter']['m15_rate']))
1615 f.write('\t')
1616 f.write(str(json_str[j]["meters"][0]['meter']['mean_rate']))
1617 f.write('\n')
1618
1619 f.write('\n')
1620
1621 f.write("--------------------------------------------------------------------------------- \n")
1622
1623 f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ")
1624 f.write(str(json_str[j]["meters"][1]['meter']['count']))
1625 f.write('\t')
1626 f.write(str(json_str[j]["meters"][1]['meter']['m1_rate']))
1627 f.write('\t')
1628 f.write(str(json_str[j]["meters"][1]['meter']['m5_rate']))
1629 f.write('\t')
1630 f.write(str(json_str[j]["meters"][1]['meter']['m15_rate']))
1631 f.write('\t')
1632 f.write(str(json_str[j]["meters"][1]['meter']['mean_rate']))
1633 f.write('\n')
1634 f.write('\n')
1635 f.write('\n')
santhosh11cbaed2014-08-26 15:17:36 -07001636
1637 nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate'])
santhosh518cc672014-08-20 16:32:26 -07001638
santhoshbc421422014-08-17 09:48:49 -07001639
1640 f.write("--------------------------------------------------------------------------------- \n")
1641 f.write("--------------------------------------------------------------------------------- \n \n")
santhoshfe88a202014-08-19 18:53:23 -07001642 time.sleep(NBsleep)
santhoshbc421422014-08-17 09:48:49 -07001643 f.close()
santhosh518cc672014-08-20 16:32:26 -07001644 print("\n")
santhosh11cbaed2014-08-26 15:17:36 -07001645 nbtpavg7n = round(round(nbtpval)/NBloop,2)
santhosh518cc672014-08-20 16:32:26 -07001646 print nbtpavg7n
santhoshbc421422014-08-17 09:48:49 -07001647
1648
1649 main.ONOS3.handle.expect("\$", timeout=900)
santhoshd3957122014-08-21 19:33:58 -07001650 time.sleep(180)
santhosh11cbaed2014-08-26 15:17:36 -07001651 main.log.report("Intent Throughput for 7-node ONOS cluster = " + str(nbtpavg7n) + " Intents/sec")
santhoshd3957122014-08-21 19:33:58 -07001652
santhoshbc421422014-08-17 09:48:49 -07001653 def CASE8(self,main):
1654 import time
santhosh11cbaed2014-08-26 15:17:36 -07001655 main.log.report("Scaling ONOS down to 6 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001656 main.ONOS7.handle.sendline("./onos.sh core stop")
1657 time.sleep(8)
1658 pdata = main.ONOS7.isup()
1659 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
1660 time.sleep(3)
santhoshbc421422014-08-17 09:48:49 -07001661 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1662 for i in range(3):
1663 if data == main.FALSE:
1664 #main.log.report("Something is funny... restarting ONOS")
1665 #main.ONOS1.stop()
1666 time.sleep(3)
1667 #main.ONOS1.start()
1668 #time.sleep(5)
1669 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup()
1670 else:
1671 break
santhosh5d159cc2014-08-25 14:24:53 -07001672 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 -07001673
1674 def CASE9(self,main):
1675
santhosh11cbaed2014-08-26 15:17:36 -07001676 main.log.report("Scaling ONOS down to 5 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001677 main.ONOS6.handle.sendline("./onos.sh core stop")
1678 time.sleep(8)
1679 pdata = main.ONOS6.isup() and main.ONOS7.isup()
1680 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001681 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1682 for i in range(3):
1683 if data == main.FALSE:
1684 #main.log.report("Something is funny... restarting ONOS")
1685 #main.ONOS1.stop()
1686 time.sleep(3)
1687 #main.ONOS1.start()
1688 #time.sleep(5)
1689 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup()
1690 else:
1691 break
santhosh5d159cc2014-08-25 14:24:53 -07001692 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 -07001693
1694 def CASE10(self,main):
1695
santhosh11cbaed2014-08-26 15:17:36 -07001696 main.log.report("Scaling ONOS down to 4 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001697
1698 main.ONOS5.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001699 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001700 pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1701 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001702 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1703 for i in range(3):
1704 if data == main.FALSE:
1705 #main.log.report("Something is funny... restarting ONOS")
1706 #main.ONOS1.stop()
1707 time.sleep(3)
1708 #main.ONOS1.start()
1709 #time.sleep(5)
1710 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup()
1711 else:
1712 break
santhosh5d159cc2014-08-25 14:24:53 -07001713 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 -07001714
1715 def CASE11(self,main):
1716
santhosh11cbaed2014-08-26 15:17:36 -07001717 main.log.report("Scaling ONOS down to 3 ONOS instances")
santhoshfe88a202014-08-19 18:53:23 -07001718 main.ONOS4.handle.sendline("./onos.sh core stop ")
santhoshbc421422014-08-17 09:48:49 -07001719 time.sleep(5)
santhoshfe88a202014-08-19 18:53:23 -07001720 pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup()
1721 utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...")
santhoshbc421422014-08-17 09:48:49 -07001722 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1723 for i in range(3):
1724 if data == main.FALSE:
1725 #main.log.report("Something is funny... restarting ONOS")
1726 #main.ONOS1.stop()
1727 time.sleep(3)
1728 #main.ONOS1.start()
1729 #time.sleep(5)
1730 data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup()
1731 else:
1732 break
santhosh5d159cc2014-08-25 14:24:53 -07001733 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 -07001734
1735 def CASE100(self,main):
1736 import os
1737 import time
1738 global timestr
1739 timestr = time.strftime("%Y%m%d-%H%M%S")
1740 main.case("Scale-up tests complete...now making final changes")
1741 main.log.info("moving logs....")
1742 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001743 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001744 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001745 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "")
1746 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001747 time.sleep(2)
1748 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
santhoshfe88a202014-08-19 18:53:23 -07001749 time.sleep(180)
1750
santhoshbc421422014-08-17 09:48:49 -07001751 def CASE101(self,main):
1752
1753 import os
1754 import time
1755 main.case("Scale-down tests complete...now making final changes")
1756 global timestr
1757 main.case("Scale-down tests complete...now making final changes")
1758 main.log.info("moving logs....")
1759 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
santhoshfe88a202014-08-19 18:53:23 -07001760 os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001761 time.sleep(2)
santhoshfe88a202014-08-19 18:53:23 -07001762 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "")
1763 os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "")
santhoshbc421422014-08-17 09:48:49 -07001764 time.sleep(2)
1765 os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*")
1766 time.sleep(2)
1767
santhoshfe88a202014-08-19 18:53:23 -07001768 def CASE103(self,main):
1769 import os
1770 import time
santhosh11cbaed2014-08-26 15:17:36 -07001771 main.log.report("Posting the results to http://10.128.5.54/scale.html")
santhoshfe88a202014-08-19 18:53:23 -07001772 db_script = main.params['db_script']
santhosh581e4152014-08-20 12:13:40 -07001773 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 -07001774 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
1775
santhoshfe88a202014-08-19 18:53:23 -07001776 def CASE104(self,main):
1777 import os
1778 import time
santhosh11cbaed2014-08-26 15:17:36 -07001779 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhoshfe88a202014-08-19 18:53:23 -07001780 db_script = main.params['db_script']
santhosh483a4162014-08-20 22:40:51 -07001781 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 -07001782
santhosh11cbaed2014-08-26 15:17:36 -07001783 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 -07001784
santhosh518cc672014-08-20 16:32:26 -07001785 def CASE105(self,main):
1786 import os
1787 import time
santhosh11cbaed2014-08-26 15:17:36 -07001788 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhosh518cc672014-08-20 16:32:26 -07001789 db_script = main.params['db_script']
1790 os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'")
1791
santhosh11cbaed2014-08-26 15:17:36 -07001792 main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html")
1793
santhosh518cc672014-08-20 16:32:26 -07001794 def CASE106(self,main):
1795 import os
1796 import time
santhosh11cbaed2014-08-26 15:17:36 -07001797 main.log.report("Posting the results to http://10.128.5.54/scale.html ....")
santhosh518cc672014-08-20 16:32:26 -07001798 db_script = main.params['db_script']
santhoshd3957122014-08-21 19:33:58 -07001799 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 -07001800
santhosh11cbaed2014-08-26 15:17:36 -07001801 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 -07001802
santhosh91195f12014-08-07 13:53:50 -07001803