andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1 | #TopoPerfNext |
| 2 | # |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 3 | #Topology Convergence scale-out test for ONOS-next |
| 4 | #NOTE: This test supports up to 7 nodes scale-out scenario |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 5 | # |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 6 | #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 | # |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 10 | #andrew@onlab.us |
| 11 | |
| 12 | import time |
| 13 | import sys |
| 14 | import os |
| 15 | import re |
| 16 | |
| 17 | class TopoConvNext: |
| 18 | def __init__(self): |
| 19 | self.default = '' |
| 20 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 21 | def CASE1(self, main): |
| 22 | ''' |
| 23 | ONOS startup sequence |
| 24 | ''' |
| 25 | import time |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 26 | |
| 27 | #****** |
| 28 | #Global cluster count for scale-out purposes |
| 29 | global cluster_count |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 30 | cluster_count = 3 |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 31 | #****** |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 32 | cell_name = main.params['ENV']['cellName'] |
| 33 | |
| 34 | git_pull = main.params['GIT']['autoPull'] |
| 35 | checkout_branch = main.params['GIT']['checkout'] |
| 36 | |
| 37 | ONOS1_ip = main.params['CTRL']['ip1'] |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 38 | ONOS2_ip = main.params['CTRL']['ip2'] |
| 39 | ONOS3_ip = main.params['CTRL']['ip3'] |
| 40 | ONOS4_ip = main.params['CTRL']['ip4'] |
| 41 | ONOS5_ip = main.params['CTRL']['ip5'] |
| 42 | ONOS6_ip = main.params['CTRL']['ip6'] |
| 43 | ONOS7_ip = main.params['CTRL']['ip7'] |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 44 | MN1_ip = main.params['MN']['ip1'] |
| 45 | BENCH_ip = main.params['BENCH']['ip'] |
| 46 | |
| 47 | main.case("Setting up test environment") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 48 | main.log.info("Uninstalling previous instances") |
| 49 | main.ONOSbench.onos_uninstall(node_ip = ONOS1_ip) |
| 50 | main.ONOSbench.onos_uninstall(node_ip = ONOS2_ip) |
| 51 | main.ONOSbench.onos_uninstall(node_ip = ONOS3_ip) |
| 52 | main.ONOSbench.onos_uninstall(node_ip = ONOS4_ip) |
| 53 | main.ONOSbench.onos_uninstall(node_ip = ONOS5_ip) |
| 54 | main.ONOSbench.onos_uninstall(node_ip = ONOS6_ip) |
| 55 | main.ONOSbench.onos_uninstall(node_ip = ONOS7_ip) |
| 56 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 57 | main.log.report("Setting up test environment") |
| 58 | |
| 59 | main.step("Creating cell file") |
| 60 | cell_file_result = main.ONOSbench.create_cell_file( |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 61 | BENCH_ip, cell_name, MN1_ip, |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 62 | "onos-core,onos-app-metrics", |
| 63 | ONOS1_ip, ONOS2_ip, ONOS3_ip) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 64 | |
| 65 | main.step("Applying cell file to environment") |
| 66 | cell_apply_result = main.ONOSbench.set_cell(cell_name) |
| 67 | verify_cell_result = main.ONOSbench.verify_cell() |
| 68 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 69 | main.case("Removing raft logs") |
| 70 | main.ONOSbench.onos_remove_raft_logs() |
| 71 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 72 | main.step("Git checkout and pull "+checkout_branch) |
| 73 | if git_pull == 'on': |
| 74 | checkout_result = \ |
| 75 | main.ONOSbench.git_checkout(checkout_branch) |
| 76 | pull_result = main.ONOSbench.git_pull() |
| 77 | else: |
| 78 | checkout_result = main.TRUE |
| 79 | pull_result = main.TRUE |
| 80 | main.log.info("Skipped git checkout and pull") |
| 81 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 82 | main.log.report("Commit information - ") |
| 83 | main.ONOSbench.get_version() |
| 84 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 85 | main.step("Using mvn clean & install") |
| 86 | #mvn_result = main.ONOSbench.clean_install() |
| 87 | mvn_result = main.TRUE |
| 88 | |
| 89 | main.step("Set cell for ONOS cli env") |
| 90 | main.ONOS1cli.set_cell(cell_name) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 91 | main.ONOS2cli.set_cell(cell_name) |
| 92 | main.ONOS3cli.set_cell(cell_name) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 93 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 94 | main.step("Creating ONOS package") |
| 95 | package_result = main.ONOSbench.onos_package() |
| 96 | |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 97 | #Start test with single node only |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 98 | main.step("Installing ONOS package") |
| 99 | install1_result = main.ONOSbench.onos_install(node=ONOS1_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 100 | install2_result = main.ONOSbench.onos_install(node=ONOS2_ip) |
| 101 | install3_result = main.ONOSbench.onos_install(node=ONOS3_ip) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 102 | |
| 103 | time.sleep(10) |
| 104 | |
| 105 | main.step("Start onos cli") |
| 106 | cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 107 | cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip) |
| 108 | cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 109 | |
| 110 | main.step("Enable metrics feature") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 111 | #main.ONOS1cli.feature_install("onos-app-metrics") |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 112 | |
| 113 | utilities.assert_equals(expect=main.TRUE, |
| 114 | actual= cell_file_result and cell_apply_result and\ |
| 115 | verify_cell_result and checkout_result and\ |
| 116 | pull_result and mvn_result and\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 117 | install1_result and install2_result and\ |
| 118 | install3_result, |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 119 | onpass="Test Environment setup successful", |
| 120 | onfail="Failed to setup test environment") |
| 121 | |
| 122 | def CASE2(self, main): |
| 123 | ''' |
| 124 | 100 Switch discovery latency |
| 125 | |
| 126 | Important: |
| 127 | This test case can be potentially dangerous if |
| 128 | your machine has previously set iptables rules. |
| 129 | One of the steps of the test case will flush |
| 130 | all existing iptables rules. |
| 131 | Note: |
| 132 | You can specify the number of switches in the |
| 133 | params file to adjust the switch discovery size |
| 134 | (and specify the corresponding topology in Mininet1 |
| 135 | .topo file) |
| 136 | ''' |
| 137 | import time |
| 138 | import subprocess |
| 139 | import os |
| 140 | import requests |
| 141 | import json |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 142 | import numpy |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 143 | |
| 144 | ONOS_ip_list = [] |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 145 | ONOS_ip_list.append('0') |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 146 | ONOS_ip_list.append(main.params['CTRL']['ip1']) |
| 147 | ONOS_ip_list.append(main.params['CTRL']['ip2']) |
| 148 | ONOS_ip_list.append(main.params['CTRL']['ip3']) |
| 149 | ONOS_ip_list.append(main.params['CTRL']['ip4']) |
| 150 | ONOS_ip_list.append(main.params['CTRL']['ip5']) |
| 151 | ONOS_ip_list.append(main.params['CTRL']['ip6']) |
| 152 | ONOS_ip_list.append(main.params['CTRL']['ip7']) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 153 | MN1_ip = main.params['MN']['ip1'] |
| 154 | ONOS_user = main.params['CTRL']['user'] |
| 155 | |
| 156 | default_sw_port = main.params['CTRL']['port1'] |
| 157 | |
| 158 | #Number of iterations of case |
| 159 | num_iter = main.params['TEST']['numIter'] |
| 160 | num_sw = main.params['TEST']['numSwitch'] |
| 161 | |
| 162 | #Timestamp 'keys' for json metrics output. |
| 163 | #These are subject to change, hence moved into params |
| 164 | deviceTimestamp = main.params['JSON']['deviceTimestamp'] |
| 165 | graphTimestamp = main.params['JSON']['graphTimestamp'] |
| 166 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 167 | #Threshold for this test case |
| 168 | sw_disc_threshold_str = main.params['TEST']['swDisc100Threshold'] |
| 169 | sw_disc_threshold_obj = sw_disc_threshold_str.split(",") |
| 170 | sw_disc_threshold_min = int(sw_disc_threshold_obj[0]) |
| 171 | sw_disc_threshold_max = int(sw_disc_threshold_obj[1]) |
| 172 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 173 | assertion = main.TRUE |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 174 | sw_discovery_lat_list = [] |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 175 | syn_ack_delta_list = [] |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 176 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 177 | main.case(str(num_sw)+" switch per "+str(cluster_count)+ |
| 178 | " nodes convergence latency") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 179 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 180 | main.log.report("Large topology convergence and scale-out test") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 181 | main.log.report("Currently active ONOS node(s): ") |
| 182 | report_str = "Node " |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 183 | for node in range(1, cluster_count+1): |
| 184 | report_str += (str(node) + " ") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 185 | main.log.report(report_str) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 186 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 187 | main.step("Distributing "+num_sw+" switches to each ONOS") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 188 | index = 1 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 189 | for node in range(1, cluster_count+1): |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 190 | for i in range(index, (int(num_sw)/cluster_count)+index): |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 191 | main.Mininet1.assign_sw_controller( |
| 192 | sw=str(i), |
| 193 | ip1=ONOS_ip_list[node], |
| 194 | port1=default_sw_port) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 195 | index = i+1 |
| 196 | |
| 197 | main.log.info("Please check ptpd configuration to ensure "+\ |
| 198 | "all nodes' system times are in sync") |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 199 | |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 200 | time.sleep(10) |
| 201 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 202 | for i in range(0, int(num_iter)): |
| 203 | main.step("Set iptables rule to block sw connections") |
| 204 | |
| 205 | #INPUT rules |
| 206 | main.ONOS1.handle.sendline( |
| 207 | "sudo iptables -A INPUT -p tcp -s "+ |
| 208 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 209 | main.ONOS2.handle.sendline( |
| 210 | "sudo iptables -A INPUT -p tcp -s "+ |
| 211 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 212 | main.ONOS3.handle.sendline( |
| 213 | "sudo iptables -A INPUT -p tcp -s "+ |
| 214 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 215 | main.ONOS4.handle.sendline( |
| 216 | "sudo iptables -A INPUT -p tcp -s "+ |
| 217 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 218 | main.ONOS5.handle.sendline( |
| 219 | "sudo iptables -A INPUT -p tcp -s "+ |
| 220 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 221 | main.ONOS6.handle.sendline( |
| 222 | "sudo iptables -A INPUT -p tcp -s "+ |
| 223 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 224 | main.ONOS7.handle.sendline( |
| 225 | "sudo iptables -A INPUT -p tcp -s "+ |
| 226 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 227 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 228 | #OUTPUT rules |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 229 | main.ONOS1.handle.sendline( |
| 230 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 231 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 232 | main.ONOS2.handle.sendline( |
| 233 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 234 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 235 | main.ONOS3.handle.sendline( |
| 236 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 237 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 238 | main.ONOS4.handle.sendline( |
| 239 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 240 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 241 | main.ONOS5.handle.sendline( |
| 242 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 243 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 244 | main.ONOS6.handle.sendline( |
| 245 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 246 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 247 | main.ONOS7.handle.sendline( |
| 248 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 249 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 250 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 251 | main.log.info("Please wait for switch connection to timeout") |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 252 | |
| 253 | |
| 254 | #time.sleep(60) |
| 255 | #if cluster_count >= 3: |
| 256 | # time.sleep(60) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 257 | if cluster_count >= 5: |
| 258 | time.sleep(30) |
| 259 | if cluster_count >= 6: |
| 260 | time.sleep(30) |
| 261 | |
| 262 | if cluster_count >= 3: |
| 263 | main.ONOS1.tshark_grep("SYN, ACK", |
| 264 | "/tmp/syn_ack_onos1_iter"+str(i)+".txt") |
| 265 | main.ONOS2.tshark_grep("SYN, ACK", |
| 266 | "/tmp/syn_ack_onos2_iter"+str(i)+".txt") |
| 267 | main.ONOS3.tshark_grep("SYN, ACK", |
| 268 | "/tmp/syn_ack_onos3_iter"+str(i)+".txt") |
| 269 | if cluster_count >= 4: |
| 270 | main.ONOS4.tshark_grep("SYN, ACK", |
| 271 | "/tmp/syn_ack_onos4_iter"+str(i)+".txt") |
| 272 | if cluster_count >= 5: |
| 273 | main.ONOS5.tshark_grep("SYN, ACK", |
| 274 | "/tmp/syn_ack_onos5_iter"+str(i)+".txt") |
| 275 | if cluster_count >= 6: |
| 276 | main.ONOS6.tshark_grep("SYN, ACK", |
| 277 | "/tmp/syn_ack_onos6_iter"+str(i)+".txt") |
| 278 | if cluster_count == 7: |
| 279 | main.ONOS7.tshark_grep("SYN, ACK", |
| 280 | "/tmp/syn_ack_onos7_iter"+str(i)+".txt") |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 281 | |
| 282 | loop_count = 0 |
| 283 | device_count = 0 |
| 284 | while loop_count < 60: |
| 285 | main.log.info("Checking devices for device down") |
| 286 | device_str = main.ONOS1cli.devices() |
| 287 | device_json = json.loads(device_str) |
| 288 | for device in device_json: |
| 289 | if device['available'] == False: |
| 290 | print device_count |
| 291 | device_count += 1 |
| 292 | else: |
| 293 | device_count = 0 |
| 294 | if device_count >= int(num_sw)*int(cluster_count): |
| 295 | main.step("Flushing iptables and obtaining t0") |
| 296 | t0_system = time.time()*1000 |
| 297 | main.ONOS1.handle.sendline("sudo iptables -F") |
| 298 | main.ONOS2.handle.sendline("sudo iptables -F") |
| 299 | main.ONOS3.handle.sendline("sudo iptables -F") |
| 300 | main.ONOS4.handle.sendline("sudo iptables -F") |
| 301 | main.ONOS5.handle.sendline("sudo iptables -F") |
| 302 | main.ONOS6.handle.sendline("sudo iptables -F") |
| 303 | main.ONOS7.handle.sendline("sudo iptables -F") |
| 304 | |
| 305 | break |
| 306 | |
| 307 | time.sleep(1) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 308 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 309 | main.log.info("System time t0: "+str(t0_system)) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 310 | |
| 311 | counter_loop = 0 |
| 312 | counter_avail1 = 0 |
| 313 | counter_avail2 = 0 |
| 314 | counter_avail3 = 0 |
| 315 | counter_avail4 = 0 |
| 316 | counter_avail5 = 0 |
| 317 | counter_avail6 = 0 |
| 318 | counter_avail7 = 0 |
| 319 | onos1_dev = False |
| 320 | onos2_dev = False |
| 321 | onos3_dev = False |
| 322 | onos4_dev = False |
| 323 | onos5_dev = False |
| 324 | onos6_dev = False |
| 325 | onos7_dev = False |
| 326 | |
| 327 | #TODO: Think of a more elegant way to check all |
| 328 | # switches across all nodes |
| 329 | #Goodluck debugging this loop |
| 330 | while counter_loop < 60: |
| 331 | for node in range(1, cluster_count+1): |
| 332 | if node == 1 and not onos1_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 333 | main.log.info("Checking node 1 for device "+ |
| 334 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 335 | device_str_obj1 = main.ONOS1cli.devices() |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 336 | device_json1 = json.loads(device_str_obj1) |
| 337 | for device1 in device_json1: |
| 338 | if device1['available'] == True: |
| 339 | counter_avail1 += 1 |
| 340 | if counter_avail1 == int(num_sw): |
| 341 | onos1_dev = True |
| 342 | main.log.info("All devices have been"+ |
| 343 | " discovered on ONOS1") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 344 | else: |
| 345 | counter_avail1 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 346 | if node == 2 and not onos2_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 347 | main.log.info("Checking node 2 for device "+ |
| 348 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 349 | device_str_obj2 = main.ONOS2cli.devices() |
| 350 | device_json2 = json.loads(device_str_obj2) |
| 351 | for device2 in device_json2: |
| 352 | if device2['available'] == True: |
| 353 | counter_avail2 += 1 |
| 354 | if counter_avail2 == int(num_sw): |
| 355 | onos2_dev = True |
| 356 | main.log.info("All devices have been"+ |
| 357 | " discovered on ONOS2") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 358 | else: |
| 359 | counter_avail2 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 360 | if node == 3 and not onos3_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 361 | main.log.info("Checking node 3 for device "+ |
| 362 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 363 | device_str_obj3 = main.ONOS3cli.devices() |
| 364 | device_json3 = json.loads(device_str_obj3) |
| 365 | for device3 in device_json3: |
| 366 | if device3['available'] == True: |
| 367 | counter_avail3 += 1 |
| 368 | if counter_avail3 == int(num_sw): |
| 369 | onos3_dev = True |
| 370 | main.log.info("All devices have been"+ |
| 371 | " discovered on ONOS3") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 372 | else: |
| 373 | counter_avail3 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 374 | if node == 4 and not onos4_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 375 | main.log.info("Checking node 4 for device "+ |
| 376 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 377 | device_str_obj4 = main.ONOS4cli.devices() |
| 378 | device_json4 = json.loads(device_str_obj4) |
| 379 | for device4 in device_json4: |
| 380 | if device4['available'] == True: |
| 381 | counter_avail4 += 1 |
| 382 | if counter_avail4 == int(num_sw): |
| 383 | onos4_dev = True |
| 384 | main.log.info("All devices have been"+ |
| 385 | " discovered on ONOS4") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 386 | else: |
| 387 | counter_avail4 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 388 | if node == 5 and not onos5_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 389 | main.log.info("Checking node 5 for device "+ |
| 390 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 391 | device_str_obj5 = main.ONOS5cli.devices() |
| 392 | device_json5 = json.loads(device_str_obj5) |
| 393 | for device5 in device_json5: |
| 394 | if device5['available'] == True: |
| 395 | counter_avail5 += 1 |
| 396 | if counter_avail5 == int(num_sw): |
| 397 | onos5_dev = True |
| 398 | main.log.info("All devices have been"+ |
| 399 | " discovered on ONOS5") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 400 | else: |
| 401 | counter_avail5 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 402 | if node == 6 and not onos6_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 403 | main.log.info("Checking node 6 for device "+ |
| 404 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 405 | device_str_obj6 = main.ONOS6cli.devices() |
| 406 | device_json6 = json.loads(device_str_obj6) |
| 407 | for device6 in device_json6: |
| 408 | if device6['available'] == True: |
| 409 | counter_avail6 += 1 |
| 410 | if counter_avail6 == int(num_sw): |
| 411 | onos6_dev = True |
| 412 | main.log.info("All devices have been"+ |
| 413 | " discovered on ONOS6") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 414 | else: |
| 415 | counter_avail6 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 416 | if node == 7 and not onos7_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 417 | main.log.info("Checking node 7 for device "+ |
| 418 | "discovery") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 419 | device_str_obj7 = main.ONOS7cli.devices() |
| 420 | device_json7 = json.loads(device_str_obj7) |
| 421 | for device7 in device_json7: |
| 422 | if device7['available'] == True: |
| 423 | counter_avail7 += 1 |
| 424 | if counter_avail7 == int(num_sw): |
| 425 | onos7_dev = True |
| 426 | main.log.info("All devices have been"+ |
| 427 | " discovered on ONOS7") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 428 | else: |
| 429 | counter_avail7 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 430 | #END node loop |
| 431 | |
| 432 | #TODO: clean up this mess of an if statements if possible |
| 433 | #Treat each if as a separate test case with the given |
| 434 | # cluster count. Hence when the cluster count changes |
| 435 | # the desired calculations will be made |
| 436 | if cluster_count == 1: |
| 437 | if onos1_dev: |
| 438 | main.log.info("All devices have been discovered"+ |
| 439 | " on all ONOS instances") |
| 440 | json_str_metrics_1 =\ |
| 441 | main.ONOS1cli.topology_events_metrics() |
| 442 | json_obj_1 = json.loads(json_str_metrics_1) |
| 443 | graph_timestamp_1 =\ |
| 444 | json_obj_1[graphTimestamp]['value'] |
| 445 | |
| 446 | graph_lat_1 = \ |
| 447 | int(graph_timestamp_1) - int(t0_system) |
| 448 | |
| 449 | if graph_lat_1 > sw_disc_threshold_min\ |
| 450 | and graph_lat_1 < sw_disc_threshold_max: |
| 451 | sw_discovery_lat_list.append( |
| 452 | graph_lat_1) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 453 | main.log.info("Sw discovery latency of "+ |
| 454 | str(cluster_count)+" node(s): "+ |
| 455 | str(graph_lat_1)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 456 | else: |
| 457 | main.log.info("Switch discovery latency "+ |
| 458 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 459 | main.log.info(graph_lat_1) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 460 | #Break while loop |
| 461 | break |
| 462 | if cluster_count == 2: |
| 463 | if onos1_dev and onos2_dev: |
| 464 | main.log.info("All devices have been discovered"+ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 465 | " on all "+str(cluster_count)+ |
| 466 | " ONOS instances") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 467 | json_str_metrics_1 =\ |
| 468 | main.ONOS1cli.topology_events_metrics() |
| 469 | json_str_metrics_2 =\ |
| 470 | main.ONOS2cli.topology_events_metrics() |
| 471 | json_obj_1 = json.loads(json_str_metrics_1) |
| 472 | json_obj_2 = json.loads(json_str_metrics_2) |
| 473 | graph_timestamp_1 =\ |
| 474 | json_obj_1[graphTimestamp]['value'] |
| 475 | graph_timestamp_2 =\ |
| 476 | json_obj_2[graphTimestamp]['value'] |
| 477 | |
| 478 | graph_lat_1 = \ |
| 479 | int(graph_timestamp_1) - int(t0_system) |
| 480 | graph_lat_2 = \ |
| 481 | int(graph_timestamp_2) - int(t0_system) |
| 482 | |
| 483 | avg_graph_lat = \ |
| 484 | (int(graph_lat_1) +\ |
| 485 | int(graph_lat_2)) / 2 |
| 486 | |
| 487 | if avg_graph_lat > sw_disc_threshold_min\ |
| 488 | and avg_graph_lat < sw_disc_threshold_max: |
| 489 | sw_discovery_lat_list.append( |
| 490 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 491 | main.log.info("Sw discovery latency of "+ |
| 492 | str(cluster_count)+" node(s): "+ |
| 493 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 494 | else: |
| 495 | main.log.info("Switch discovery latency "+ |
| 496 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 497 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 498 | break |
| 499 | if cluster_count == 3: |
| 500 | if onos1_dev and onos2_dev and onos3_dev: |
| 501 | main.log.info("All devices have been discovered"+ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 502 | " on all "+str(cluster_count)+ |
| 503 | " ONOS instances") |
| 504 | |
| 505 | #TODO: Investigate this sleep |
| 506 | # added to 'pad' the results with |
| 507 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 508 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 509 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 510 | json_str_metrics_1 =\ |
| 511 | main.ONOS1cli.topology_events_metrics() |
| 512 | json_str_metrics_2 =\ |
| 513 | main.ONOS2cli.topology_events_metrics() |
| 514 | json_str_metrics_3 =\ |
| 515 | main.ONOS3cli.topology_events_metrics() |
| 516 | json_obj_1 = json.loads(json_str_metrics_1) |
| 517 | json_obj_2 = json.loads(json_str_metrics_2) |
| 518 | json_obj_3 = json.loads(json_str_metrics_3) |
| 519 | graph_timestamp_1 =\ |
| 520 | json_obj_1[graphTimestamp]['value'] |
| 521 | graph_timestamp_2 =\ |
| 522 | json_obj_2[graphTimestamp]['value'] |
| 523 | graph_timestamp_3 =\ |
| 524 | json_obj_3[graphTimestamp]['value'] |
| 525 | |
| 526 | graph_lat_1 = \ |
| 527 | int(graph_timestamp_1) - int(t0_system) |
| 528 | graph_lat_2 = \ |
| 529 | int(graph_timestamp_2) - int(t0_system) |
| 530 | graph_lat_3 = \ |
| 531 | int(graph_timestamp_3) - int(t0_system) |
| 532 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 533 | main.log.info("DEBUG: graph_timestamp_1: "+ |
| 534 | str(graph_timestamp_1)) |
| 535 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 536 | avg_graph_lat = \ |
| 537 | (int(graph_lat_1) +\ |
| 538 | int(graph_lat_2) +\ |
| 539 | int(graph_lat_3)) / 3 |
| 540 | |
| 541 | if avg_graph_lat > sw_disc_threshold_min\ |
| 542 | and avg_graph_lat < sw_disc_threshold_max: |
| 543 | sw_discovery_lat_list.append( |
| 544 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 545 | main.log.info("Sw discovery latency of "+ |
| 546 | str(cluster_count)+" node(s): "+ |
| 547 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 548 | else: |
| 549 | main.log.info("Switch discovery latency "+ |
| 550 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 551 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 552 | |
| 553 | break |
| 554 | if cluster_count == 4: |
| 555 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 556 | onos4_dev: |
| 557 | main.log.info("All devices have been discovered"+ |
| 558 | " on all ONOS instances") |
| 559 | json_str_metrics_1 =\ |
| 560 | main.ONOS1cli.topology_events_metrics() |
| 561 | json_str_metrics_2 =\ |
| 562 | main.ONOS2cli.topology_events_metrics() |
| 563 | json_str_metrics_3 =\ |
| 564 | main.ONOS3cli.topology_events_metrics() |
| 565 | json_str_metrics_4 =\ |
| 566 | main.ONOS4cli.topology_events_metrics() |
| 567 | json_obj_1 = json.loads(json_str_metrics_1) |
| 568 | json_obj_2 = json.loads(json_str_metrics_2) |
| 569 | json_obj_3 = json.loads(json_str_metrics_3) |
| 570 | json_obj_4 = json.loads(json_str_metrics_4) |
| 571 | graph_timestamp_1 =\ |
| 572 | json_obj_1[graphTimestamp]['value'] |
| 573 | graph_timestamp_2 =\ |
| 574 | json_obj_2[graphTimestamp]['value'] |
| 575 | graph_timestamp_3 =\ |
| 576 | json_obj_3[graphTimestamp]['value'] |
| 577 | graph_timestamp_4 =\ |
| 578 | json_obj_4[graphTimestamp]['value'] |
| 579 | |
| 580 | graph_lat_1 = \ |
| 581 | int(graph_timestamp_1) - int(t0_system) |
| 582 | graph_lat_2 = \ |
| 583 | int(graph_timestamp_2) - int(t0_system) |
| 584 | graph_lat_3 = \ |
| 585 | int(graph_timestamp_3) - int(t0_system) |
| 586 | graph_lat_4 = \ |
| 587 | int(graph_timestamp_4) - int(t0_system) |
| 588 | |
| 589 | avg_graph_lat = \ |
| 590 | (int(graph_lat_1) +\ |
| 591 | int(graph_lat_2) +\ |
| 592 | int(graph_lat_3) +\ |
| 593 | int(graph_lat_4)) / 4 |
| 594 | |
| 595 | if avg_graph_lat > sw_disc_threshold_min\ |
| 596 | and avg_graph_lat < sw_disc_threshold_max: |
| 597 | sw_discovery_lat_list.append( |
| 598 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 599 | main.log.info("Sw discovery latency of "+ |
| 600 | str(cluster_count)+" node(s): "+ |
| 601 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 602 | else: |
| 603 | main.log.info("Switch discovery latency "+ |
| 604 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 605 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 606 | |
| 607 | break |
| 608 | if cluster_count == 5: |
| 609 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 610 | onos4_dev and onos5_dev: |
| 611 | main.log.info("All devices have been discovered"+ |
| 612 | " on all ONOS instances") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 613 | |
| 614 | #TODO: Investigate this sleep |
| 615 | # added to 'pad' the results with |
| 616 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 617 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 618 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 619 | json_str_metrics_1 =\ |
| 620 | main.ONOS1cli.topology_events_metrics() |
| 621 | json_str_metrics_2 =\ |
| 622 | main.ONOS2cli.topology_events_metrics() |
| 623 | json_str_metrics_3 =\ |
| 624 | main.ONOS3cli.topology_events_metrics() |
| 625 | json_str_metrics_4 =\ |
| 626 | main.ONOS4cli.topology_events_metrics() |
| 627 | json_str_metrics_5 =\ |
| 628 | main.ONOS5cli.topology_events_metrics() |
| 629 | json_obj_1 = json.loads(json_str_metrics_1) |
| 630 | json_obj_2 = json.loads(json_str_metrics_2) |
| 631 | json_obj_3 = json.loads(json_str_metrics_3) |
| 632 | json_obj_4 = json.loads(json_str_metrics_4) |
| 633 | json_obj_5 = json.loads(json_str_metrics_5) |
| 634 | graph_timestamp_1 =\ |
| 635 | json_obj_1[graphTimestamp]['value'] |
| 636 | graph_timestamp_2 =\ |
| 637 | json_obj_2[graphTimestamp]['value'] |
| 638 | graph_timestamp_3 =\ |
| 639 | json_obj_3[graphTimestamp]['value'] |
| 640 | graph_timestamp_4 =\ |
| 641 | json_obj_4[graphTimestamp]['value'] |
| 642 | graph_timestamp_5 =\ |
| 643 | json_obj_5[graphTimestamp]['value'] |
| 644 | |
| 645 | graph_lat_1 = \ |
| 646 | int(graph_timestamp_1) - int(t0_system) |
| 647 | graph_lat_2 = \ |
| 648 | int(graph_timestamp_2) - int(t0_system) |
| 649 | graph_lat_3 = \ |
| 650 | int(graph_timestamp_3) - int(t0_system) |
| 651 | graph_lat_4 = \ |
| 652 | int(graph_timestamp_4) - int(t0_system) |
| 653 | graph_lat_5 = \ |
| 654 | int(graph_timestamp_5) - int(t0_system) |
| 655 | |
| 656 | avg_graph_lat = \ |
| 657 | (int(graph_lat_1) +\ |
| 658 | int(graph_lat_2) +\ |
| 659 | int(graph_lat_3) +\ |
| 660 | int(graph_lat_4) +\ |
| 661 | int(graph_lat_5)) / 5 |
| 662 | |
| 663 | if avg_graph_lat > sw_disc_threshold_min\ |
| 664 | and avg_graph_lat < sw_disc_threshold_max: |
| 665 | sw_discovery_lat_list.append( |
| 666 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 667 | main.log.info("Sw discovery latency of "+ |
| 668 | str(cluster_count)+" node(s): "+ |
| 669 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 670 | else: |
| 671 | main.log.info("Switch discovery latency "+ |
| 672 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 673 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 674 | |
| 675 | break |
| 676 | if cluster_count == 6: |
| 677 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 678 | onos4_dev and onos5_dev and onos6_dev: |
| 679 | main.log.info("All devices have been discovered"+ |
| 680 | " on all ONOS instances") |
| 681 | json_str_metrics_1 =\ |
| 682 | main.ONOS1cli.topology_events_metrics() |
| 683 | json_str_metrics_2 =\ |
| 684 | main.ONOS2cli.topology_events_metrics() |
| 685 | json_str_metrics_3 =\ |
| 686 | main.ONOS3cli.topology_events_metrics() |
| 687 | json_str_metrics_4 =\ |
| 688 | main.ONOS4cli.topology_events_metrics() |
| 689 | json_str_metrics_5 =\ |
| 690 | main.ONOS5cli.topology_events_metrics() |
| 691 | json_str_metrics_6 =\ |
| 692 | main.ONOS6cli.topology_events_metrics() |
| 693 | json_obj_1 = json.loads(json_str_metrics_1) |
| 694 | json_obj_2 = json.loads(json_str_metrics_2) |
| 695 | json_obj_3 = json.loads(json_str_metrics_3) |
| 696 | json_obj_4 = json.loads(json_str_metrics_4) |
| 697 | json_obj_5 = json.loads(json_str_metrics_5) |
| 698 | json_obj_6 = json.loads(json_str_metrics_6) |
| 699 | graph_timestamp_1 =\ |
| 700 | json_obj_1[graphTimestamp]['value'] |
| 701 | graph_timestamp_2 =\ |
| 702 | json_obj_2[graphTimestamp]['value'] |
| 703 | graph_timestamp_3 =\ |
| 704 | json_obj_3[graphTimestamp]['value'] |
| 705 | graph_timestamp_4 =\ |
| 706 | json_obj_4[graphTimestamp]['value'] |
| 707 | graph_timestamp_5 =\ |
| 708 | json_obj_5[graphTimestamp]['value'] |
| 709 | graph_timestamp_6 =\ |
| 710 | json_obj_6[graphTimestamp]['value'] |
| 711 | |
| 712 | graph_lat_1 = \ |
| 713 | int(graph_timestamp_1) - int(t0_system) |
| 714 | graph_lat_2 = \ |
| 715 | int(graph_timestamp_2) - int(t0_system) |
| 716 | graph_lat_3 = \ |
| 717 | int(graph_timestamp_3) - int(t0_system) |
| 718 | graph_lat_4 = \ |
| 719 | int(graph_timestamp_4) - int(t0_system) |
| 720 | graph_lat_5 = \ |
| 721 | int(graph_timestamp_5) - int(t0_system) |
| 722 | graph_lat_6 = \ |
| 723 | int(graph_timestamp_6) - int(t0_system) |
| 724 | |
| 725 | avg_graph_lat = \ |
| 726 | (int(graph_lat_1) +\ |
| 727 | int(graph_lat_2) +\ |
| 728 | int(graph_lat_3) +\ |
| 729 | int(graph_lat_4) +\ |
| 730 | int(graph_lat_5) +\ |
| 731 | int(graph_lat_6)) / 6 |
| 732 | |
| 733 | if avg_graph_lat > sw_disc_threshold_min\ |
| 734 | and avg_graph_lat < sw_disc_threshold_max: |
| 735 | sw_discovery_lat_list.append( |
| 736 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 737 | main.log.info("Sw discovery latency of "+ |
| 738 | str(cluster_count)+" node(s): "+ |
| 739 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 740 | else: |
| 741 | main.log.info("Switch discovery latency "+ |
| 742 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 743 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 744 | |
| 745 | break |
| 746 | if cluster_count == 7: |
| 747 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 748 | onos4_dev and onos5_dev and onos6_dev and\ |
| 749 | onos7_dev: |
| 750 | main.log.info("All devices have been discovered"+ |
| 751 | " on all ONOS instances") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 752 | |
| 753 | #TODO: Investigate this sleep |
| 754 | # added to 'pad' the results with |
| 755 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 756 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 757 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 758 | json_str_metrics_1 =\ |
| 759 | main.ONOS1cli.topology_events_metrics() |
| 760 | json_str_metrics_2 =\ |
| 761 | main.ONOS2cli.topology_events_metrics() |
| 762 | json_str_metrics_3 =\ |
| 763 | main.ONOS3cli.topology_events_metrics() |
| 764 | json_str_metrics_4 =\ |
| 765 | main.ONOS4cli.topology_events_metrics() |
| 766 | json_str_metrics_5 =\ |
| 767 | main.ONOS5cli.topology_events_metrics() |
| 768 | json_str_metrics_6 =\ |
| 769 | main.ONOS6cli.topology_events_metrics() |
| 770 | json_str_metrics_7 =\ |
| 771 | main.ONOS7cli.topology_events_metrics() |
| 772 | json_obj_1 = json.loads(json_str_metrics_1) |
| 773 | json_obj_2 = json.loads(json_str_metrics_2) |
| 774 | json_obj_3 = json.loads(json_str_metrics_3) |
| 775 | json_obj_4 = json.loads(json_str_metrics_4) |
| 776 | json_obj_5 = json.loads(json_str_metrics_5) |
| 777 | json_obj_6 = json.loads(json_str_metrics_6) |
| 778 | json_obj_7 = json.loads(json_str_metrics_7) |
| 779 | graph_timestamp_1 =\ |
| 780 | json_obj_1[graphTimestamp]['value'] |
| 781 | graph_timestamp_2 =\ |
| 782 | json_obj_2[graphTimestamp]['value'] |
| 783 | graph_timestamp_3 =\ |
| 784 | json_obj_3[graphTimestamp]['value'] |
| 785 | graph_timestamp_4 =\ |
| 786 | json_obj_4[graphTimestamp]['value'] |
| 787 | graph_timestamp_5 =\ |
| 788 | json_obj_5[graphTimestamp]['value'] |
| 789 | graph_timestamp_6 =\ |
| 790 | json_obj_6[graphTimestamp]['value'] |
| 791 | graph_timestamp_7 =\ |
| 792 | json_obj_7[graphTimestamp]['value'] |
| 793 | |
| 794 | graph_lat_1 = \ |
| 795 | int(graph_timestamp_1) - int(t0_system) |
| 796 | graph_lat_2 = \ |
| 797 | int(graph_timestamp_2) - int(t0_system) |
| 798 | graph_lat_3 = \ |
| 799 | int(graph_timestamp_3) - int(t0_system) |
| 800 | graph_lat_4 = \ |
| 801 | int(graph_timestamp_4) - int(t0_system) |
| 802 | graph_lat_5 = \ |
| 803 | int(graph_timestamp_5) - int(t0_system) |
| 804 | graph_lat_6 = \ |
| 805 | int(graph_timestamp_6) - int(t0_system) |
| 806 | graph_lat_7 = \ |
| 807 | int(graph_timestamp_7) - int(t0_system) |
| 808 | |
| 809 | avg_graph_lat = \ |
| 810 | (int(graph_lat_1) +\ |
| 811 | int(graph_lat_2) +\ |
| 812 | int(graph_lat_3) +\ |
| 813 | int(graph_lat_4) +\ |
| 814 | int(graph_lat_5) +\ |
| 815 | int(graph_lat_6) +\ |
| 816 | int(graph_lat_7)) / 7 |
| 817 | |
| 818 | if avg_graph_lat > sw_disc_threshold_min\ |
| 819 | and avg_graph_lat < sw_disc_threshold_max: |
| 820 | sw_discovery_lat_list.append( |
| 821 | avg_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 822 | main.log.info("Sw discovery latency of "+ |
| 823 | str(cluster_count)+" node(s): "+ |
| 824 | str(avg_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 825 | else: |
| 826 | main.log.info("Switch discovery latency "+ |
| 827 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 828 | main.log.info(avg_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 829 | |
| 830 | break |
| 831 | |
| 832 | counter_loop += 1 |
| 833 | time.sleep(3) |
| 834 | #END WHILE LOOP |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 835 | |
| 836 | main.ONOS1.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 837 | syn_ack_timestamp_list = [] |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 838 | |
| 839 | if cluster_count >= 3: |
| 840 | main.ONOS2.tshark_stop() |
| 841 | main.ONOS3.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 842 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 843 | os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 844 | "/tmp/syn_ack_onos1_iter"+str(i)+".txt /tmp/") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 845 | os.system("scp "+ONOS_user+"@"+ONOS2_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 846 | "/tmp/syn_ack_onos2_iter"+str(i)+".txt /tmp/") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 847 | os.system("scp "+ONOS_user+"@"+ONOS3_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 848 | "/tmp/syn_ack_onos3_iter"+str(i)+".txt /tmp/") |
| 849 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 850 | #Read each of the files and append all |
| 851 | #SYN / ACK timestamps to the list |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 852 | with open("/tmp/syn_ack_onos1_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 853 | f_onos1: |
| 854 | for line in f_onos1: |
| 855 | line = line.split(" ") |
| 856 | syn_ack_timestamp_list.append(line[1]) |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 857 | with open("/tmp/syn_ack_onos2_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 858 | f_onos2: |
| 859 | for line in f_onos2: |
| 860 | line = line.split(" ") |
| 861 | syn_ack_timestamp_list.append(line[1]) |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 862 | with open("/tmp/syn_ack_onos3_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 863 | f_onos3: |
| 864 | for line in f_onos3: |
| 865 | line = line.split(" ") |
| 866 | syn_ack_timestamp_list.append(line[1]) |
| 867 | if cluster_count >= 4: |
| 868 | main.ONOS4.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 869 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 870 | os.system("scp "+ONOS_user+"@"+ONOS4_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 871 | "/tmp/syn_ack_onos4_iter"+str(i)+".txt /tmp/") |
| 872 | time.sleep(5) |
| 873 | with open("/tmp/syn_ack_onos4_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 874 | f_onos4: |
| 875 | for line in f_onos4: |
| 876 | line = line.split(" ") |
| 877 | syn_ack_timestamp_list.append(line[1]) |
| 878 | if cluster_count >= 5: |
| 879 | main.ONOS5.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 880 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 881 | os.system("scp "+ONOS_user+"@"+ONOS5_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 882 | "/tmp/syn_ack_onos5_iter"+str(i)+".txt /tmp/") |
| 883 | time.sleep(5) |
| 884 | with open("/tmp/syn_ack_onos5_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 885 | f_onos5: |
| 886 | for line in f_onos5: |
| 887 | line = line.split(" ") |
| 888 | syn_ack_timestamp_list.append(line[1]) |
| 889 | if cluster_count >= 6: |
| 890 | main.ONOS6.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 891 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 892 | os.system("scp "+ONOS_user+"@"+ONOS6_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 893 | "/tmp/syn_ack_onos6_iter"+str(i)+".txt /tmp/") |
| 894 | time.sleep(5) |
| 895 | with open("/tmp/syn_ack_onos6_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 896 | f_onos6: |
| 897 | for line in f_onos6: |
| 898 | line = line.split(" ") |
| 899 | syn_ack_timestamp_list.append(line[1]) |
| 900 | if cluster_count == 7: |
| 901 | main.ONOS7.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 902 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 903 | os.system("scp "+ONOS_user+"@"+ONOS7_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 904 | "/tmp/syn_ack_onos7_iter"+str(i)+".txt /tmp/") |
| 905 | time.sleep(5) |
| 906 | with open("/tmp/syn_ack_onos7_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 907 | f_onos7: |
| 908 | for line in f_onos7: |
| 909 | line = line.split(" ") |
| 910 | syn_ack_timestamp_list.append(line[1]) |
| 911 | |
| 912 | #Sort the list by timestamp |
| 913 | syn_ack_timestamp_list = sorted(syn_ack_timestamp_list) |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 914 | |
| 915 | syn_ack_delta =\ |
| 916 | int(float(syn_ack_timestamp_list[-1])*1000) -\ |
| 917 | int(float(syn_ack_timestamp_list[0])*1000) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 918 | |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 919 | main.log.info("Switch connection attempt delta iteration "+ |
| 920 | str(i)+": "+str(syn_ack_delta)) |
| 921 | syn_ack_delta_list.append(syn_ack_delta) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 922 | #END ITERATION LOOP |
| 923 | #REPORT HERE |
| 924 | |
| 925 | if len(sw_discovery_lat_list) > 0: |
| 926 | sw_lat_avg = sum(sw_discovery_lat_list) / \ |
| 927 | len(sw_discovery_lat_list) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 928 | sw_lat_dev = numpy.std(sw_discovery_lat_list) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 929 | else: |
| 930 | assertion = main.FALSE |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 931 | |
| 932 | main.log.report("Switch connection attempt time avg "+ |
andrewonlab | d784d4f | 2014-11-17 17:47:32 -0500 | [diff] [blame] | 933 | "(last sw SYN/ACK time - first sw SYN/ACK time) "+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 934 | str(sum(syn_ack_delta_list)/len(syn_ack_delta_list)) + |
| 935 | " ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 936 | main.log.report("Switch discovery lat for "+\ |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 937 | str(cluster_count)+" instance(s), 100 sw each: ") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 938 | main.log.report("Avg: "+str(sw_lat_avg)+" ms") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 939 | main.log.report("Std Deviation: "+ |
| 940 | str(round(sw_lat_dev,1))+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 941 | |
| 942 | utilities.assert_equals(expect=main.TRUE, actual=assertion, |
| 943 | onpass="Switch discovery convergence latency" +\ |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 944 | " for "+str(cluster_count)+" nodes successful", |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 945 | onfail="Switch discovery convergence latency" +\ |
| 946 | " test failed") |
| 947 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 948 | def CASE3(self, main): |
| 949 | ''' |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 950 | Increase number of nodes and initiate CLI |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 951 | ''' |
| 952 | import time |
| 953 | import subprocess |
| 954 | import os |
| 955 | import requests |
| 956 | import json |
| 957 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 958 | ONOS1_ip = main.params['CTRL']['ip1'] |
| 959 | ONOS2_ip = main.params['CTRL']['ip2'] |
| 960 | ONOS3_ip = main.params['CTRL']['ip3'] |
| 961 | ONOS4_ip = main.params['CTRL']['ip4'] |
| 962 | ONOS5_ip = main.params['CTRL']['ip5'] |
| 963 | ONOS6_ip = main.params['CTRL']['ip6'] |
| 964 | ONOS7_ip = main.params['CTRL']['ip7'] |
| 965 | |
| 966 | cell_name = main.params['ENV']['cellName'] |
| 967 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 968 | MN1_ip = main.params['MN']['ip1'] |
| 969 | BENCH_ip = main.params['BENCH']['ip'] |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 970 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 971 | #NOTE:We start with cluster_count at 3. The first |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 972 | #case already initialized ONOS1. Increase the |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 973 | #cluster count and start from 3. |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 974 | #You can optionally change the increment to |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 975 | #test steps of node sizes, such as 3,5,7 |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 976 | |
| 977 | global cluster_count |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 978 | cluster_count += 2 |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 979 | |
| 980 | install_result = main.FALSE |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 981 | #Supports up to 7 node configuration |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 982 | #TODO: Cleanup this ridiculous repetitive code |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 983 | if cluster_count == 4: |
| 984 | main.log.info("Installing ONOS on node 4") |
| 985 | install_result = \ |
| 986 | main.ONOSbench.onos_install(node=ONOS4_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 987 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 988 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 989 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 990 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 991 | elif cluster_count == 5: |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 992 | main.log.info("Installing ONOS on node 5") |
| 993 | install_result1 = \ |
| 994 | main.ONOSbench.onos_install(options="",node=ONOS4_ip) |
| 995 | install_result2 = \ |
| 996 | main.ONOSbench.onos_install(node=ONOS5_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 997 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 998 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 999 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1000 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1001 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
| 1002 | install_result = install_result1 and install_result2 |
| 1003 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1004 | elif cluster_count == 6: |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1005 | main.log.info("Installing ONOS on node 6") |
| 1006 | install_result1 = \ |
| 1007 | main.ONOSbench.onos_install(options="",node=ONOS4_ip) |
| 1008 | install_result2 = \ |
| 1009 | main.ONOSbench.onos_install(options="",node=ONOS5_ip) |
| 1010 | install_result3 = \ |
| 1011 | main.ONOSbench.onos_install(node=ONOS6_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1012 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1013 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 1014 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
| 1015 | main.ONOS6cli.start_onos_cli(ONOS6_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1016 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1017 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
| 1018 | main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip) |
| 1019 | install_result = install_result1 and install_result2 and\ |
| 1020 | install_result3 |
| 1021 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1022 | elif cluster_count == 7: |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1023 | main.log.info("Installing ONOS on node 7") |
| 1024 | install_result1 = \ |
| 1025 | main.ONOSbench.onos_install(options="",node=ONOS4_ip) |
| 1026 | install_result2 = \ |
| 1027 | main.ONOSbench.onos_install(options="",node=ONOS5_ip) |
| 1028 | install_result3 = \ |
| 1029 | main.ONOSbench.onos_install(options="",node=ONOS6_ip) |
| 1030 | install_result4 = \ |
| 1031 | main.ONOSbench.onos_install(node=ONOS7_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1032 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1033 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 1034 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
| 1035 | main.ONOS6cli.start_onos_cli(ONOS6_ip) |
| 1036 | main.ONOS7cli.start_onos_cli(ONOS7_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1037 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1038 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
| 1039 | main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip) |
| 1040 | main.ONOS1cli.add_node(ONOS7_ip, ONOS7_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1041 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1042 | install_result = install_result1 and install_result2 and\ |
| 1043 | install_result3 and install_result4 |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1044 | |
| 1045 | time.sleep(5) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1046 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 1047 | if install_result == main.TRUE: |
| 1048 | assertion = main.TRUE |
| 1049 | else: |
| 1050 | assertion = main.FALSE |
| 1051 | |
| 1052 | utilities.assert_equals(expect=main.TRUE, actual=assertion, |
| 1053 | onpass="Scale out to "+str(cluster_count)+\ |
| 1054 | " nodes successful", |
| 1055 | onfail="Scale out to "+str(cluster_count)+\ |
| 1056 | " nodes failed") |