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 | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 30 | global topo_iteration |
| 31 | topo_iteration = 1 |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 32 | cluster_count = 3 |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 33 | #****** |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 34 | 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'] |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 40 | 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'] |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 46 | MN1_ip = main.params['MN']['ip1'] |
| 47 | BENCH_ip = main.params['BENCH']['ip'] |
| 48 | |
| 49 | main.case("Setting up test environment") |
andrewonlab | c185052 | 2014-11-21 12:07:33 -0500 | [diff] [blame] | 50 | main.log.info("copying topology event accumulator config file"+\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 51 | " 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'] |
andrewonlab | c185052 | 2014-11-21 12:07:33 -0500 | [diff] [blame] | 55 | main.ONOSbench.handle.sendline("cp ~/"+topo_config+\ |
| 56 | " ~/ONOS/tools/package/etc/"+\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 57 | topo_config_name) |
| 58 | main.ONOSbench.handle.expect("\$") |
| 59 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 60 | main.log.info("Uninstalling previous instances") |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 61 | #main.ONOSbench.onos_uninstall(node_ip = ONOS1_ip) |
| 62 | #main.ONOSbench.onos_uninstall(node_ip = ONOS2_ip) |
| 63 | #main.ONOSbench.onos_uninstall(node_ip = ONOS3_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 64 | 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 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 69 | main.log.report("Setting up test environment") |
| 70 | |
| 71 | main.step("Creating cell file") |
| 72 | cell_file_result = main.ONOSbench.create_cell_file( |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 73 | BENCH_ip, cell_name, MN1_ip, |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 74 | "onos-core,onos-app-metrics", |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 75 | ONOS1_ip, ONOS2_ip, ONOS3_ip) |
| 76 | #ONOS1_ip) |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 77 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 78 | 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 | |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 82 | main.step("Removing raft logs") |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 83 | main.ONOSbench.onos_remove_raft_logs() |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 84 | time.sleep(10) |
| 85 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 86 | 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 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 96 | main.log.report("Commit information - ") |
| 97 | main.ONOSbench.get_version() |
| 98 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 99 | 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) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 105 | main.ONOS2cli.set_cell(cell_name) |
| 106 | main.ONOS3cli.set_cell(cell_name) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 107 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 108 | main.step("Creating ONOS package") |
| 109 | package_result = main.ONOSbench.onos_package() |
| 110 | |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 111 | #Start test with single node only |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 112 | main.step("Installing ONOS package") |
| 113 | install1_result = main.ONOSbench.onos_install(node=ONOS1_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 114 | install2_result = main.ONOSbench.onos_install(node=ONOS2_ip) |
| 115 | install3_result = main.ONOSbench.onos_install(node=ONOS3_ip) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 116 | |
| 117 | time.sleep(10) |
| 118 | |
| 119 | main.step("Start onos cli") |
| 120 | cli1 = main.ONOS1cli.start_onos_cli(ONOS1_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 121 | cli2 = main.ONOS2cli.start_onos_cli(ONOS2_ip) |
| 122 | cli3 = main.ONOS3cli.start_onos_cli(ONOS3_ip) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 123 | |
| 124 | main.step("Enable metrics feature") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 125 | #main.ONOS1cli.feature_install("onos-app-metrics") |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 126 | |
| 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\ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 131 | install1_result, #and install2_result and\ |
| 132 | #install3_result, |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 133 | 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 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 156 | import numpy |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 157 | |
| 158 | ONOS_ip_list = [] |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 159 | ONOS_ip_list.append('0') |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 160 | 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']) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 167 | 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'] |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 174 | iter_ignore = int(main.params['TEST']['iterIgnore']) |
| 175 | |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 176 | #*********** |
| 177 | #Global number of switches that change |
| 178 | #throughout the test |
| 179 | global num_sw |
| 180 | global topo_iteration |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 181 | global cluster_count |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 182 | 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'] |
| 188 | #*********** |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 189 | |
| 190 | #Timestamp 'keys' for json metrics output. |
| 191 | #These are subject to change, hence moved into params |
| 192 | deviceTimestamp = main.params['JSON']['deviceTimestamp'] |
| 193 | graphTimestamp = main.params['JSON']['graphTimestamp'] |
| 194 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 195 | #Threshold for this test case |
| 196 | sw_disc_threshold_str = main.params['TEST']['swDisc100Threshold'] |
| 197 | sw_disc_threshold_obj = sw_disc_threshold_str.split(",") |
| 198 | sw_disc_threshold_min = int(sw_disc_threshold_obj[0]) |
| 199 | sw_disc_threshold_max = int(sw_disc_threshold_obj[1]) |
| 200 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 201 | assertion = main.TRUE |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 202 | sw_discovery_lat_list = [] |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 203 | syn_ack_delta_list = [] |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 204 | |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 205 | main.case(str(num_sw)+" switches distributed across "+ |
| 206 | str(cluster_count)+" nodes convergence latency") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 207 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 208 | main.log.report("Large topology convergence and scale-out test") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 209 | main.log.report("Currently active ONOS node(s): ") |
| 210 | report_str = "Node " |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 211 | for node in range(1, cluster_count+1): |
| 212 | report_str += (str(node) + " ") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 213 | main.log.report(report_str) |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 214 | main.log.report("Topology size: "+str(num_sw)+" switches") |
| 215 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 216 | main.step("Distributing "+num_sw+" switches to each ONOS") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 217 | index = 1 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 218 | for node in range(1, cluster_count+1): |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 219 | for i in range(index, (int(num_sw)/cluster_count)+index): |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 220 | main.Mininet1.assign_sw_controller( |
| 221 | sw=str(i), |
| 222 | ip1=ONOS_ip_list[node], |
| 223 | port1=default_sw_port) |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 224 | index = i+1 |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 225 | #for i in range(1, int(num_sw)+1): |
| 226 | #main.Mininet1.assign_sw_controller( |
| 227 | #sw=str(i), |
| 228 | #ip1="10.128.174.1", |
| 229 | # port1="6633") |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 230 | |
| 231 | main.log.info("Please check ptpd configuration to ensure "+\ |
| 232 | "all nodes' system times are in sync") |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 233 | |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 234 | time.sleep(10) |
| 235 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 236 | for i in range(0, int(num_iter)): |
| 237 | main.step("Set iptables rule to block sw connections") |
| 238 | |
| 239 | #INPUT rules |
| 240 | main.ONOS1.handle.sendline( |
| 241 | "sudo iptables -A INPUT -p tcp -s "+ |
| 242 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 243 | main.ONOS2.handle.sendline( |
| 244 | "sudo iptables -A INPUT -p tcp -s "+ |
| 245 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 246 | main.ONOS3.handle.sendline( |
| 247 | "sudo iptables -A INPUT -p tcp -s "+ |
| 248 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 249 | main.ONOS4.handle.sendline( |
| 250 | "sudo iptables -A INPUT -p tcp -s "+ |
| 251 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 252 | main.ONOS5.handle.sendline( |
| 253 | "sudo iptables -A INPUT -p tcp -s "+ |
| 254 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 255 | main.ONOS6.handle.sendline( |
| 256 | "sudo iptables -A INPUT -p tcp -s "+ |
| 257 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 258 | main.ONOS7.handle.sendline( |
| 259 | "sudo iptables -A INPUT -p tcp -s "+ |
| 260 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 261 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 262 | #OUTPUT rules |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 263 | main.ONOS1.handle.sendline( |
| 264 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 265 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 266 | main.ONOS2.handle.sendline( |
| 267 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 268 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 269 | main.ONOS3.handle.sendline( |
| 270 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 271 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 272 | main.ONOS4.handle.sendline( |
| 273 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 274 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 275 | main.ONOS5.handle.sendline( |
| 276 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 277 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 278 | main.ONOS6.handle.sendline( |
| 279 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 280 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
| 281 | main.ONOS7.handle.sendline( |
| 282 | "sudo iptables -A OUTPUT -p tcp -s "+ |
| 283 | MN1_ip+" --dport "+default_sw_port+" -j DROP") |
andrewonlab | 0d4478f | 2014-11-11 20:31:20 -0500 | [diff] [blame] | 284 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 285 | main.log.info("Please wait for switch connection to timeout") |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 286 | |
| 287 | |
| 288 | #time.sleep(60) |
| 289 | #if cluster_count >= 3: |
| 290 | # time.sleep(60) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 291 | #if cluster_count >= 5: |
| 292 | # time.sleep(30) |
| 293 | #if cluster_count >= 6: |
| 294 | # time.sleep(30) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 295 | |
| 296 | if cluster_count >= 3: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 297 | main.ONOS1.handle.sendline("tshark -i eth0 -t e | "+ |
| 298 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 299 | "/tmp/syn_ack_onos1_iter"+str(i)+".txt &") |
| 300 | main.ONOS2.handle.sendline("tshark -i eth0 -t e | "+ |
| 301 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 302 | "/tmp/syn_ack_onos2_iter"+str(i)+".txt &") |
| 303 | main.ONOS3.handle.sendline("tshark -i eth0 -t e | "+ |
| 304 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 305 | "/tmp/syn_ack_onos3_iter"+str(i)+".txt &") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 306 | if cluster_count >= 4: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 307 | main.ONOS4.handle.sendline("tshark -i eth0 -t e | "+ |
| 308 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 309 | "/tmp/syn_ack_onos4_iter"+str(i)+".txt &") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 310 | if cluster_count >= 5: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 311 | main.ONOS5.handle.sendline("tshark -i eth0 -t e | "+ |
| 312 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 313 | "/tmp/syn_ack_onos5_iter"+str(i)+".txt &") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 314 | if cluster_count >= 6: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 315 | main.ONOS6.handle.sendline("tshark -i eth0 -t e | "+ |
| 316 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 317 | "/tmp/syn_ack_onos6_iter"+str(i)+".txt &") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 318 | if cluster_count == 7: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 319 | main.ONOS7.handle.sendline("tshark -i eth0 -t e | "+ |
| 320 | "grep 'SYN, ACK' | grep '6633' >"+ |
| 321 | "/tmp/syn_ack_onos6_iter"+str(i)+".txt &") |
| 322 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 323 | loop_count = 0 |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 324 | device_count = 0 |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 325 | while loop_count < 60: |
| 326 | main.log.info("Checking devices for device down") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 327 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 328 | device_str1 = main.ONOS1cli.devices( |
| 329 | node_ip=ONOS_ip_list[1]) |
| 330 | device_json1 = json.loads(device_str1) |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 331 | for device1 in device_json1: |
| 332 | if device1['available'] == False: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 333 | device_count += 1 |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 334 | else: |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 335 | device_count = 0 |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 336 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 337 | #if cluster_count == 1: |
| 338 | # device_str1 = main.ONOS1cli.devices( |
| 339 | # node_ip=ONOS_ip_list[1]) |
| 340 | # device_json1 = json.loads(device_str1) |
| 341 | # for device1 in device_json1: |
| 342 | # if device1['available'] == False: |
| 343 | # device_count += 1 |
| 344 | # else: |
| 345 | # device_count = 0 |
| 346 | #if cluster_count == 2: |
| 347 | # device_str2 = main.ONOS2cli.devices( |
| 348 | # node_ip=ONOS_ip_list[2]) |
| 349 | # device_json2 = json.loads(device_str2) |
| 350 | # for device2 in device_json2: |
| 351 | # if device2['available'] == False: |
| 352 | # device_count += 1 |
| 353 | # else: |
| 354 | # device_count = 0 |
| 355 | #if cluster_count == 3: |
| 356 | # device_str3 = main.ONOS3cli.devices( |
| 357 | # node_ip=ONOS_ip_list[3]) |
| 358 | # device_json3 = json.loads(device_str3) |
| 359 | # for device3 in device_json3: |
| 360 | # if device3['available'] == False: |
| 361 | # device_count += 1 |
| 362 | # else: |
| 363 | # device_count = 0 |
| 364 | #if cluster_count == 4: |
| 365 | # device_str4 = main.ONOS4cli.devices( |
| 366 | # node_ip=ONOS_ip_list[4]) |
| 367 | # device_json4 = json.loads(device_str4) |
| 368 | # for device4 in device_json4: |
| 369 | # if device4['available'] == False: |
| 370 | # device_count += 1 |
| 371 | # else: |
| 372 | # device_count = 0 |
| 373 | #if cluster_count == 5: |
| 374 | # device_str5 = main.ONOS5cli.devices( |
| 375 | # node_ip=ONOS_ip_list[5]) |
| 376 | # device_json5 = json.loads(device_str5) |
| 377 | # for device5 in device_json5: |
| 378 | # if device5['available'] == False: |
| 379 | # device_count += 1 |
| 380 | # else: |
| 381 | # device_count = 0 |
| 382 | #if cluster_count == 7: |
| 383 | # device_str7 = main.ONOS7cli.devices( |
| 384 | # node_ip=ONOS_ip_list[7]) |
| 385 | # device_json7 = json.loads(device_str7) |
| 386 | # for device7 in device_json7: |
| 387 | # if device7['available'] == False: |
| 388 | # device_count += 1 |
| 389 | # else: |
| 390 | # device_count = 0 |
| 391 | |
| 392 | #If device count is greater than the |
| 393 | #number of switches discovered by all nodes |
| 394 | #then remove iptables and measure t0 system time |
| 395 | if device_count\ |
| 396 | >= int(num_sw): |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 397 | main.step("Flushing iptables and obtaining t0") |
| 398 | t0_system = time.time()*1000 |
| 399 | main.ONOS1.handle.sendline("sudo iptables -F") |
| 400 | main.ONOS2.handle.sendline("sudo iptables -F") |
| 401 | main.ONOS3.handle.sendline("sudo iptables -F") |
| 402 | main.ONOS4.handle.sendline("sudo iptables -F") |
| 403 | main.ONOS5.handle.sendline("sudo iptables -F") |
| 404 | main.ONOS6.handle.sendline("sudo iptables -F") |
| 405 | main.ONOS7.handle.sendline("sudo iptables -F") |
| 406 | |
| 407 | break |
| 408 | |
| 409 | time.sleep(1) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 410 | |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 411 | main.log.info("System time t0: "+str(t0_system)) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 412 | |
| 413 | counter_loop = 0 |
| 414 | counter_avail1 = 0 |
| 415 | counter_avail2 = 0 |
| 416 | counter_avail3 = 0 |
| 417 | counter_avail4 = 0 |
| 418 | counter_avail5 = 0 |
| 419 | counter_avail6 = 0 |
| 420 | counter_avail7 = 0 |
| 421 | onos1_dev = False |
| 422 | onos2_dev = False |
| 423 | onos3_dev = False |
| 424 | onos4_dev = False |
| 425 | onos5_dev = False |
| 426 | onos6_dev = False |
| 427 | onos7_dev = False |
| 428 | |
| 429 | #TODO: Think of a more elegant way to check all |
| 430 | # switches across all nodes |
| 431 | #Goodluck debugging this loop |
| 432 | while counter_loop < 60: |
| 433 | for node in range(1, cluster_count+1): |
| 434 | if node == 1 and not onos1_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 435 | main.log.info("Checking node 1 for device "+ |
| 436 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 437 | device_str_obj1 = main.ONOS1cli.devices( |
| 438 | node_ip=ONOS_ip_list[1]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 439 | device_json1 = json.loads(device_str_obj1) |
| 440 | for device1 in device_json1: |
| 441 | if device1['available'] == True: |
| 442 | counter_avail1 += 1 |
| 443 | if counter_avail1 == int(num_sw): |
| 444 | onos1_dev = True |
| 445 | main.log.info("All devices have been"+ |
| 446 | " discovered on ONOS1") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 447 | else: |
| 448 | counter_avail1 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 449 | if node == 2 and not onos2_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 450 | main.log.info("Checking node 2 for device "+ |
| 451 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 452 | device_str_obj2 = main.ONOS2cli.devices( |
| 453 | node_ip=ONOS_ip_list[2]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 454 | device_json2 = json.loads(device_str_obj2) |
| 455 | for device2 in device_json2: |
| 456 | if device2['available'] == True: |
| 457 | counter_avail2 += 1 |
| 458 | if counter_avail2 == int(num_sw): |
| 459 | onos2_dev = True |
| 460 | main.log.info("All devices have been"+ |
| 461 | " discovered on ONOS2") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 462 | else: |
| 463 | counter_avail2 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 464 | if node == 3 and not onos3_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 465 | main.log.info("Checking node 3 for device "+ |
| 466 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 467 | device_str_obj3 = main.ONOS3cli.devices( |
| 468 | node_ip=ONOS_ip_list[3]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 469 | device_json3 = json.loads(device_str_obj3) |
| 470 | for device3 in device_json3: |
| 471 | if device3['available'] == True: |
| 472 | counter_avail3 += 1 |
| 473 | if counter_avail3 == int(num_sw): |
| 474 | onos3_dev = True |
| 475 | main.log.info("All devices have been"+ |
| 476 | " discovered on ONOS3") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 477 | else: |
| 478 | counter_avail3 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 479 | if node == 4 and not onos4_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 480 | main.log.info("Checking node 4 for device "+ |
| 481 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 482 | device_str_obj4 = main.ONOS4cli.devices( |
| 483 | node_ip=ONOS_ip_list[4]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 484 | device_json4 = json.loads(device_str_obj4) |
| 485 | for device4 in device_json4: |
| 486 | if device4['available'] == True: |
| 487 | counter_avail4 += 1 |
| 488 | if counter_avail4 == int(num_sw): |
| 489 | onos4_dev = True |
| 490 | main.log.info("All devices have been"+ |
| 491 | " discovered on ONOS4") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 492 | else: |
| 493 | counter_avail4 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 494 | if node == 5 and not onos5_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 495 | main.log.info("Checking node 5 for device "+ |
| 496 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 497 | device_str_obj5 = main.ONOS5cli.devices( |
| 498 | node_ip=ONOS_ip_list[5]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 499 | device_json5 = json.loads(device_str_obj5) |
| 500 | for device5 in device_json5: |
| 501 | if device5['available'] == True: |
| 502 | counter_avail5 += 1 |
| 503 | if counter_avail5 == int(num_sw): |
| 504 | onos5_dev = True |
| 505 | main.log.info("All devices have been"+ |
| 506 | " discovered on ONOS5") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 507 | else: |
| 508 | counter_avail5 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 509 | if node == 6 and not onos6_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 510 | main.log.info("Checking node 6 for device "+ |
| 511 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 512 | device_str_obj6 = main.ONOS6cli.devices( |
| 513 | node_ip=ONOS_ip_list[6]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 514 | device_json6 = json.loads(device_str_obj6) |
| 515 | for device6 in device_json6: |
| 516 | if device6['available'] == True: |
| 517 | counter_avail6 += 1 |
| 518 | if counter_avail6 == int(num_sw): |
| 519 | onos6_dev = True |
| 520 | main.log.info("All devices have been"+ |
| 521 | " discovered on ONOS6") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 522 | else: |
| 523 | counter_avail6 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 524 | if node == 7 and not onos7_dev: |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 525 | main.log.info("Checking node 7 for device "+ |
| 526 | "discovery") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 527 | device_str_obj7 = main.ONOS7cli.devices( |
| 528 | node_ip=ONOS_ip_list[7]) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 529 | device_json7 = json.loads(device_str_obj7) |
| 530 | for device7 in device_json7: |
| 531 | if device7['available'] == True: |
| 532 | counter_avail7 += 1 |
| 533 | if counter_avail7 == int(num_sw): |
| 534 | onos7_dev = True |
| 535 | main.log.info("All devices have been"+ |
| 536 | " discovered on ONOS7") |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 537 | else: |
| 538 | counter_avail7 = 0 |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 539 | #END node loop |
| 540 | |
| 541 | #TODO: clean up this mess of an if statements if possible |
| 542 | #Treat each if as a separate test case with the given |
| 543 | # cluster count. Hence when the cluster count changes |
| 544 | # the desired calculations will be made |
| 545 | if cluster_count == 1: |
| 546 | if onos1_dev: |
| 547 | main.log.info("All devices have been discovered"+ |
| 548 | " on all ONOS instances") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 549 | time.sleep(5) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 550 | json_str_metrics_1 =\ |
| 551 | main.ONOS1cli.topology_events_metrics() |
| 552 | json_obj_1 = json.loads(json_str_metrics_1) |
| 553 | graph_timestamp_1 =\ |
| 554 | json_obj_1[graphTimestamp]['value'] |
| 555 | |
| 556 | graph_lat_1 = \ |
| 557 | int(graph_timestamp_1) - int(t0_system) |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 558 | |
| 559 | main.log.info("Graph Timestamp ONOS1: "+ |
| 560 | str(graph_timestamp_1)) |
| 561 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 562 | if graph_lat_1 > sw_disc_threshold_min\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 563 | and graph_lat_1 < sw_disc_threshold_max\ |
| 564 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 565 | sw_discovery_lat_list.append( |
| 566 | graph_lat_1) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 567 | main.log.info("Sw discovery latency of "+ |
| 568 | str(cluster_count)+" node(s): "+ |
| 569 | str(graph_lat_1)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 570 | else: |
| 571 | main.log.info("Switch discovery latency "+ |
| 572 | "exceeded the threshold.") |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 573 | main.log.info(graph_lat_1) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 574 | #Break while loop |
| 575 | break |
| 576 | if cluster_count == 2: |
| 577 | if onos1_dev and onos2_dev: |
| 578 | main.log.info("All devices have been discovered"+ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 579 | " on all "+str(cluster_count)+ |
| 580 | " ONOS instances") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 581 | time.sleep(5) |
| 582 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 583 | json_str_metrics_1 =\ |
| 584 | main.ONOS1cli.topology_events_metrics() |
| 585 | json_str_metrics_2 =\ |
| 586 | main.ONOS2cli.topology_events_metrics() |
| 587 | json_obj_1 = json.loads(json_str_metrics_1) |
| 588 | json_obj_2 = json.loads(json_str_metrics_2) |
| 589 | graph_timestamp_1 =\ |
| 590 | json_obj_1[graphTimestamp]['value'] |
| 591 | graph_timestamp_2 =\ |
| 592 | json_obj_2[graphTimestamp]['value'] |
| 593 | |
| 594 | graph_lat_1 = \ |
| 595 | int(graph_timestamp_1) - int(t0_system) |
| 596 | graph_lat_2 = \ |
| 597 | int(graph_timestamp_2) - int(t0_system) |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 598 | |
| 599 | main.log.info("Graph Timestamp ONOS1: "+ |
| 600 | str(graph_timestamp_1)) |
| 601 | main.log.info("Graph Timestamp ONOS2: "+ |
| 602 | str(graph_timestamp_2)) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 603 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 604 | max_graph_lat = max(graph_lat_1, |
| 605 | graph_lat_2, graph_lat_3) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 606 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 607 | if max_graph_lat > sw_disc_threshold_min\ |
| 608 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 609 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 610 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 611 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 612 | main.log.info("Sw discovery latency of "+ |
| 613 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 614 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 615 | else: |
| 616 | main.log.info("Switch discovery latency "+ |
| 617 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 618 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 619 | break |
| 620 | if cluster_count == 3: |
| 621 | if onos1_dev and onos2_dev and onos3_dev: |
| 622 | main.log.info("All devices have been discovered"+ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 623 | " on all "+str(cluster_count)+ |
| 624 | " ONOS instances") |
| 625 | |
| 626 | #TODO: Investigate this sleep |
| 627 | # added to 'pad' the results with |
| 628 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 629 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 630 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 631 | json_str_metrics_1 =\ |
| 632 | main.ONOS1cli.topology_events_metrics() |
| 633 | json_str_metrics_2 =\ |
| 634 | main.ONOS2cli.topology_events_metrics() |
| 635 | json_str_metrics_3 =\ |
| 636 | main.ONOS3cli.topology_events_metrics() |
| 637 | json_obj_1 = json.loads(json_str_metrics_1) |
| 638 | json_obj_2 = json.loads(json_str_metrics_2) |
| 639 | json_obj_3 = json.loads(json_str_metrics_3) |
| 640 | graph_timestamp_1 =\ |
| 641 | json_obj_1[graphTimestamp]['value'] |
| 642 | graph_timestamp_2 =\ |
| 643 | json_obj_2[graphTimestamp]['value'] |
| 644 | graph_timestamp_3 =\ |
| 645 | json_obj_3[graphTimestamp]['value'] |
| 646 | |
| 647 | graph_lat_1 = \ |
| 648 | int(graph_timestamp_1) - int(t0_system) |
| 649 | graph_lat_2 = \ |
| 650 | int(graph_timestamp_2) - int(t0_system) |
| 651 | graph_lat_3 = \ |
| 652 | int(graph_timestamp_3) - int(t0_system) |
| 653 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 654 | main.log.info("Graph Timestamp ONOS1: "+ |
| 655 | str(graph_timestamp_1)) |
| 656 | main.log.info("Graph Timestamp ONOS2: "+ |
| 657 | str(graph_timestamp_2)) |
| 658 | main.log.info("Graph Timestamp ONOS3: "+ |
| 659 | str(graph_timestamp_3)) |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 660 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 661 | max_graph_lat = max(graph_lat_1, |
| 662 | graph_lat_2, |
| 663 | graph_lat_3) |
| 664 | |
| 665 | if max_graph_lat > sw_disc_threshold_min\ |
| 666 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 667 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 668 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 669 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 670 | main.log.info("Sw discovery latency of "+ |
| 671 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 672 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 673 | else: |
| 674 | main.log.info("Switch discovery latency "+ |
| 675 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 676 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 677 | |
| 678 | break |
| 679 | if cluster_count == 4: |
| 680 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 681 | onos4_dev: |
| 682 | main.log.info("All devices have been discovered"+ |
| 683 | " on all ONOS instances") |
| 684 | json_str_metrics_1 =\ |
| 685 | main.ONOS1cli.topology_events_metrics() |
| 686 | json_str_metrics_2 =\ |
| 687 | main.ONOS2cli.topology_events_metrics() |
| 688 | json_str_metrics_3 =\ |
| 689 | main.ONOS3cli.topology_events_metrics() |
| 690 | json_str_metrics_4 =\ |
| 691 | main.ONOS4cli.topology_events_metrics() |
| 692 | json_obj_1 = json.loads(json_str_metrics_1) |
| 693 | json_obj_2 = json.loads(json_str_metrics_2) |
| 694 | json_obj_3 = json.loads(json_str_metrics_3) |
| 695 | json_obj_4 = json.loads(json_str_metrics_4) |
| 696 | graph_timestamp_1 =\ |
| 697 | json_obj_1[graphTimestamp]['value'] |
| 698 | graph_timestamp_2 =\ |
| 699 | json_obj_2[graphTimestamp]['value'] |
| 700 | graph_timestamp_3 =\ |
| 701 | json_obj_3[graphTimestamp]['value'] |
| 702 | graph_timestamp_4 =\ |
| 703 | json_obj_4[graphTimestamp]['value'] |
| 704 | |
| 705 | graph_lat_1 = \ |
| 706 | int(graph_timestamp_1) - int(t0_system) |
| 707 | graph_lat_2 = \ |
| 708 | int(graph_timestamp_2) - int(t0_system) |
| 709 | graph_lat_3 = \ |
| 710 | int(graph_timestamp_3) - int(t0_system) |
| 711 | graph_lat_4 = \ |
| 712 | int(graph_timestamp_4) - int(t0_system) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 713 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 714 | main.log.info("Graph Timestamp ONOS1: "+ |
| 715 | str(graph_timestamp_1)) |
| 716 | main.log.info("Graph Timestamp ONOS2: "+ |
| 717 | str(graph_timestamp_2)) |
| 718 | main.log.info("Graph Timestamp ONOS3: "+ |
| 719 | str(graph_timestamp_3)) |
| 720 | main.log.info("Graph Timestamp ONOS4: "+ |
| 721 | str(graph_timestamp_4)) |
| 722 | |
| 723 | max_graph_lat = max(graph_lat_1, |
| 724 | graph_lat_2, |
| 725 | graph_lat_3, |
| 726 | graph_lat_4) |
| 727 | |
| 728 | if max_graph_lat > sw_disc_threshold_min\ |
| 729 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 730 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 731 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 732 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 733 | main.log.info("Sw discovery latency of "+ |
| 734 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 735 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 736 | else: |
| 737 | main.log.info("Switch discovery latency "+ |
| 738 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 739 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 740 | |
| 741 | break |
| 742 | if cluster_count == 5: |
| 743 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 744 | onos4_dev and onos5_dev: |
| 745 | main.log.info("All devices have been discovered"+ |
| 746 | " on all ONOS instances") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 747 | |
| 748 | #TODO: Investigate this sleep |
| 749 | # added to 'pad' the results with |
| 750 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 751 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 752 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 753 | json_str_metrics_1 =\ |
| 754 | main.ONOS1cli.topology_events_metrics() |
| 755 | json_str_metrics_2 =\ |
| 756 | main.ONOS2cli.topology_events_metrics() |
| 757 | json_str_metrics_3 =\ |
| 758 | main.ONOS3cli.topology_events_metrics() |
| 759 | json_str_metrics_4 =\ |
| 760 | main.ONOS4cli.topology_events_metrics() |
| 761 | json_str_metrics_5 =\ |
| 762 | main.ONOS5cli.topology_events_metrics() |
| 763 | json_obj_1 = json.loads(json_str_metrics_1) |
| 764 | json_obj_2 = json.loads(json_str_metrics_2) |
| 765 | json_obj_3 = json.loads(json_str_metrics_3) |
| 766 | json_obj_4 = json.loads(json_str_metrics_4) |
| 767 | json_obj_5 = json.loads(json_str_metrics_5) |
| 768 | graph_timestamp_1 =\ |
| 769 | json_obj_1[graphTimestamp]['value'] |
| 770 | graph_timestamp_2 =\ |
| 771 | json_obj_2[graphTimestamp]['value'] |
| 772 | graph_timestamp_3 =\ |
| 773 | json_obj_3[graphTimestamp]['value'] |
| 774 | graph_timestamp_4 =\ |
| 775 | json_obj_4[graphTimestamp]['value'] |
| 776 | graph_timestamp_5 =\ |
| 777 | json_obj_5[graphTimestamp]['value'] |
| 778 | |
| 779 | graph_lat_1 = \ |
| 780 | int(graph_timestamp_1) - int(t0_system) |
| 781 | graph_lat_2 = \ |
| 782 | int(graph_timestamp_2) - int(t0_system) |
| 783 | graph_lat_3 = \ |
| 784 | int(graph_timestamp_3) - int(t0_system) |
| 785 | graph_lat_4 = \ |
| 786 | int(graph_timestamp_4) - int(t0_system) |
| 787 | graph_lat_5 = \ |
| 788 | int(graph_timestamp_5) - int(t0_system) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 789 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 790 | main.log.info("Graph Timestamp ONOS1: "+ |
| 791 | str(graph_timestamp_1)) |
| 792 | main.log.info("Graph Timestamp ONOS2: "+ |
| 793 | str(graph_timestamp_2)) |
| 794 | main.log.info("Graph Timestamp ONOS3: "+ |
| 795 | str(graph_timestamp_3)) |
| 796 | main.log.info("Graph Timestamp ONOS4: "+ |
| 797 | str(graph_timestamp_4)) |
| 798 | main.log.info("Graph Timestamp ONOS5: "+ |
| 799 | str(graph_timestamp_5)) |
| 800 | |
| 801 | max_graph_lat = max(graph_lat_1, |
| 802 | graph_lat_2, |
| 803 | graph_lat_3, |
| 804 | graph_lat_4, |
| 805 | graph_lat_5) |
| 806 | |
| 807 | if max_graph_lat > sw_disc_threshold_min\ |
| 808 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 809 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 810 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 811 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 812 | main.log.info("Sw discovery latency of "+ |
| 813 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 814 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 815 | else: |
| 816 | main.log.info("Switch discovery latency "+ |
| 817 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 818 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 819 | |
| 820 | break |
| 821 | if cluster_count == 6: |
| 822 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 823 | onos4_dev and onos5_dev and onos6_dev: |
| 824 | main.log.info("All devices have been discovered"+ |
| 825 | " on all ONOS instances") |
| 826 | json_str_metrics_1 =\ |
| 827 | main.ONOS1cli.topology_events_metrics() |
| 828 | json_str_metrics_2 =\ |
| 829 | main.ONOS2cli.topology_events_metrics() |
| 830 | json_str_metrics_3 =\ |
| 831 | main.ONOS3cli.topology_events_metrics() |
| 832 | json_str_metrics_4 =\ |
| 833 | main.ONOS4cli.topology_events_metrics() |
| 834 | json_str_metrics_5 =\ |
| 835 | main.ONOS5cli.topology_events_metrics() |
| 836 | json_str_metrics_6 =\ |
| 837 | main.ONOS6cli.topology_events_metrics() |
| 838 | json_obj_1 = json.loads(json_str_metrics_1) |
| 839 | json_obj_2 = json.loads(json_str_metrics_2) |
| 840 | json_obj_3 = json.loads(json_str_metrics_3) |
| 841 | json_obj_4 = json.loads(json_str_metrics_4) |
| 842 | json_obj_5 = json.loads(json_str_metrics_5) |
| 843 | json_obj_6 = json.loads(json_str_metrics_6) |
| 844 | graph_timestamp_1 =\ |
| 845 | json_obj_1[graphTimestamp]['value'] |
| 846 | graph_timestamp_2 =\ |
| 847 | json_obj_2[graphTimestamp]['value'] |
| 848 | graph_timestamp_3 =\ |
| 849 | json_obj_3[graphTimestamp]['value'] |
| 850 | graph_timestamp_4 =\ |
| 851 | json_obj_4[graphTimestamp]['value'] |
| 852 | graph_timestamp_5 =\ |
| 853 | json_obj_5[graphTimestamp]['value'] |
| 854 | graph_timestamp_6 =\ |
| 855 | json_obj_6[graphTimestamp]['value'] |
| 856 | |
| 857 | graph_lat_1 = \ |
| 858 | int(graph_timestamp_1) - int(t0_system) |
| 859 | graph_lat_2 = \ |
| 860 | int(graph_timestamp_2) - int(t0_system) |
| 861 | graph_lat_3 = \ |
| 862 | int(graph_timestamp_3) - int(t0_system) |
| 863 | graph_lat_4 = \ |
| 864 | int(graph_timestamp_4) - int(t0_system) |
| 865 | graph_lat_5 = \ |
| 866 | int(graph_timestamp_5) - int(t0_system) |
| 867 | graph_lat_6 = \ |
| 868 | int(graph_timestamp_6) - int(t0_system) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 869 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 870 | main.log.info("Graph Timestamp ONOS1: "+ |
| 871 | str(graph_timestamp_1)) |
| 872 | main.log.info("Graph Timestamp ONOS2: "+ |
| 873 | str(graph_timestamp_2)) |
| 874 | main.log.info("Graph Timestamp ONOS3: "+ |
| 875 | str(graph_timestamp_3)) |
| 876 | main.log.info("Graph Timestamp ONOS4: "+ |
| 877 | str(graph_timestamp_4)) |
| 878 | main.log.info("Graph Timestamp ONOS5: "+ |
| 879 | str(graph_timestamp_5)) |
| 880 | main.log.info("Graph Timestamp ONOS6: "+ |
| 881 | str(graph_timestamp_6)) |
| 882 | |
| 883 | max_graph_lat = max(graph_lat_1, |
| 884 | graph_lat_2, |
| 885 | graph_lat_3, |
| 886 | graph_lat_4, |
| 887 | graph_lat_5, |
| 888 | graph_lat_6) |
| 889 | |
| 890 | if max_graph_lat > sw_disc_threshold_min\ |
| 891 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 892 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 893 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 894 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 895 | main.log.info("Sw discovery latency of "+ |
| 896 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 897 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 898 | else: |
| 899 | main.log.info("Switch discovery latency "+ |
| 900 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 901 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 902 | |
| 903 | break |
| 904 | if cluster_count == 7: |
| 905 | if onos1_dev and onos2_dev and onos3_dev and\ |
| 906 | onos4_dev and onos5_dev and onos6_dev and\ |
| 907 | onos7_dev: |
| 908 | main.log.info("All devices have been discovered"+ |
| 909 | " on all ONOS instances") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 910 | |
| 911 | #TODO: Investigate this sleep |
| 912 | # added to 'pad' the results with |
| 913 | # plenty of time to 'catch up' |
andrewonlab | 6274902 | 2014-11-19 19:19:58 -0500 | [diff] [blame] | 914 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 915 | |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 916 | json_str_metrics_1 =\ |
| 917 | main.ONOS1cli.topology_events_metrics() |
| 918 | json_str_metrics_2 =\ |
| 919 | main.ONOS2cli.topology_events_metrics() |
| 920 | json_str_metrics_3 =\ |
| 921 | main.ONOS3cli.topology_events_metrics() |
| 922 | json_str_metrics_4 =\ |
| 923 | main.ONOS4cli.topology_events_metrics() |
| 924 | json_str_metrics_5 =\ |
| 925 | main.ONOS5cli.topology_events_metrics() |
| 926 | json_str_metrics_6 =\ |
| 927 | main.ONOS6cli.topology_events_metrics() |
| 928 | json_str_metrics_7 =\ |
| 929 | main.ONOS7cli.topology_events_metrics() |
| 930 | json_obj_1 = json.loads(json_str_metrics_1) |
| 931 | json_obj_2 = json.loads(json_str_metrics_2) |
| 932 | json_obj_3 = json.loads(json_str_metrics_3) |
| 933 | json_obj_4 = json.loads(json_str_metrics_4) |
| 934 | json_obj_5 = json.loads(json_str_metrics_5) |
| 935 | json_obj_6 = json.loads(json_str_metrics_6) |
| 936 | json_obj_7 = json.loads(json_str_metrics_7) |
| 937 | graph_timestamp_1 =\ |
| 938 | json_obj_1[graphTimestamp]['value'] |
| 939 | graph_timestamp_2 =\ |
| 940 | json_obj_2[graphTimestamp]['value'] |
| 941 | graph_timestamp_3 =\ |
| 942 | json_obj_3[graphTimestamp]['value'] |
| 943 | graph_timestamp_4 =\ |
| 944 | json_obj_4[graphTimestamp]['value'] |
| 945 | graph_timestamp_5 =\ |
| 946 | json_obj_5[graphTimestamp]['value'] |
| 947 | graph_timestamp_6 =\ |
| 948 | json_obj_6[graphTimestamp]['value'] |
| 949 | graph_timestamp_7 =\ |
| 950 | json_obj_7[graphTimestamp]['value'] |
| 951 | |
| 952 | graph_lat_1 = \ |
| 953 | int(graph_timestamp_1) - int(t0_system) |
| 954 | graph_lat_2 = \ |
| 955 | int(graph_timestamp_2) - int(t0_system) |
| 956 | graph_lat_3 = \ |
| 957 | int(graph_timestamp_3) - int(t0_system) |
| 958 | graph_lat_4 = \ |
| 959 | int(graph_timestamp_4) - int(t0_system) |
| 960 | graph_lat_5 = \ |
| 961 | int(graph_timestamp_5) - int(t0_system) |
| 962 | graph_lat_6 = \ |
| 963 | int(graph_timestamp_6) - int(t0_system) |
| 964 | graph_lat_7 = \ |
| 965 | int(graph_timestamp_7) - int(t0_system) |
| 966 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 967 | main.log.info("Graph Timestamp ONOS1: "+ |
| 968 | str(graph_timestamp_1)) |
| 969 | main.log.info("Graph Timestamp ONOS2: "+ |
| 970 | str(graph_timestamp_2)) |
| 971 | main.log.info("Graph Timestamp ONOS3: "+ |
| 972 | str(graph_timestamp_3)) |
| 973 | main.log.info("Graph Timestamp ONOS4: "+ |
| 974 | str(graph_timestamp_4)) |
| 975 | main.log.info("Graph Timestamp ONOS5: "+ |
| 976 | str(graph_timestamp_5)) |
| 977 | main.log.info("Graph Timestamp ONOS6: "+ |
| 978 | str(graph_timestamp_6)) |
| 979 | main.log.info("Graph Timestamp ONOS7: "+ |
| 980 | str(graph_timestamp_7)) |
| 981 | |
| 982 | max_graph_lat = max(graph_lat_1, |
| 983 | graph_lat_2, |
| 984 | graph_lat_3, |
| 985 | graph_lat_4, |
| 986 | graph_lat_5, |
| 987 | graph_lat_6, |
| 988 | graph_lat_7) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 989 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 990 | if max_graph_lat > sw_disc_threshold_min\ |
| 991 | and max_graph_lat < sw_disc_threshold_max\ |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 992 | and int(i) > iter_ignore: |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 993 | sw_discovery_lat_list.append( |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 994 | max_graph_lat) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 995 | main.log.info("Sw discovery latency of "+ |
| 996 | str(cluster_count)+" node(s): "+ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 997 | str(max_graph_lat)+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 998 | else: |
| 999 | main.log.info("Switch discovery latency "+ |
| 1000 | "exceeded the threshold.") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1001 | main.log.info(max_graph_lat) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 1002 | |
| 1003 | break |
| 1004 | |
| 1005 | counter_loop += 1 |
| 1006 | time.sleep(3) |
| 1007 | #END WHILE LOOP |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1008 | |
| 1009 | main.ONOS1.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1010 | syn_ack_timestamp_list = [] |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1011 | if cluster_count < 3: |
| 1012 | #TODO: capture synack on nodes less than 3 |
| 1013 | syn_ack_timestamp_list.append(0) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1014 | |
| 1015 | if cluster_count >= 3: |
| 1016 | main.ONOS2.tshark_stop() |
| 1017 | main.ONOS3.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1018 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1019 | os.system("scp "+ONOS_user+"@"+ONOS1_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1020 | "/tmp/syn_ack_onos1_iter"+str(i)+".txt /tmp/") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1021 | os.system("scp "+ONOS_user+"@"+ONOS2_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1022 | "/tmp/syn_ack_onos2_iter"+str(i)+".txt /tmp/") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1023 | os.system("scp "+ONOS_user+"@"+ONOS3_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1024 | "/tmp/syn_ack_onos3_iter"+str(i)+".txt /tmp/") |
| 1025 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1026 | #Read each of the files and append all |
| 1027 | #SYN / ACK timestamps to the list |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1028 | with open("/tmp/syn_ack_onos1_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1029 | f_onos1: |
| 1030 | for line in f_onos1: |
| 1031 | line = line.split(" ") |
| 1032 | syn_ack_timestamp_list.append(line[1]) |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1033 | with open("/tmp/syn_ack_onos2_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1034 | f_onos2: |
| 1035 | for line in f_onos2: |
| 1036 | line = line.split(" ") |
| 1037 | syn_ack_timestamp_list.append(line[1]) |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1038 | with open("/tmp/syn_ack_onos3_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1039 | f_onos3: |
| 1040 | for line in f_onos3: |
| 1041 | line = line.split(" ") |
| 1042 | syn_ack_timestamp_list.append(line[1]) |
| 1043 | if cluster_count >= 4: |
| 1044 | main.ONOS4.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1045 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1046 | os.system("scp "+ONOS_user+"@"+ONOS4_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1047 | "/tmp/syn_ack_onos4_iter"+str(i)+".txt /tmp/") |
| 1048 | time.sleep(5) |
| 1049 | with open("/tmp/syn_ack_onos4_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1050 | f_onos4: |
| 1051 | for line in f_onos4: |
| 1052 | line = line.split(" ") |
| 1053 | syn_ack_timestamp_list.append(line[1]) |
| 1054 | if cluster_count >= 5: |
| 1055 | main.ONOS5.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1056 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1057 | os.system("scp "+ONOS_user+"@"+ONOS5_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1058 | "/tmp/syn_ack_onos5_iter"+str(i)+".txt /tmp/") |
| 1059 | time.sleep(5) |
| 1060 | with open("/tmp/syn_ack_onos5_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1061 | f_onos5: |
| 1062 | for line in f_onos5: |
| 1063 | line = line.split(" ") |
| 1064 | syn_ack_timestamp_list.append(line[1]) |
| 1065 | if cluster_count >= 6: |
| 1066 | main.ONOS6.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1067 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1068 | os.system("scp "+ONOS_user+"@"+ONOS6_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1069 | "/tmp/syn_ack_onos6_iter"+str(i)+".txt /tmp/") |
| 1070 | time.sleep(5) |
| 1071 | with open("/tmp/syn_ack_onos6_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1072 | f_onos6: |
| 1073 | for line in f_onos6: |
| 1074 | line = line.split(" ") |
| 1075 | syn_ack_timestamp_list.append(line[1]) |
| 1076 | if cluster_count == 7: |
| 1077 | main.ONOS7.tshark_stop() |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1078 | time.sleep(5) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1079 | os.system("scp "+ONOS_user+"@"+ONOS7_ip+":"+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1080 | "/tmp/syn_ack_onos7_iter"+str(i)+".txt /tmp/") |
| 1081 | time.sleep(5) |
| 1082 | with open("/tmp/syn_ack_onos7_iter"+str(i)+".txt") as\ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1083 | f_onos7: |
| 1084 | for line in f_onos7: |
| 1085 | line = line.split(" ") |
| 1086 | syn_ack_timestamp_list.append(line[1]) |
| 1087 | |
| 1088 | #Sort the list by timestamp |
| 1089 | syn_ack_timestamp_list = sorted(syn_ack_timestamp_list) |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1090 | print "syn_ack_-1 " + str(syn_ack_timestamp_list) |
| 1091 | |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1092 | syn_ack_delta =\ |
| 1093 | int(float(syn_ack_timestamp_list[-1])*1000) -\ |
| 1094 | int(float(syn_ack_timestamp_list[0])*1000) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1095 | |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1096 | main.log.info("Switch connection attempt delta iteration "+ |
| 1097 | str(i)+": "+str(syn_ack_delta)) |
| 1098 | syn_ack_delta_list.append(syn_ack_delta) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 1099 | #END ITERATION LOOP |
| 1100 | #REPORT HERE |
| 1101 | |
| 1102 | if len(sw_discovery_lat_list) > 0: |
| 1103 | sw_lat_avg = sum(sw_discovery_lat_list) / \ |
| 1104 | len(sw_discovery_lat_list) |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 1105 | sw_lat_dev = numpy.std(sw_discovery_lat_list) |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 1106 | else: |
| 1107 | assertion = main.FALSE |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1108 | |
| 1109 | main.log.report("Switch connection attempt time avg "+ |
andrewonlab | d784d4f | 2014-11-17 17:47:32 -0500 | [diff] [blame] | 1110 | "(last sw SYN/ACK time - first sw SYN/ACK time) "+ |
andrewonlab | a127217 | 2014-11-17 17:30:35 -0500 | [diff] [blame] | 1111 | str(sum(syn_ack_delta_list)/len(syn_ack_delta_list)) + |
| 1112 | " ms") |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 1113 | main.log.report(str(num_sw)+" Switch discovery lat for "+\ |
| 1114 | str(cluster_count)+" instance(s): ") |
| 1115 | main.log.report("Avg: "+str(sw_lat_avg)+" ms "+ |
| 1116 | "Std Deviation: "+str(round(sw_lat_dev,1))+" ms") |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 1117 | |
| 1118 | utilities.assert_equals(expect=main.TRUE, actual=assertion, |
| 1119 | onpass="Switch discovery convergence latency" +\ |
andrewonlab | fd8325f | 2014-11-12 19:14:06 -0500 | [diff] [blame] | 1120 | " for "+str(cluster_count)+" nodes successful", |
andrewonlab | 51b180b | 2014-11-12 18:19:28 -0500 | [diff] [blame] | 1121 | onfail="Switch discovery convergence latency" +\ |
| 1122 | " test failed") |
| 1123 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1124 | def CASE3(self, main): |
| 1125 | ''' |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 1126 | Increase number of nodes and initiate CLI |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1127 | ''' |
| 1128 | import time |
| 1129 | import subprocess |
| 1130 | import os |
| 1131 | import requests |
| 1132 | import json |
| 1133 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 1134 | ONOS1_ip = main.params['CTRL']['ip1'] |
| 1135 | ONOS2_ip = main.params['CTRL']['ip2'] |
| 1136 | ONOS3_ip = main.params['CTRL']['ip3'] |
| 1137 | ONOS4_ip = main.params['CTRL']['ip4'] |
| 1138 | ONOS5_ip = main.params['CTRL']['ip5'] |
| 1139 | ONOS6_ip = main.params['CTRL']['ip6'] |
| 1140 | ONOS7_ip = main.params['CTRL']['ip7'] |
| 1141 | |
| 1142 | cell_name = main.params['ENV']['cellName'] |
| 1143 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1144 | MN1_ip = main.params['MN']['ip1'] |
| 1145 | BENCH_ip = main.params['BENCH']['ip'] |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 1146 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1147 | #NOTE:We start with cluster_count at 3. The first |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1148 | #case already initialized ONOS1. Increase the |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1149 | #cluster count and start from 3. |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1150 | #You can optionally change the increment to |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1151 | #test steps of node sizes, such as 3,5,7 |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 1152 | |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1153 | global cluster_count |
andrewonlab | 54cec4b | 2014-11-12 13:30:23 -0500 | [diff] [blame] | 1154 | cluster_count += 2 |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 1155 | main.log.report("Increasing cluster size to "+ |
| 1156 | str(cluster_count)) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1157 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1158 | install_result = main.FALSE |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1159 | #Supports up to 7 node configuration |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1160 | #TODO: Cleanup this ridiculous repetitive code |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1161 | if cluster_count == 3: |
| 1162 | install_result = \ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1163 | main.ONOSbench.onos_install(node=ONOS2_ip) |
| 1164 | install_result = \ |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1165 | main.ONOSbench.onos_install(node=ONOS3_ip) |
| 1166 | time.sleep(5) |
| 1167 | main.log.info("Starting CLI") |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1168 | main.ONOS2cli.start_onos_cli(ONOS2_ip) |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1169 | main.ONOS3cli.start_onos_cli(ONOS3_ip) |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1170 | main.ONOS1cli.add_node(ONOS2_ip, ONOS2_ip) |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1171 | main.ONOS1cli.add_node(ONOS3_ip, ONOS3_ip) |
| 1172 | |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1173 | if cluster_count == 4: |
| 1174 | main.log.info("Installing ONOS on node 4") |
| 1175 | install_result = \ |
| 1176 | main.ONOSbench.onos_install(node=ONOS4_ip) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1177 | time.sleep(5) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1178 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1179 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1180 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1181 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1182 | elif cluster_count == 5: |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1183 | main.log.info("Installing ONOS on nodes 4 and 5") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1184 | install_result2 = \ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1185 | main.ONOSbench.onos_install(options="",node=ONOS4_ip) |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1186 | install_result3 = \ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1187 | main.ONOSbench.onos_install(options="",node=ONOS5_ip) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1188 | time.sleep(5) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1189 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1190 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 1191 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1192 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1193 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1194 | install_result = install_result2 and install_result3 |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1195 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1196 | elif cluster_count == 6: |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1197 | main.log.info("Installing ONOS on nodes 4, 5,and 6") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1198 | install_result1 = \ |
| 1199 | main.ONOSbench.onos_install(options="",node=ONOS4_ip) |
| 1200 | install_result2 = \ |
| 1201 | main.ONOSbench.onos_install(options="",node=ONOS5_ip) |
| 1202 | install_result3 = \ |
| 1203 | main.ONOSbench.onos_install(node=ONOS6_ip) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1204 | time.sleep(5) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1205 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1206 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 1207 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
| 1208 | main.ONOS6cli.start_onos_cli(ONOS6_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1209 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1210 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
| 1211 | main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip) |
| 1212 | install_result = install_result1 and install_result2 and\ |
| 1213 | install_result3 |
| 1214 | |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1215 | elif cluster_count == 7: |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1216 | main.log.info("Installing ONOS on nodes 4, 5, 6,and 7") |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1217 | install_result3 = \ |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1218 | main.ONOSbench.onos_install(node=ONOS6_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1219 | install_result4 = \ |
| 1220 | main.ONOSbench.onos_install(node=ONOS7_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1221 | main.log.info("Starting CLI") |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1222 | main.ONOS4cli.start_onos_cli(ONOS4_ip) |
| 1223 | main.ONOS5cli.start_onos_cli(ONOS5_ip) |
| 1224 | main.ONOS6cli.start_onos_cli(ONOS6_ip) |
| 1225 | main.ONOS7cli.start_onos_cli(ONOS7_ip) |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1226 | main.ONOS1cli.add_node(ONOS4_ip, ONOS4_ip) |
| 1227 | main.ONOS1cli.add_node(ONOS5_ip, ONOS5_ip) |
| 1228 | main.ONOS1cli.add_node(ONOS6_ip, ONOS6_ip) |
| 1229 | main.ONOS1cli.add_node(ONOS7_ip, ONOS7_ip) |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1230 | |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1231 | install_result = \ |
andrewonlab | a036b40 | 2014-11-17 13:47:46 -0500 | [diff] [blame] | 1232 | install_result3 and install_result4 |
andrewonlab | 81763ee | 2014-11-13 17:31:34 -0500 | [diff] [blame] | 1233 | |
| 1234 | time.sleep(5) |
andrewonlab | add2fd6 | 2014-11-11 18:37:35 -0500 | [diff] [blame] | 1235 | |
andrewonlab | 0cfc7ad | 2014-11-13 16:29:26 -0500 | [diff] [blame] | 1236 | if install_result == main.TRUE: |
| 1237 | assertion = main.TRUE |
| 1238 | else: |
| 1239 | assertion = main.FALSE |
| 1240 | |
| 1241 | utilities.assert_equals(expect=main.TRUE, actual=assertion, |
| 1242 | onpass="Scale out to "+str(cluster_count)+\ |
| 1243 | " nodes successful", |
| 1244 | onfail="Scale out to "+str(cluster_count)+\ |
| 1245 | " nodes failed") |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1246 | |
| 1247 | |
| 1248 | def CASE4(self, main): |
| 1249 | ''' |
| 1250 | Cleanup ONOS nodes and Increase topology size |
| 1251 | ''' |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 1252 | #TODO: use meaningful assertion |
| 1253 | assertion=main.TRUE |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1254 | |
| 1255 | ONOS1_ip = main.params['CTRL']['ip1'] |
| 1256 | ONOS2_ip = main.params['CTRL']['ip2'] |
| 1257 | ONOS3_ip = main.params['CTRL']['ip3'] |
| 1258 | ONOS4_ip = main.params['CTRL']['ip4'] |
| 1259 | ONOS5_ip = main.params['CTRL']['ip5'] |
| 1260 | ONOS6_ip = main.params['CTRL']['ip6'] |
| 1261 | ONOS7_ip = main.params['CTRL']['ip7'] |
| 1262 | MN1_ip = main.params['MN']['ip1'] |
| 1263 | BENCH_ip = main.params['BENCH']['ip'] |
| 1264 | |
| 1265 | main.log.info("Uninstalling previous instances") |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1266 | main.ONOSbench.onos_uninstall(node_ip = ONOS2_ip) |
| 1267 | main.ONOSbench.onos_uninstall(node_ip = ONOS3_ip) |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1268 | main.ONOSbench.onos_uninstall(node_ip = ONOS4_ip) |
| 1269 | main.ONOSbench.onos_uninstall(node_ip = ONOS5_ip) |
| 1270 | main.ONOSbench.onos_uninstall(node_ip = ONOS6_ip) |
| 1271 | main.ONOSbench.onos_uninstall(node_ip = ONOS7_ip) |
| 1272 | |
| 1273 | global topo_iteration |
| 1274 | global cluster_count |
andrewonlab | bdc3d86 | 2014-11-25 12:40:41 -0500 | [diff] [blame^] | 1275 | cluster_count = 3 |
andrewonlab | 5b8c02f | 2014-11-21 17:56:10 -0500 | [diff] [blame] | 1276 | #cluster_count = 1 |
andrewonlab | 7b4e8ba | 2014-11-20 17:45:04 -0500 | [diff] [blame] | 1277 | topo_iteration += 1 |
| 1278 | |
andrewonlab | 0e1825c | 2014-11-20 20:07:00 -0500 | [diff] [blame] | 1279 | main.log.report("Increasing topology size") |
| 1280 | utilities.assert_equals(expect=main.TRUE, actual=assertion, |
| 1281 | onpass="Topology size increased successfully", |
| 1282 | onfail="Topology size was not increased") |