blob: 68d7b5d9f2a3a051ac50951699d1eee4cd688fac [file] [log] [blame]
andrewonlabadd2fd62014-11-11 18:37:35 -05001#TopoPerfNext
2#
andrewonlab51b180b2014-11-12 18:19:28 -05003#Topology Convergence scale-out test for ONOS-next
4#NOTE: This test supports up to 7 nodes scale-out scenario
andrewonlabadd2fd62014-11-11 18:37:35 -05005#
andrewonlaba036b402014-11-17 13:47:46 -05006#NOTE: Ensure that you have 'tablet.json' file
7# in the onos/tools/package/config directory
8#NOTE: You must start this test initially with 3 nodes
9#
andrewonlabadd2fd62014-11-11 18:37:35 -050010#andrew@onlab.us
11
12import time
13import sys
14import os
15import re
16
17class TopoConvNext:
18 def __init__(self):
19 self.default = ''
20
andrewonlabadd2fd62014-11-11 18:37:35 -050021 def CASE1(self, main):
22 '''
23 ONOS startup sequence
24 '''
25 import time
andrewonlab54cec4b2014-11-12 13:30:23 -050026
27 #******
28 #Global cluster count for scale-out purposes
29 global cluster_count
andrewonlab7b4e8ba2014-11-20 17:45:04 -050030 global topo_iteration
31 topo_iteration = 1
andrewonlabf50ad012014-11-25 15:48:37 -050032 cluster_count = 1
andrewonlab54cec4b2014-11-12 13:30:23 -050033 #******
andrewonlabadd2fd62014-11-11 18:37:35 -050034 cell_name = main.params['ENV']['cellName']
35
36 git_pull = main.params['GIT']['autoPull']
37 checkout_branch = main.params['GIT']['checkout']
38
39 ONOS1_ip = main.params['CTRL']['ip1']
andrewonlab54cec4b2014-11-12 13:30:23 -050040 ONOS2_ip = main.params['CTRL']['ip2']
41 ONOS3_ip = main.params['CTRL']['ip3']
42 ONOS4_ip = main.params['CTRL']['ip4']
43 ONOS5_ip = main.params['CTRL']['ip5']
44 ONOS6_ip = main.params['CTRL']['ip6']
45 ONOS7_ip = main.params['CTRL']['ip7']
andrewonlabadd2fd62014-11-11 18:37:35 -050046 MN1_ip = main.params['MN']['ip1']
47 BENCH_ip = main.params['BENCH']['ip']
48
49 main.case("Setting up test environment")
andrewonlabc1850522014-11-21 12:07:33 -050050 main.log.info("copying topology event accumulator config file"+\
andrewonlab0e1825c2014-11-20 20:07:00 -050051 " to ONOS package/etc/ directory")
52 topo_config_name = main.params['TEST']['topo_config_name']
53 topo_config =\
54 main.params['TEST']['topo_accumulator_config']
andrewonlabc1850522014-11-21 12:07:33 -050055 main.ONOSbench.handle.sendline("cp ~/"+topo_config+\
56 " ~/ONOS/tools/package/etc/"+\
andrewonlab0e1825c2014-11-20 20:07:00 -050057 topo_config_name)
58 main.ONOSbench.handle.expect("\$")
59
andrewonlaba036b402014-11-17 13:47:46 -050060 main.log.info("Uninstalling previous instances")
andrewonlab7b4e8ba2014-11-20 17:45:04 -050061 #main.ONOSbench.onos_uninstall(node_ip = ONOS1_ip)
andrewonlabf50ad012014-11-25 15:48:37 -050062 main.ONOSbench.onos_uninstall(node_ip = ONOS2_ip)
63 main.ONOSbench.onos_uninstall(node_ip = ONOS3_ip)
andrewonlaba036b402014-11-17 13:47:46 -050064 main.ONOSbench.onos_uninstall(node_ip = ONOS4_ip)
65 main.ONOSbench.onos_uninstall(node_ip = ONOS5_ip)
66 main.ONOSbench.onos_uninstall(node_ip = ONOS6_ip)
67 main.ONOSbench.onos_uninstall(node_ip = ONOS7_ip)
68
andrewonlabadd2fd62014-11-11 18:37:35 -050069 main.log.report("Setting up test environment")
70
71 main.step("Creating cell file")
72 cell_file_result = main.ONOSbench.create_cell_file(
andrewonlab81763ee2014-11-13 17:31:34 -050073 BENCH_ip, cell_name, MN1_ip,
andrewonlaba036b402014-11-17 13:47:46 -050074 "onos-core,onos-app-metrics",
andrewonlabf50ad012014-11-25 15:48:37 -050075 #ONOS1_ip, ONOS2_ip, ONOS3_ip)
76 ONOS1_ip)
andrewonlab5b8c02f2014-11-21 17:56:10 -050077
andrewonlabadd2fd62014-11-11 18:37:35 -050078 main.step("Applying cell file to environment")
79 cell_apply_result = main.ONOSbench.set_cell(cell_name)
80 verify_cell_result = main.ONOSbench.verify_cell()
81
andrewonlab7b4e8ba2014-11-20 17:45:04 -050082 main.step("Removing raft logs")
andrewonlab62749022014-11-19 19:19:58 -050083 main.ONOSbench.onos_remove_raft_logs()
andrewonlabbdc3d862014-11-25 12:40:41 -050084 time.sleep(10)
85
andrewonlabadd2fd62014-11-11 18:37:35 -050086 main.step("Git checkout and pull "+checkout_branch)
87 if git_pull == 'on':
88 checkout_result = \
89 main.ONOSbench.git_checkout(checkout_branch)
90 pull_result = main.ONOSbench.git_pull()
91 else:
92 checkout_result = main.TRUE
93 pull_result = main.TRUE
94 main.log.info("Skipped git checkout and pull")
95
andrewonlab62749022014-11-19 19:19:58 -050096 main.log.report("Commit information - ")
97 main.ONOSbench.get_version()
98
andrewonlabadd2fd62014-11-11 18:37:35 -050099 main.step("Using mvn clean & install")
100 #mvn_result = main.ONOSbench.clean_install()
101 mvn_result = main.TRUE
102
103 main.step("Set cell for ONOS cli env")
104 main.ONOS1cli.set_cell(cell_name)
andrewonlabf50ad012014-11-25 15:48:37 -0500105 #main.ONOS2cli.set_cell(cell_name)
106 #main.ONOS3cli.set_cell(cell_name)
andrewonlab54cec4b2014-11-12 13:30:23 -0500107
andrewonlabadd2fd62014-11-11 18:37:35 -0500108 main.step("Creating ONOS package")
109 package_result = main.ONOSbench.onos_package()
110
andrewonlab54cec4b2014-11-12 13:30:23 -0500111 #Start test with single node only
andrewonlabadd2fd62014-11-11 18:37:35 -0500112 main.step("Installing ONOS package")
113 install1_result = main.ONOSbench.onos_install(node=ONOS1_ip)
andrewonlabf50ad012014-11-25 15:48:37 -0500114 #install2_result = main.ONOSbench.onos_install(node=ONOS2_ip)
115 #install3_result = main.ONOSbench.onos_install(node=ONOS3_ip)
andrewonlabadd2fd62014-11-11 18:37:35 -0500116
117 time.sleep(10)
118
119 main.step("Start onos cli")
120 cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip)
andrewonlabf50ad012014-11-25 15:48:37 -0500121 #cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip)
122 #cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip)
andrewonlabadd2fd62014-11-11 18:37:35 -0500123
124 main.step("Enable metrics feature")
andrewonlab81763ee2014-11-13 17:31:34 -0500125 #main.ONOS1cli.feature_install("onos-app-metrics")
andrewonlabadd2fd62014-11-11 18:37:35 -0500126
127 utilities.assert_equals(expect=main.TRUE,
128 actual= cell_file_result and cell_apply_result and\
129 verify_cell_result and checkout_result and\
130 pull_result and mvn_result and\
andrewonlabbdc3d862014-11-25 12:40:41 -0500131 install1_result, #and install2_result and\
132 #install3_result,
andrewonlabadd2fd62014-11-11 18:37:35 -0500133 onpass="Test Environment setup successful",
134 onfail="Failed to setup test environment")
135
136 def CASE2(self, main):
137 '''
138 100 Switch discovery latency
139
140 Important:
141 This test case can be potentially dangerous if
142 your machine has previously set iptables rules.
143 One of the steps of the test case will flush
144 all existing iptables rules.
145 Note:
146 You can specify the number of switches in the
147 params file to adjust the switch discovery size
148 (and specify the corresponding topology in Mininet1
149 .topo file)
150 '''
151 import time
152 import subprocess
153 import os
154 import requests
155 import json
andrewonlab51b180b2014-11-12 18:19:28 -0500156 import numpy
andrewonlabadd2fd62014-11-11 18:37:35 -0500157
158 ONOS_ip_list = []
andrewonlab51b180b2014-11-12 18:19:28 -0500159 ONOS_ip_list.append('0')
andrewonlab54cec4b2014-11-12 13:30:23 -0500160 ONOS_ip_list.append(main.params['CTRL']['ip1'])
161 ONOS_ip_list.append(main.params['CTRL']['ip2'])
162 ONOS_ip_list.append(main.params['CTRL']['ip3'])
163 ONOS_ip_list.append(main.params['CTRL']['ip4'])
164 ONOS_ip_list.append(main.params['CTRL']['ip5'])
165 ONOS_ip_list.append(main.params['CTRL']['ip6'])
166 ONOS_ip_list.append(main.params['CTRL']['ip7'])
andrewonlabadd2fd62014-11-11 18:37:35 -0500167 MN1_ip = main.params['MN']['ip1']
168 ONOS_user = main.params['CTRL']['user']
169
170 default_sw_port = main.params['CTRL']['port1']
171
172 #Number of iterations of case
173 num_iter = main.params['TEST']['numIter']
andrewonlab0e1825c2014-11-20 20:07:00 -0500174 iter_ignore = int(main.params['TEST']['iterIgnore'])
175
andrewonlab7b4e8ba2014-11-20 17:45:04 -0500176 #***********
177 #Global number of switches that change
178 #throughout the test
179 global num_sw
180 global topo_iteration
andrewonlabbdc3d862014-11-25 12:40:41 -0500181 global cluster_count
andrewonlab7b4e8ba2014-11-20 17:45:04 -0500182 if topo_iteration == 1:
183 num_sw = main.params['TEST']['numSwitch1']
184 elif topo_iteration == 2:
185 num_sw = main.params['TEST']['numSwitch2']
186 elif topo_iteration == 3:
187 num_sw = main.params['TEST']['numSwitch3']
andrewonlab28b84eb2014-12-02 15:53:35 -0500188 elif topo_iteration == 4:
189 num_sw = main.params['TEST']['numSwitch4']
andrewonlab7b4e8ba2014-11-20 17:45:04 -0500190 #***********
andrewonlabadd2fd62014-11-11 18:37:35 -0500191
192 #Timestamp 'keys' for json metrics output.
193 #These are subject to change, hence moved into params
194 deviceTimestamp = main.params['JSON']['deviceTimestamp']
195 graphTimestamp = main.params['JSON']['graphTimestamp']
196
andrewonlabadd2fd62014-11-11 18:37:35 -0500197 #Threshold for this test case
198 sw_disc_threshold_str = main.params['TEST']['swDisc100Threshold']
199 sw_disc_threshold_obj = sw_disc_threshold_str.split(",")
200 sw_disc_threshold_min = int(sw_disc_threshold_obj[0])
201 sw_disc_threshold_max = int(sw_disc_threshold_obj[1])
202
andrewonlab51b180b2014-11-12 18:19:28 -0500203 assertion = main.TRUE
andrewonlabadd2fd62014-11-11 18:37:35 -0500204 sw_discovery_lat_list = []
andrewonlaba1272172014-11-17 17:30:35 -0500205 syn_ack_delta_list = []
andrewonlabadd2fd62014-11-11 18:37:35 -0500206
andrewonlab7b4e8ba2014-11-20 17:45:04 -0500207 main.case(str(num_sw)+" switches distributed across "+
208 str(cluster_count)+" nodes convergence latency")
andrewonlab0d4478f2014-11-11 20:31:20 -0500209
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500210 main.log.report("Large topology convergence and scale-out test")
andrewonlab0d4478f2014-11-11 20:31:20 -0500211 main.log.report("Currently active ONOS node(s): ")
212 report_str = "Node "
andrewonlab51b180b2014-11-12 18:19:28 -0500213 for node in range(1, cluster_count+1):
214 report_str += (str(node) + " ")
andrewonlab0d4478f2014-11-11 20:31:20 -0500215 main.log.report(report_str)
andrewonlab0e1825c2014-11-20 20:07:00 -0500216 main.log.report("Topology size: "+str(num_sw)+" switches")
217
andrewonlab62749022014-11-19 19:19:58 -0500218 main.step("Distributing "+num_sw+" switches to each ONOS")
andrewonlab0d4478f2014-11-11 20:31:20 -0500219 index = 1
andrewonlab51b180b2014-11-12 18:19:28 -0500220 for node in range(1, cluster_count+1):
andrewonlab62749022014-11-19 19:19:58 -0500221 for i in range(index, (int(num_sw)/cluster_count)+index):
andrewonlab0d4478f2014-11-11 20:31:20 -0500222 main.Mininet1.assign_sw_controller(
223 sw=str(i),
224 ip1=ONOS_ip_list[node],
225 port1=default_sw_port)
andrewonlab54cec4b2014-11-12 13:30:23 -0500226 index = i+1
andrewonlabbdc3d862014-11-25 12:40:41 -0500227 #for i in range(1, int(num_sw)+1):
228 #main.Mininet1.assign_sw_controller(
229 #sw=str(i),
230 #ip1="10.128.174.1",
231 # port1="6633")
andrewonlab54cec4b2014-11-12 13:30:23 -0500232
233 main.log.info("Please check ptpd configuration to ensure "+\
234 "all nodes' system times are in sync")
andrewonlab54cec4b2014-11-12 13:30:23 -0500235
andrewonlab54cec4b2014-11-12 13:30:23 -0500236 time.sleep(10)
237
andrewonlab51b180b2014-11-12 18:19:28 -0500238 for i in range(0, int(num_iter)):
239 main.step("Set iptables rule to block sw connections")
240
241 #INPUT rules
242 main.ONOS1.handle.sendline(
243 "sudo iptables -A INPUT -p tcp -s "+
244 MN1_ip+" --dport "+default_sw_port+" -j DROP")
245 main.ONOS2.handle.sendline(
246 "sudo iptables -A INPUT -p tcp -s "+
247 MN1_ip+" --dport "+default_sw_port+" -j DROP")
248 main.ONOS3.handle.sendline(
249 "sudo iptables -A INPUT -p tcp -s "+
250 MN1_ip+" --dport "+default_sw_port+" -j DROP")
251 main.ONOS4.handle.sendline(
252 "sudo iptables -A INPUT -p tcp -s "+
253 MN1_ip+" --dport "+default_sw_port+" -j DROP")
254 main.ONOS5.handle.sendline(
255 "sudo iptables -A INPUT -p tcp -s "+
256 MN1_ip+" --dport "+default_sw_port+" -j DROP")
257 main.ONOS6.handle.sendline(
258 "sudo iptables -A INPUT -p tcp -s "+
259 MN1_ip+" --dport "+default_sw_port+" -j DROP")
260 main.ONOS7.handle.sendline(
261 "sudo iptables -A INPUT -p tcp -s "+
262 MN1_ip+" --dport "+default_sw_port+" -j DROP")
263
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500264 #OUTPUT rules
andrewonlab51b180b2014-11-12 18:19:28 -0500265 main.ONOS1.handle.sendline(
266 "sudo iptables -A OUTPUT -p tcp -s "+
267 MN1_ip+" --dport "+default_sw_port+" -j DROP")
268 main.ONOS2.handle.sendline(
269 "sudo iptables -A OUTPUT -p tcp -s "+
270 MN1_ip+" --dport "+default_sw_port+" -j DROP")
271 main.ONOS3.handle.sendline(
272 "sudo iptables -A OUTPUT -p tcp -s "+
273 MN1_ip+" --dport "+default_sw_port+" -j DROP")
274 main.ONOS4.handle.sendline(
275 "sudo iptables -A OUTPUT -p tcp -s "+
276 MN1_ip+" --dport "+default_sw_port+" -j DROP")
277 main.ONOS5.handle.sendline(
278 "sudo iptables -A OUTPUT -p tcp -s "+
279 MN1_ip+" --dport "+default_sw_port+" -j DROP")
280 main.ONOS6.handle.sendline(
281 "sudo iptables -A OUTPUT -p tcp -s "+
282 MN1_ip+" --dport "+default_sw_port+" -j DROP")
283 main.ONOS7.handle.sendline(
284 "sudo iptables -A OUTPUT -p tcp -s "+
285 MN1_ip+" --dport "+default_sw_port+" -j DROP")
andrewonlab0d4478f2014-11-11 20:31:20 -0500286
andrewonlab51b180b2014-11-12 18:19:28 -0500287 main.log.info("Please wait for switch connection to timeout")
andrewonlab62749022014-11-19 19:19:58 -0500288
289
290 #time.sleep(60)
291 #if cluster_count >= 3:
292 # time.sleep(60)
andrewonlab7b4e8ba2014-11-20 17:45:04 -0500293 #if cluster_count >= 5:
294 # time.sleep(30)
295 #if cluster_count >= 6:
296 # time.sleep(30)
andrewonlaba036b402014-11-17 13:47:46 -0500297
298 if cluster_count >= 3:
andrewonlabbdc3d862014-11-25 12:40:41 -0500299 main.ONOS1.handle.sendline("tshark -i eth0 -t e | "+
300 "grep 'SYN, ACK' | grep '6633' >"+
301 "/tmp/syn_ack_onos1_iter"+str(i)+".txt &")
302 main.ONOS2.handle.sendline("tshark -i eth0 -t e | "+
303 "grep 'SYN, ACK' | grep '6633' >"+
304 "/tmp/syn_ack_onos2_iter"+str(i)+".txt &")
305 main.ONOS3.handle.sendline("tshark -i eth0 -t e | "+
306 "grep 'SYN, ACK' | grep '6633' >"+
307 "/tmp/syn_ack_onos3_iter"+str(i)+".txt &")
andrewonlaba036b402014-11-17 13:47:46 -0500308 if cluster_count >= 4:
andrewonlabbdc3d862014-11-25 12:40:41 -0500309 main.ONOS4.handle.sendline("tshark -i eth0 -t e | "+
310 "grep 'SYN, ACK' | grep '6633' >"+
311 "/tmp/syn_ack_onos4_iter"+str(i)+".txt &")
andrewonlaba036b402014-11-17 13:47:46 -0500312 if cluster_count >= 5:
andrewonlabbdc3d862014-11-25 12:40:41 -0500313 main.ONOS5.handle.sendline("tshark -i eth0 -t e | "+
314 "grep 'SYN, ACK' | grep '6633' >"+
315 "/tmp/syn_ack_onos5_iter"+str(i)+".txt &")
andrewonlaba036b402014-11-17 13:47:46 -0500316 if cluster_count >= 6:
andrewonlabbdc3d862014-11-25 12:40:41 -0500317 main.ONOS6.handle.sendline("tshark -i eth0 -t e | "+
318 "grep 'SYN, ACK' | grep '6633' >"+
319 "/tmp/syn_ack_onos6_iter"+str(i)+".txt &")
andrewonlaba036b402014-11-17 13:47:46 -0500320 if cluster_count == 7:
andrewonlabbdc3d862014-11-25 12:40:41 -0500321 main.ONOS7.handle.sendline("tshark -i eth0 -t e | "+
322 "grep 'SYN, ACK' | grep '6633' >"+
323 "/tmp/syn_ack_onos6_iter"+str(i)+".txt &")
andrewonlabf50ad012014-11-25 15:48:37 -0500324
325 #NOTE:
326 # Delay before checking devices to
327 # help prevent timing out from CLI
andrewonlab28b84eb2014-12-02 15:53:35 -0500328 # due to multiple command issuing
andrewonlabf50ad012014-11-25 15:48:37 -0500329 time.sleep(20)
330
331 loop = True
andrewonlab62749022014-11-19 19:19:58 -0500332 loop_count = 0
andrewonlabbdc3d862014-11-25 12:40:41 -0500333 device_count = 0
andrewonlabf50ad012014-11-25 15:48:37 -0500334 while loop_count < 60 and loop:
andrewonlab62749022014-11-19 19:19:58 -0500335 main.log.info("Checking devices for device down")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500336
andrewonlabf50ad012014-11-25 15:48:37 -0500337 temp_len = 0
andrewonlabbdc3d862014-11-25 12:40:41 -0500338 device_str1 = main.ONOS1cli.devices(
339 node_ip=ONOS_ip_list[1])
340 device_json1 = json.loads(device_str1)
andrewonlabf50ad012014-11-25 15:48:37 -0500341 json_len = len(device_json1)
andrewonlab5b8c02f2014-11-21 17:56:10 -0500342
andrewonlab28b84eb2014-12-02 15:53:35 -0500343 #NOTE: May want to check the rest of
344 # the ONOS instances for device down as well
345
andrewonlabf50ad012014-11-25 15:48:37 -0500346 for device1 in device_json1:
347 temp_len = temp_len + 1
348 if device1['available'] == True:
349 loop = True
350 break
351 #if I'm on the last json object and I still haven't
352 #broken out of the loop, it means there were
353 #no available devices
354 elif temp_len == json_len-1:
355 main.log.info("Temp length: "+str(temp_len))
356 main.step("Flushing iptables and obtaining t0")
357 t0_system = time.time()*1000
358
359 main.ONOS1.handle.sendline("sudo iptables -F")
360 main.ONOS2.handle.sendline("sudo iptables -F")
361 main.ONOS3.handle.sendline("sudo iptables -F")
362 main.ONOS4.handle.sendline("sudo iptables -F")
363 main.ONOS5.handle.sendline("sudo iptables -F")
364 main.ONOS6.handle.sendline("sudo iptables -F")
365 main.ONOS7.handle.sendline("sudo iptables -F")
366
367 loop = False
368 break
andrewonlab62749022014-11-19 19:19:58 -0500369
andrewonlabf50ad012014-11-25 15:48:37 -0500370 loop_count += 1
andrewonlab62749022014-11-19 19:19:58 -0500371 time.sleep(1)
andrewonlabadd2fd62014-11-11 18:37:35 -0500372
andrewonlab62749022014-11-19 19:19:58 -0500373 main.log.info("System time t0: "+str(t0_system))
andrewonlab51b180b2014-11-12 18:19:28 -0500374
375 counter_loop = 0
376 counter_avail1 = 0
377 counter_avail2 = 0
378 counter_avail3 = 0
379 counter_avail4 = 0
380 counter_avail5 = 0
381 counter_avail6 = 0
382 counter_avail7 = 0
383 onos1_dev = False
384 onos2_dev = False
385 onos3_dev = False
386 onos4_dev = False
387 onos5_dev = False
388 onos6_dev = False
389 onos7_dev = False
390
391 #TODO: Think of a more elegant way to check all
392 # switches across all nodes
393 #Goodluck debugging this loop
394 while counter_loop < 60:
395 for node in range(1, cluster_count+1):
396 if node == 1 and not onos1_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500397 main.log.info("Checking node 1 for device "+
398 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500399 device_str_obj1 = main.ONOS1cli.devices(
400 node_ip=ONOS_ip_list[1])
andrewonlab51b180b2014-11-12 18:19:28 -0500401 device_json1 = json.loads(device_str_obj1)
402 for device1 in device_json1:
403 if device1['available'] == True:
404 counter_avail1 += 1
405 if counter_avail1 == int(num_sw):
406 onos1_dev = True
407 main.log.info("All devices have been"+
408 " discovered on ONOS1")
andrewonlabfd8325f2014-11-12 19:14:06 -0500409 else:
410 counter_avail1 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500411 if node == 2 and not onos2_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500412 main.log.info("Checking node 2 for device "+
413 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500414 device_str_obj2 = main.ONOS2cli.devices(
415 node_ip=ONOS_ip_list[2])
andrewonlab51b180b2014-11-12 18:19:28 -0500416 device_json2 = json.loads(device_str_obj2)
417 for device2 in device_json2:
418 if device2['available'] == True:
419 counter_avail2 += 1
420 if counter_avail2 == int(num_sw):
421 onos2_dev = True
422 main.log.info("All devices have been"+
423 " discovered on ONOS2")
andrewonlabfd8325f2014-11-12 19:14:06 -0500424 else:
425 counter_avail2 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500426 if node == 3 and not onos3_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500427 main.log.info("Checking node 3 for device "+
428 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500429 device_str_obj3 = main.ONOS3cli.devices(
430 node_ip=ONOS_ip_list[3])
andrewonlab51b180b2014-11-12 18:19:28 -0500431 device_json3 = json.loads(device_str_obj3)
432 for device3 in device_json3:
433 if device3['available'] == True:
434 counter_avail3 += 1
435 if counter_avail3 == int(num_sw):
436 onos3_dev = True
437 main.log.info("All devices have been"+
438 " discovered on ONOS3")
andrewonlabfd8325f2014-11-12 19:14:06 -0500439 else:
440 counter_avail3 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500441 if node == 4 and not onos4_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500442 main.log.info("Checking node 4 for device "+
443 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500444 device_str_obj4 = main.ONOS4cli.devices(
445 node_ip=ONOS_ip_list[4])
andrewonlab51b180b2014-11-12 18:19:28 -0500446 device_json4 = json.loads(device_str_obj4)
447 for device4 in device_json4:
448 if device4['available'] == True:
449 counter_avail4 += 1
450 if counter_avail4 == int(num_sw):
451 onos4_dev = True
452 main.log.info("All devices have been"+
453 " discovered on ONOS4")
andrewonlabfd8325f2014-11-12 19:14:06 -0500454 else:
455 counter_avail4 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500456 if node == 5 and not onos5_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500457 main.log.info("Checking node 5 for device "+
458 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500459 device_str_obj5 = main.ONOS5cli.devices(
460 node_ip=ONOS_ip_list[5])
andrewonlab51b180b2014-11-12 18:19:28 -0500461 device_json5 = json.loads(device_str_obj5)
462 for device5 in device_json5:
463 if device5['available'] == True:
464 counter_avail5 += 1
465 if counter_avail5 == int(num_sw):
466 onos5_dev = True
467 main.log.info("All devices have been"+
468 " discovered on ONOS5")
andrewonlabfd8325f2014-11-12 19:14:06 -0500469 else:
470 counter_avail5 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500471 if node == 6 and not onos6_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500472 main.log.info("Checking node 6 for device "+
473 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500474 device_str_obj6 = main.ONOS6cli.devices(
475 node_ip=ONOS_ip_list[6])
andrewonlab51b180b2014-11-12 18:19:28 -0500476 device_json6 = json.loads(device_str_obj6)
477 for device6 in device_json6:
478 if device6['available'] == True:
479 counter_avail6 += 1
480 if counter_avail6 == int(num_sw):
481 onos6_dev = True
482 main.log.info("All devices have been"+
483 " discovered on ONOS6")
andrewonlabfd8325f2014-11-12 19:14:06 -0500484 else:
485 counter_avail6 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500486 if node == 7 and not onos7_dev:
andrewonlab0cfc7ad2014-11-13 16:29:26 -0500487 main.log.info("Checking node 7 for device "+
488 "discovery")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500489 device_str_obj7 = main.ONOS7cli.devices(
490 node_ip=ONOS_ip_list[7])
andrewonlab51b180b2014-11-12 18:19:28 -0500491 device_json7 = json.loads(device_str_obj7)
492 for device7 in device_json7:
493 if device7['available'] == True:
494 counter_avail7 += 1
495 if counter_avail7 == int(num_sw):
496 onos7_dev = True
497 main.log.info("All devices have been"+
498 " discovered on ONOS7")
andrewonlabfd8325f2014-11-12 19:14:06 -0500499 else:
500 counter_avail7 = 0
andrewonlab51b180b2014-11-12 18:19:28 -0500501 #END node loop
502
503 #TODO: clean up this mess of an if statements if possible
504 #Treat each if as a separate test case with the given
505 # cluster count. Hence when the cluster count changes
506 # the desired calculations will be made
507 if cluster_count == 1:
508 if onos1_dev:
509 main.log.info("All devices have been discovered"+
510 " on all ONOS instances")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500511 time.sleep(5)
andrewonlab51b180b2014-11-12 18:19:28 -0500512 json_str_metrics_1 =\
513 main.ONOS1cli.topology_events_metrics()
514 json_obj_1 = json.loads(json_str_metrics_1)
515 graph_timestamp_1 =\
516 json_obj_1[graphTimestamp]['value']
517
518 graph_lat_1 = \
519 int(graph_timestamp_1) - int(t0_system)
andrewonlabbdc3d862014-11-25 12:40:41 -0500520
521 main.log.info("Graph Timestamp ONOS1: "+
522 str(graph_timestamp_1))
523
andrewonlab51b180b2014-11-12 18:19:28 -0500524 if graph_lat_1 > sw_disc_threshold_min\
andrewonlab0e1825c2014-11-20 20:07:00 -0500525 and graph_lat_1 < sw_disc_threshold_max\
526 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500527 sw_discovery_lat_list.append(
528 graph_lat_1)
andrewonlabfd8325f2014-11-12 19:14:06 -0500529 main.log.info("Sw discovery latency of "+
530 str(cluster_count)+" node(s): "+
531 str(graph_lat_1)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500532 else:
533 main.log.info("Switch discovery latency "+
534 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500535 main.log.info(str(graph_lat_1)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500536 #Break while loop
537 break
538 if cluster_count == 2:
539 if onos1_dev and onos2_dev:
540 main.log.info("All devices have been discovered"+
andrewonlaba036b402014-11-17 13:47:46 -0500541 " on all "+str(cluster_count)+
542 " ONOS instances")
andrewonlab5b8c02f2014-11-21 17:56:10 -0500543 time.sleep(5)
544
andrewonlab51b180b2014-11-12 18:19:28 -0500545 json_str_metrics_1 =\
546 main.ONOS1cli.topology_events_metrics()
547 json_str_metrics_2 =\
548 main.ONOS2cli.topology_events_metrics()
549 json_obj_1 = json.loads(json_str_metrics_1)
550 json_obj_2 = json.loads(json_str_metrics_2)
551 graph_timestamp_1 =\
552 json_obj_1[graphTimestamp]['value']
553 graph_timestamp_2 =\
554 json_obj_2[graphTimestamp]['value']
555
556 graph_lat_1 = \
557 int(graph_timestamp_1) - int(t0_system)
558 graph_lat_2 = \
559 int(graph_timestamp_2) - int(t0_system)
andrewonlabbdc3d862014-11-25 12:40:41 -0500560
561 main.log.info("Graph Timestamp ONOS1: "+
562 str(graph_timestamp_1))
563 main.log.info("Graph Timestamp ONOS2: "+
564 str(graph_timestamp_2))
andrewonlab51b180b2014-11-12 18:19:28 -0500565
andrewonlabbdc3d862014-11-25 12:40:41 -0500566 max_graph_lat = max(graph_lat_1,
567 graph_lat_2, graph_lat_3)
andrewonlab51b180b2014-11-12 18:19:28 -0500568
andrewonlabbdc3d862014-11-25 12:40:41 -0500569 if max_graph_lat > sw_disc_threshold_min\
570 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500571 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500572 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500573 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500574 main.log.info("Sw discovery latency of "+
575 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500576 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500577 else:
578 main.log.info("Switch discovery latency "+
579 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500580 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500581 break
582 if cluster_count == 3:
583 if onos1_dev and onos2_dev and onos3_dev:
584 main.log.info("All devices have been discovered"+
andrewonlaba036b402014-11-17 13:47:46 -0500585 " on all "+str(cluster_count)+
586 " ONOS instances")
587
588 #TODO: Investigate this sleep
589 # added to 'pad' the results with
590 # plenty of time to 'catch up'
andrewonlab62749022014-11-19 19:19:58 -0500591 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -0500592
andrewonlab51b180b2014-11-12 18:19:28 -0500593 json_str_metrics_1 =\
594 main.ONOS1cli.topology_events_metrics()
595 json_str_metrics_2 =\
596 main.ONOS2cli.topology_events_metrics()
597 json_str_metrics_3 =\
598 main.ONOS3cli.topology_events_metrics()
599 json_obj_1 = json.loads(json_str_metrics_1)
600 json_obj_2 = json.loads(json_str_metrics_2)
601 json_obj_3 = json.loads(json_str_metrics_3)
602 graph_timestamp_1 =\
603 json_obj_1[graphTimestamp]['value']
604 graph_timestamp_2 =\
605 json_obj_2[graphTimestamp]['value']
606 graph_timestamp_3 =\
607 json_obj_3[graphTimestamp]['value']
608
609 graph_lat_1 = \
610 int(graph_timestamp_1) - int(t0_system)
611 graph_lat_2 = \
612 int(graph_timestamp_2) - int(t0_system)
613 graph_lat_3 = \
614 int(graph_timestamp_3) - int(t0_system)
615
andrewonlabbdc3d862014-11-25 12:40:41 -0500616 main.log.info("Graph Timestamp ONOS1: "+
617 str(graph_timestamp_1))
618 main.log.info("Graph Timestamp ONOS2: "+
619 str(graph_timestamp_2))
620 main.log.info("Graph Timestamp ONOS3: "+
621 str(graph_timestamp_3))
andrewonlab62749022014-11-19 19:19:58 -0500622
andrewonlabbdc3d862014-11-25 12:40:41 -0500623 max_graph_lat = max(graph_lat_1,
624 graph_lat_2,
625 graph_lat_3)
626
627 if max_graph_lat > sw_disc_threshold_min\
628 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500629 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500630 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500631 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500632 main.log.info("Sw discovery latency of "+
633 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500634 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500635 else:
636 main.log.info("Switch discovery latency "+
637 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500638 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500639
640 break
641 if cluster_count == 4:
642 if onos1_dev and onos2_dev and onos3_dev and\
643 onos4_dev:
644 main.log.info("All devices have been discovered"+
645 " on all ONOS instances")
646 json_str_metrics_1 =\
647 main.ONOS1cli.topology_events_metrics()
648 json_str_metrics_2 =\
649 main.ONOS2cli.topology_events_metrics()
650 json_str_metrics_3 =\
651 main.ONOS3cli.topology_events_metrics()
652 json_str_metrics_4 =\
653 main.ONOS4cli.topology_events_metrics()
654 json_obj_1 = json.loads(json_str_metrics_1)
655 json_obj_2 = json.loads(json_str_metrics_2)
656 json_obj_3 = json.loads(json_str_metrics_3)
657 json_obj_4 = json.loads(json_str_metrics_4)
658 graph_timestamp_1 =\
659 json_obj_1[graphTimestamp]['value']
660 graph_timestamp_2 =\
661 json_obj_2[graphTimestamp]['value']
662 graph_timestamp_3 =\
663 json_obj_3[graphTimestamp]['value']
664 graph_timestamp_4 =\
665 json_obj_4[graphTimestamp]['value']
666
667 graph_lat_1 = \
668 int(graph_timestamp_1) - int(t0_system)
669 graph_lat_2 = \
670 int(graph_timestamp_2) - int(t0_system)
671 graph_lat_3 = \
672 int(graph_timestamp_3) - int(t0_system)
673 graph_lat_4 = \
674 int(graph_timestamp_4) - int(t0_system)
andrewonlab51b180b2014-11-12 18:19:28 -0500675
andrewonlabbdc3d862014-11-25 12:40:41 -0500676 main.log.info("Graph Timestamp ONOS1: "+
677 str(graph_timestamp_1))
678 main.log.info("Graph Timestamp ONOS2: "+
679 str(graph_timestamp_2))
680 main.log.info("Graph Timestamp ONOS3: "+
681 str(graph_timestamp_3))
682 main.log.info("Graph Timestamp ONOS4: "+
683 str(graph_timestamp_4))
684
685 max_graph_lat = max(graph_lat_1,
686 graph_lat_2,
687 graph_lat_3,
688 graph_lat_4)
689
690 if max_graph_lat > sw_disc_threshold_min\
691 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500692 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500693 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500694 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500695 main.log.info("Sw discovery latency of "+
696 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500697 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500698 else:
699 main.log.info("Switch discovery latency "+
700 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500701 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500702
703 break
704 if cluster_count == 5:
705 if onos1_dev and onos2_dev and onos3_dev and\
706 onos4_dev and onos5_dev:
707 main.log.info("All devices have been discovered"+
708 " on all ONOS instances")
andrewonlaba036b402014-11-17 13:47:46 -0500709
710 #TODO: Investigate this sleep
711 # added to 'pad' the results with
712 # plenty of time to 'catch up'
andrewonlab62749022014-11-19 19:19:58 -0500713 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -0500714
andrewonlab51b180b2014-11-12 18:19:28 -0500715 json_str_metrics_1 =\
716 main.ONOS1cli.topology_events_metrics()
717 json_str_metrics_2 =\
718 main.ONOS2cli.topology_events_metrics()
719 json_str_metrics_3 =\
720 main.ONOS3cli.topology_events_metrics()
721 json_str_metrics_4 =\
722 main.ONOS4cli.topology_events_metrics()
723 json_str_metrics_5 =\
724 main.ONOS5cli.topology_events_metrics()
725 json_obj_1 = json.loads(json_str_metrics_1)
726 json_obj_2 = json.loads(json_str_metrics_2)
727 json_obj_3 = json.loads(json_str_metrics_3)
728 json_obj_4 = json.loads(json_str_metrics_4)
729 json_obj_5 = json.loads(json_str_metrics_5)
730 graph_timestamp_1 =\
731 json_obj_1[graphTimestamp]['value']
732 graph_timestamp_2 =\
733 json_obj_2[graphTimestamp]['value']
734 graph_timestamp_3 =\
735 json_obj_3[graphTimestamp]['value']
736 graph_timestamp_4 =\
737 json_obj_4[graphTimestamp]['value']
738 graph_timestamp_5 =\
739 json_obj_5[graphTimestamp]['value']
740
741 graph_lat_1 = \
742 int(graph_timestamp_1) - int(t0_system)
743 graph_lat_2 = \
744 int(graph_timestamp_2) - int(t0_system)
745 graph_lat_3 = \
746 int(graph_timestamp_3) - int(t0_system)
747 graph_lat_4 = \
748 int(graph_timestamp_4) - int(t0_system)
749 graph_lat_5 = \
750 int(graph_timestamp_5) - int(t0_system)
andrewonlab51b180b2014-11-12 18:19:28 -0500751
andrewonlabbdc3d862014-11-25 12:40:41 -0500752 main.log.info("Graph Timestamp ONOS1: "+
753 str(graph_timestamp_1))
754 main.log.info("Graph Timestamp ONOS2: "+
755 str(graph_timestamp_2))
756 main.log.info("Graph Timestamp ONOS3: "+
757 str(graph_timestamp_3))
758 main.log.info("Graph Timestamp ONOS4: "+
759 str(graph_timestamp_4))
760 main.log.info("Graph Timestamp ONOS5: "+
761 str(graph_timestamp_5))
762
763 max_graph_lat = max(graph_lat_1,
764 graph_lat_2,
765 graph_lat_3,
766 graph_lat_4,
767 graph_lat_5)
768
769 if max_graph_lat > sw_disc_threshold_min\
770 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500771 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500772 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500773 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500774 main.log.info("Sw discovery latency of "+
775 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500776 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500777 else:
778 main.log.info("Switch discovery latency "+
779 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500780 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500781
782 break
783 if cluster_count == 6:
784 if onos1_dev and onos2_dev and onos3_dev and\
785 onos4_dev and onos5_dev and onos6_dev:
786 main.log.info("All devices have been discovered"+
787 " on all ONOS instances")
788 json_str_metrics_1 =\
789 main.ONOS1cli.topology_events_metrics()
790 json_str_metrics_2 =\
791 main.ONOS2cli.topology_events_metrics()
792 json_str_metrics_3 =\
793 main.ONOS3cli.topology_events_metrics()
794 json_str_metrics_4 =\
795 main.ONOS4cli.topology_events_metrics()
796 json_str_metrics_5 =\
797 main.ONOS5cli.topology_events_metrics()
798 json_str_metrics_6 =\
799 main.ONOS6cli.topology_events_metrics()
800 json_obj_1 = json.loads(json_str_metrics_1)
801 json_obj_2 = json.loads(json_str_metrics_2)
802 json_obj_3 = json.loads(json_str_metrics_3)
803 json_obj_4 = json.loads(json_str_metrics_4)
804 json_obj_5 = json.loads(json_str_metrics_5)
805 json_obj_6 = json.loads(json_str_metrics_6)
806 graph_timestamp_1 =\
807 json_obj_1[graphTimestamp]['value']
808 graph_timestamp_2 =\
809 json_obj_2[graphTimestamp]['value']
810 graph_timestamp_3 =\
811 json_obj_3[graphTimestamp]['value']
812 graph_timestamp_4 =\
813 json_obj_4[graphTimestamp]['value']
814 graph_timestamp_5 =\
815 json_obj_5[graphTimestamp]['value']
816 graph_timestamp_6 =\
817 json_obj_6[graphTimestamp]['value']
818
819 graph_lat_1 = \
820 int(graph_timestamp_1) - int(t0_system)
821 graph_lat_2 = \
822 int(graph_timestamp_2) - int(t0_system)
823 graph_lat_3 = \
824 int(graph_timestamp_3) - int(t0_system)
825 graph_lat_4 = \
826 int(graph_timestamp_4) - int(t0_system)
827 graph_lat_5 = \
828 int(graph_timestamp_5) - int(t0_system)
829 graph_lat_6 = \
830 int(graph_timestamp_6) - int(t0_system)
andrewonlab51b180b2014-11-12 18:19:28 -0500831
andrewonlabbdc3d862014-11-25 12:40:41 -0500832 main.log.info("Graph Timestamp ONOS1: "+
833 str(graph_timestamp_1))
834 main.log.info("Graph Timestamp ONOS2: "+
835 str(graph_timestamp_2))
836 main.log.info("Graph Timestamp ONOS3: "+
837 str(graph_timestamp_3))
838 main.log.info("Graph Timestamp ONOS4: "+
839 str(graph_timestamp_4))
840 main.log.info("Graph Timestamp ONOS5: "+
841 str(graph_timestamp_5))
842 main.log.info("Graph Timestamp ONOS6: "+
843 str(graph_timestamp_6))
844
845 max_graph_lat = max(graph_lat_1,
846 graph_lat_2,
847 graph_lat_3,
848 graph_lat_4,
849 graph_lat_5,
850 graph_lat_6)
851
852 if max_graph_lat > sw_disc_threshold_min\
853 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500854 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500855 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500856 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500857 main.log.info("Sw discovery latency of "+
858 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500859 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500860 else:
861 main.log.info("Switch discovery latency "+
862 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500863 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500864
865 break
866 if cluster_count == 7:
867 if onos1_dev and onos2_dev and onos3_dev and\
868 onos4_dev and onos5_dev and onos6_dev and\
869 onos7_dev:
870 main.log.info("All devices have been discovered"+
871 " on all ONOS instances")
andrewonlaba036b402014-11-17 13:47:46 -0500872
873 #TODO: Investigate this sleep
874 # added to 'pad' the results with
875 # plenty of time to 'catch up'
andrewonlab62749022014-11-19 19:19:58 -0500876 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -0500877
andrewonlab51b180b2014-11-12 18:19:28 -0500878 json_str_metrics_1 =\
879 main.ONOS1cli.topology_events_metrics()
880 json_str_metrics_2 =\
881 main.ONOS2cli.topology_events_metrics()
882 json_str_metrics_3 =\
883 main.ONOS3cli.topology_events_metrics()
884 json_str_metrics_4 =\
885 main.ONOS4cli.topology_events_metrics()
886 json_str_metrics_5 =\
887 main.ONOS5cli.topology_events_metrics()
888 json_str_metrics_6 =\
889 main.ONOS6cli.topology_events_metrics()
890 json_str_metrics_7 =\
891 main.ONOS7cli.topology_events_metrics()
892 json_obj_1 = json.loads(json_str_metrics_1)
893 json_obj_2 = json.loads(json_str_metrics_2)
894 json_obj_3 = json.loads(json_str_metrics_3)
895 json_obj_4 = json.loads(json_str_metrics_4)
896 json_obj_5 = json.loads(json_str_metrics_5)
897 json_obj_6 = json.loads(json_str_metrics_6)
898 json_obj_7 = json.loads(json_str_metrics_7)
899 graph_timestamp_1 =\
900 json_obj_1[graphTimestamp]['value']
901 graph_timestamp_2 =\
902 json_obj_2[graphTimestamp]['value']
903 graph_timestamp_3 =\
904 json_obj_3[graphTimestamp]['value']
905 graph_timestamp_4 =\
906 json_obj_4[graphTimestamp]['value']
907 graph_timestamp_5 =\
908 json_obj_5[graphTimestamp]['value']
909 graph_timestamp_6 =\
910 json_obj_6[graphTimestamp]['value']
911 graph_timestamp_7 =\
912 json_obj_7[graphTimestamp]['value']
913
914 graph_lat_1 = \
915 int(graph_timestamp_1) - int(t0_system)
916 graph_lat_2 = \
917 int(graph_timestamp_2) - int(t0_system)
918 graph_lat_3 = \
919 int(graph_timestamp_3) - int(t0_system)
920 graph_lat_4 = \
921 int(graph_timestamp_4) - int(t0_system)
922 graph_lat_5 = \
923 int(graph_timestamp_5) - int(t0_system)
924 graph_lat_6 = \
925 int(graph_timestamp_6) - int(t0_system)
926 graph_lat_7 = \
927 int(graph_timestamp_7) - int(t0_system)
928
andrewonlabbdc3d862014-11-25 12:40:41 -0500929 main.log.info("Graph Timestamp ONOS1: "+
930 str(graph_timestamp_1))
931 main.log.info("Graph Timestamp ONOS2: "+
932 str(graph_timestamp_2))
933 main.log.info("Graph Timestamp ONOS3: "+
934 str(graph_timestamp_3))
935 main.log.info("Graph Timestamp ONOS4: "+
936 str(graph_timestamp_4))
937 main.log.info("Graph Timestamp ONOS5: "+
938 str(graph_timestamp_5))
939 main.log.info("Graph Timestamp ONOS6: "+
940 str(graph_timestamp_6))
941 main.log.info("Graph Timestamp ONOS7: "+
942 str(graph_timestamp_7))
943
944 max_graph_lat = max(graph_lat_1,
945 graph_lat_2,
946 graph_lat_3,
947 graph_lat_4,
948 graph_lat_5,
949 graph_lat_6,
950 graph_lat_7)
andrewonlab51b180b2014-11-12 18:19:28 -0500951
andrewonlabbdc3d862014-11-25 12:40:41 -0500952 if max_graph_lat > sw_disc_threshold_min\
953 and max_graph_lat < sw_disc_threshold_max\
andrewonlab0e1825c2014-11-20 20:07:00 -0500954 and int(i) > iter_ignore:
andrewonlab51b180b2014-11-12 18:19:28 -0500955 sw_discovery_lat_list.append(
andrewonlabbdc3d862014-11-25 12:40:41 -0500956 max_graph_lat)
andrewonlabfd8325f2014-11-12 19:14:06 -0500957 main.log.info("Sw discovery latency of "+
958 str(cluster_count)+" node(s): "+
andrewonlabbdc3d862014-11-25 12:40:41 -0500959 str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500960 else:
961 main.log.info("Switch discovery latency "+
962 "exceeded the threshold.")
andrewonlab28b84eb2014-12-02 15:53:35 -0500963 main.log.info(str(max_graph_lat)+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -0500964
965 break
966
967 counter_loop += 1
968 time.sleep(3)
969 #END WHILE LOOP
andrewonlabf50ad012014-11-25 15:48:37 -0500970
971 #Below is used for reporting SYN / ACK timing
972 #of all switches
andrewonlaba036b402014-11-17 13:47:46 -0500973 main.ONOS1.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -0500974 syn_ack_timestamp_list = []
andrewonlabbdc3d862014-11-25 12:40:41 -0500975 if cluster_count < 3:
976 #TODO: capture synack on nodes less than 3
977 syn_ack_timestamp_list.append(0)
andrewonlaba036b402014-11-17 13:47:46 -0500978
979 if cluster_count >= 3:
980 main.ONOS2.tshark_stop()
981 main.ONOS3.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -0500982 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -0500983 os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -0500984 "/tmp/syn_ack_onos1_iter"+str(i)+".txt /tmp/")
andrewonlaba036b402014-11-17 13:47:46 -0500985 os.system("scp "+ONOS_user+"@"+ONOS2_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -0500986 "/tmp/syn_ack_onos2_iter"+str(i)+".txt /tmp/")
andrewonlaba036b402014-11-17 13:47:46 -0500987 os.system("scp "+ONOS_user+"@"+ONOS3_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -0500988 "/tmp/syn_ack_onos3_iter"+str(i)+".txt /tmp/")
989 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -0500990 #Read each of the files and append all
991 #SYN / ACK timestamps to the list
andrewonlaba1272172014-11-17 17:30:35 -0500992 with open("/tmp/syn_ack_onos1_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -0500993 f_onos1:
994 for line in f_onos1:
995 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -0500996 try:
997 float(line[1])
998 syn_ack_timestamp_list.append(line[1])
999 except ValueError:
1000 main.log.info("String cannot be converted")
andrewonlaba1272172014-11-17 17:30:35 -05001001 with open("/tmp/syn_ack_onos2_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001002 f_onos2:
1003 for line in f_onos2:
1004 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001005 try:
1006 float(line[1])
1007 syn_ack_timestamp_list.append(line[1])
1008 except ValueError:
1009 main.log.info("String cannot be converted")
andrewonlaba1272172014-11-17 17:30:35 -05001010 with open("/tmp/syn_ack_onos3_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001011 f_onos3:
1012 for line in f_onos3:
1013 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001014 try:
1015 float(line[1])
1016 syn_ack_timestamp_list.append(line[1])
1017 except ValueError:
1018 main.log.info("String cannot be converted")
andrewonlaba036b402014-11-17 13:47:46 -05001019 if cluster_count >= 4:
1020 main.ONOS4.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -05001021 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -05001022 os.system("scp "+ONOS_user+"@"+ONOS4_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -05001023 "/tmp/syn_ack_onos4_iter"+str(i)+".txt /tmp/")
1024 time.sleep(5)
1025 with open("/tmp/syn_ack_onos4_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001026 f_onos4:
1027 for line in f_onos4:
1028 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001029 try:
1030 float(line[1])
1031 syn_ack_timestamp_list.append(line[1])
1032 except ValueError:
1033 main.log.info("String cannot be converted")
andrewonlaba036b402014-11-17 13:47:46 -05001034 if cluster_count >= 5:
1035 main.ONOS5.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -05001036 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -05001037 os.system("scp "+ONOS_user+"@"+ONOS5_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -05001038 "/tmp/syn_ack_onos5_iter"+str(i)+".txt /tmp/")
1039 time.sleep(5)
1040 with open("/tmp/syn_ack_onos5_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001041 f_onos5:
1042 for line in f_onos5:
1043 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001044 try:
1045 float(line[1])
1046 syn_ack_timestamp_list.append(line[1])
1047 except ValueError:
1048 main.log.info("String cannot be converted")
andrewonlaba036b402014-11-17 13:47:46 -05001049 if cluster_count >= 6:
1050 main.ONOS6.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -05001051 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -05001052 os.system("scp "+ONOS_user+"@"+ONOS6_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -05001053 "/tmp/syn_ack_onos6_iter"+str(i)+".txt /tmp/")
1054 time.sleep(5)
1055 with open("/tmp/syn_ack_onos6_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001056 f_onos6:
1057 for line in f_onos6:
1058 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001059 try:
1060 float(line[1])
1061 syn_ack_timestamp_list.append(line[1])
1062 except ValueError:
1063 main.log.info("String cannot be converted")
andrewonlaba036b402014-11-17 13:47:46 -05001064 if cluster_count == 7:
1065 main.ONOS7.tshark_stop()
andrewonlaba1272172014-11-17 17:30:35 -05001066 time.sleep(5)
andrewonlaba036b402014-11-17 13:47:46 -05001067 os.system("scp "+ONOS_user+"@"+ONOS7_ip+":"+
andrewonlaba1272172014-11-17 17:30:35 -05001068 "/tmp/syn_ack_onos7_iter"+str(i)+".txt /tmp/")
1069 time.sleep(5)
1070 with open("/tmp/syn_ack_onos7_iter"+str(i)+".txt") as\
andrewonlaba036b402014-11-17 13:47:46 -05001071 f_onos7:
1072 for line in f_onos7:
1073 line = line.split(" ")
andrewonlabf50ad012014-11-25 15:48:37 -05001074 try:
1075 float(line[1])
1076 syn_ack_timestamp_list.append(line[1])
1077 except ValueError:
1078 main.log.info("String cannot be converted")
andrewonlaba036b402014-11-17 13:47:46 -05001079
1080 #Sort the list by timestamp
1081 syn_ack_timestamp_list = sorted(syn_ack_timestamp_list)
andrewonlabbdc3d862014-11-25 12:40:41 -05001082 print "syn_ack_-1 " + str(syn_ack_timestamp_list)
1083
andrewonlaba1272172014-11-17 17:30:35 -05001084 syn_ack_delta =\
1085 int(float(syn_ack_timestamp_list[-1])*1000) -\
1086 int(float(syn_ack_timestamp_list[0])*1000)
andrewonlaba036b402014-11-17 13:47:46 -05001087
andrewonlaba1272172014-11-17 17:30:35 -05001088 main.log.info("Switch connection attempt delta iteration "+
1089 str(i)+": "+str(syn_ack_delta))
1090 syn_ack_delta_list.append(syn_ack_delta)
andrewonlab51b180b2014-11-12 18:19:28 -05001091 #END ITERATION LOOP
1092 #REPORT HERE
1093
1094 if len(sw_discovery_lat_list) > 0:
1095 sw_lat_avg = sum(sw_discovery_lat_list) / \
1096 len(sw_discovery_lat_list)
andrewonlabfd8325f2014-11-12 19:14:06 -05001097 sw_lat_dev = numpy.std(sw_discovery_lat_list)
andrewonlab28b84eb2014-12-02 15:53:35 -05001098 else:
1099 sw_lat_avg = 0
1100 sw_lat_dev = 0
andrewonlab51b180b2014-11-12 18:19:28 -05001101 assertion = main.FALSE
andrewonlaba1272172014-11-17 17:30:35 -05001102
1103 main.log.report("Switch connection attempt time avg "+
andrewonlabd784d4f2014-11-17 17:47:32 -05001104 "(last sw SYN/ACK time - first sw SYN/ACK time) "+
andrewonlaba1272172014-11-17 17:30:35 -05001105 str(sum(syn_ack_delta_list)/len(syn_ack_delta_list)) +
1106 " ms")
andrewonlab0e1825c2014-11-20 20:07:00 -05001107 main.log.report(str(num_sw)+" Switch discovery lat for "+\
1108 str(cluster_count)+" instance(s): ")
1109 main.log.report("Avg: "+str(sw_lat_avg)+" ms "+
1110 "Std Deviation: "+str(round(sw_lat_dev,1))+" ms")
andrewonlab51b180b2014-11-12 18:19:28 -05001111
1112 utilities.assert_equals(expect=main.TRUE, actual=assertion,
1113 onpass="Switch discovery convergence latency" +\
andrewonlabfd8325f2014-11-12 19:14:06 -05001114 " for "+str(cluster_count)+" nodes successful",
andrewonlab51b180b2014-11-12 18:19:28 -05001115 onfail="Switch discovery convergence latency" +\
1116 " test failed")
1117
andrewonlabadd2fd62014-11-11 18:37:35 -05001118 def CASE3(self, main):
1119 '''
andrewonlab54cec4b2014-11-12 13:30:23 -05001120 Increase number of nodes and initiate CLI
andrewonlabadd2fd62014-11-11 18:37:35 -05001121 '''
1122 import time
1123 import subprocess
1124 import os
1125 import requests
1126 import json
1127
andrewonlab0cfc7ad2014-11-13 16:29:26 -05001128 ONOS1_ip = main.params['CTRL']['ip1']
1129 ONOS2_ip = main.params['CTRL']['ip2']
1130 ONOS3_ip = main.params['CTRL']['ip3']
1131 ONOS4_ip = main.params['CTRL']['ip4']
1132 ONOS5_ip = main.params['CTRL']['ip5']
1133 ONOS6_ip = main.params['CTRL']['ip6']
1134 ONOS7_ip = main.params['CTRL']['ip7']
1135
1136 cell_name = main.params['ENV']['cellName']
1137
andrewonlabadd2fd62014-11-11 18:37:35 -05001138 MN1_ip = main.params['MN']['ip1']
1139 BENCH_ip = main.params['BENCH']['ip']
andrewonlab0cfc7ad2014-11-13 16:29:26 -05001140
andrewonlaba036b402014-11-17 13:47:46 -05001141 #NOTE:We start with cluster_count at 3. The first
andrewonlabadd2fd62014-11-11 18:37:35 -05001142 #case already initialized ONOS1. Increase the
andrewonlaba036b402014-11-17 13:47:46 -05001143 #cluster count and start from 3.
andrewonlabadd2fd62014-11-11 18:37:35 -05001144 #You can optionally change the increment to
andrewonlaba036b402014-11-17 13:47:46 -05001145 #test steps of node sizes, such as 3,5,7
andrewonlab0e1825c2014-11-20 20:07:00 -05001146
andrewonlabadd2fd62014-11-11 18:37:35 -05001147 global cluster_count
andrewonlab54cec4b2014-11-12 13:30:23 -05001148 cluster_count += 2
andrewonlab0e1825c2014-11-20 20:07:00 -05001149 main.log.report("Increasing cluster size to "+
1150 str(cluster_count))
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001151
andrewonlaba036b402014-11-17 13:47:46 -05001152 install_result = main.FALSE
andrewonlabadd2fd62014-11-11 18:37:35 -05001153 #Supports up to 7 node configuration
andrewonlab81763ee2014-11-13 17:31:34 -05001154 #TODO: Cleanup this ridiculous repetitive code
andrewonlab5b8c02f2014-11-21 17:56:10 -05001155 if cluster_count == 3:
1156 install_result = \
andrewonlabbdc3d862014-11-25 12:40:41 -05001157 main.ONOSbench.onos_install(node=ONOS2_ip)
1158 install_result = \
andrewonlab5b8c02f2014-11-21 17:56:10 -05001159 main.ONOSbench.onos_install(node=ONOS3_ip)
1160 time.sleep(5)
1161 main.log.info("Starting CLI")
andrewonlabbdc3d862014-11-25 12:40:41 -05001162 main.ONOS2cli.start_onos_cli(ONOS2_ip)
andrewonlab5b8c02f2014-11-21 17:56:10 -05001163 main.ONOS3cli.start_onos_cli(ONOS3_ip)
andrewonlabbdc3d862014-11-25 12:40:41 -05001164 main.ONOS1cli.add_node(ONOS2_ip, ONOS2_ip)
andrewonlab5b8c02f2014-11-21 17:56:10 -05001165 main.ONOS1cli.add_node(ONOS3_ip, ONOS3_ip)
1166
andrewonlaba036b402014-11-17 13:47:46 -05001167 if cluster_count == 4:
1168 main.log.info("Installing ONOS on node 4")
1169 install_result = \
1170 main.ONOSbench.onos_install(node=ONOS4_ip)
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001171 time.sleep(5)
andrewonlab81763ee2014-11-13 17:31:34 -05001172 main.log.info("Starting CLI")
andrewonlab81763ee2014-11-13 17:31:34 -05001173 main.ONOS4cli.start_onos_cli(ONOS4_ip)
andrewonlaba036b402014-11-17 13:47:46 -05001174 main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip)
1175
andrewonlab81763ee2014-11-13 17:31:34 -05001176 elif cluster_count == 5:
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001177 main.log.info("Installing ONOS on nodes 4 and 5")
andrewonlaba036b402014-11-17 13:47:46 -05001178 install_result2 = \
andrewonlabbdc3d862014-11-25 12:40:41 -05001179 main.ONOSbench.onos_install(options="",node=ONOS4_ip)
andrewonlab5b8c02f2014-11-21 17:56:10 -05001180 install_result3 = \
andrewonlabbdc3d862014-11-25 12:40:41 -05001181 main.ONOSbench.onos_install(options="",node=ONOS5_ip)
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001182 time.sleep(5)
andrewonlab81763ee2014-11-13 17:31:34 -05001183 main.log.info("Starting CLI")
andrewonlab81763ee2014-11-13 17:31:34 -05001184 main.ONOS4cli.start_onos_cli(ONOS4_ip)
1185 main.ONOS5cli.start_onos_cli(ONOS5_ip)
andrewonlaba036b402014-11-17 13:47:46 -05001186 main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip)
1187 main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip)
andrewonlabbdc3d862014-11-25 12:40:41 -05001188 install_result = install_result2 and install_result3
andrewonlaba036b402014-11-17 13:47:46 -05001189
andrewonlab81763ee2014-11-13 17:31:34 -05001190 elif cluster_count == 6:
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001191 main.log.info("Installing ONOS on nodes 4, 5,and 6")
andrewonlaba036b402014-11-17 13:47:46 -05001192 install_result1 = \
1193 main.ONOSbench.onos_install(options="",node=ONOS4_ip)
1194 install_result2 = \
1195 main.ONOSbench.onos_install(options="",node=ONOS5_ip)
1196 install_result3 = \
1197 main.ONOSbench.onos_install(node=ONOS6_ip)
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001198 time.sleep(5)
andrewonlab81763ee2014-11-13 17:31:34 -05001199 main.log.info("Starting CLI")
andrewonlab81763ee2014-11-13 17:31:34 -05001200 main.ONOS4cli.start_onos_cli(ONOS4_ip)
1201 main.ONOS5cli.start_onos_cli(ONOS5_ip)
1202 main.ONOS6cli.start_onos_cli(ONOS6_ip)
andrewonlaba036b402014-11-17 13:47:46 -05001203 main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip)
1204 main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip)
1205 main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip)
1206 install_result = install_result1 and install_result2 and\
1207 install_result3
1208
andrewonlab81763ee2014-11-13 17:31:34 -05001209 elif cluster_count == 7:
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001210 main.log.info("Installing ONOS on nodes 4, 5, 6,and 7")
andrewonlaba036b402014-11-17 13:47:46 -05001211 install_result3 = \
andrewonlabbdc3d862014-11-25 12:40:41 -05001212 main.ONOSbench.onos_install(node=ONOS6_ip)
andrewonlaba036b402014-11-17 13:47:46 -05001213 install_result4 = \
1214 main.ONOSbench.onos_install(node=ONOS7_ip)
andrewonlab81763ee2014-11-13 17:31:34 -05001215 main.log.info("Starting CLI")
andrewonlab81763ee2014-11-13 17:31:34 -05001216 main.ONOS4cli.start_onos_cli(ONOS4_ip)
1217 main.ONOS5cli.start_onos_cli(ONOS5_ip)
1218 main.ONOS6cli.start_onos_cli(ONOS6_ip)
1219 main.ONOS7cli.start_onos_cli(ONOS7_ip)
andrewonlaba036b402014-11-17 13:47:46 -05001220 main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip)
1221 main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip)
1222 main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip)
1223 main.ONOS1cli.add_node(ONOS7_ip, ONOS7_ip)
andrewonlab81763ee2014-11-13 17:31:34 -05001224
andrewonlabbdc3d862014-11-25 12:40:41 -05001225 install_result = \
andrewonlaba036b402014-11-17 13:47:46 -05001226 install_result3 and install_result4
andrewonlab81763ee2014-11-13 17:31:34 -05001227
1228 time.sleep(5)
andrewonlabadd2fd62014-11-11 18:37:35 -05001229
andrewonlab0cfc7ad2014-11-13 16:29:26 -05001230 if install_result == main.TRUE:
1231 assertion = main.TRUE
1232 else:
1233 assertion = main.FALSE
1234
1235 utilities.assert_equals(expect=main.TRUE, actual=assertion,
1236 onpass="Scale out to "+str(cluster_count)+\
1237 " nodes successful",
1238 onfail="Scale out to "+str(cluster_count)+\
1239 " nodes failed")
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001240
1241
1242 def CASE4(self, main):
1243 '''
1244 Cleanup ONOS nodes and Increase topology size
1245 '''
andrewonlab0e1825c2014-11-20 20:07:00 -05001246 #TODO: use meaningful assertion
1247 assertion=main.TRUE
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001248
1249 ONOS1_ip = main.params['CTRL']['ip1']
1250 ONOS2_ip = main.params['CTRL']['ip2']
1251 ONOS3_ip = main.params['CTRL']['ip3']
1252 ONOS4_ip = main.params['CTRL']['ip4']
1253 ONOS5_ip = main.params['CTRL']['ip5']
1254 ONOS6_ip = main.params['CTRL']['ip6']
1255 ONOS7_ip = main.params['CTRL']['ip7']
1256 MN1_ip = main.params['MN']['ip1']
1257 BENCH_ip = main.params['BENCH']['ip']
1258
1259 main.log.info("Uninstalling previous instances")
andrewonlab5b8c02f2014-11-21 17:56:10 -05001260 main.ONOSbench.onos_uninstall(node_ip = ONOS2_ip)
1261 main.ONOSbench.onos_uninstall(node_ip = ONOS3_ip)
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001262 main.ONOSbench.onos_uninstall(node_ip = ONOS4_ip)
1263 main.ONOSbench.onos_uninstall(node_ip = ONOS5_ip)
1264 main.ONOSbench.onos_uninstall(node_ip = ONOS6_ip)
1265 main.ONOSbench.onos_uninstall(node_ip = ONOS7_ip)
1266
1267 global topo_iteration
1268 global cluster_count
andrewonlabf50ad012014-11-25 15:48:37 -05001269 cluster_count = 1
andrewonlab7b4e8ba2014-11-20 17:45:04 -05001270 topo_iteration += 1
1271
andrewonlab0e1825c2014-11-20 20:07:00 -05001272 main.log.report("Increasing topology size")
1273 utilities.assert_equals(expect=main.TRUE, actual=assertion,
1274 onpass="Topology size increased successfully",
1275 onfail="Topology size was not increased")
andrewonlab28b84eb2014-12-02 15:53:35 -05001276
1277
1278