santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1 | #Author: Santhosh Jayashankar |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 2 | class scaleONOS7nodes : |
| 3 | |
| 4 | |
| 5 | |
| 6 | def __init__(self) : |
| 7 | self.default = '' |
| 8 | |
| 9 | # def print_hello_world(self,main): |
| 10 | # print("hello world") |
| 11 | #***************************************************************************************************************************************************************************************** |
| 12 | #Test startup |
| 13 | #Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully |
| 14 | def CASE1(self,main) : #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version |
| 15 | main.case("Initial setup") |
| 16 | main.step("Stop ONOS") |
| 17 | import time |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 18 | main.log.info("Stopping all ONOS nodes...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 19 | main.ONOS1.stop_all() |
| 20 | main.ONOS2.stop_all() |
| 21 | main.ONOS3.stop_all() |
| 22 | # main.print_hello_world() |
| 23 | main.ONOS4.stop_all() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 24 | main.ONOS5.stop_all() |
| 25 | main.ONOS6.stop_all() |
| 26 | main.ONOS7.stop_all() |
| 27 | #main.ONOS2.stop_rest() |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 28 | time.sleep(5) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 29 | #main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 30 | #main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 31 | #main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 32 | #main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 33 | #main.step("Start tcpdump on mn") |
| 34 | #main.Mininet2.start_tcpdump(main.params['tcpdump']['filename'], intf = main.params['tcpdump']['intf'], port = main.params['tcpdump']['port']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 35 | main.step("Starting 3 ONOS nodes...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 36 | main.Zookeeper1.start() |
| 37 | main.Zookeeper2.start() |
| 38 | main.Zookeeper3.start() |
| 39 | main.Zookeeper4.start() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 40 | main.Zookeeper5.start() |
| 41 | main.Zookeeper6.start() |
| 42 | main.Zookeeper7.start() |
| 43 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 44 | time.sleep(5) |
| 45 | |
| 46 | |
| 47 | main.RamCloud1.del_db() |
| 48 | main.RamCloud2.del_db() |
| 49 | main.RamCloud3.del_db() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 50 | # main.RamCloud4.del_db() |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 51 | |
| 52 | time.sleep(5) |
| 53 | #main.log.report("Pulling latest code from github to all nodes") |
| 54 | |
| 55 | """ |
| 56 | for i in range(2): |
| 57 | uptodate = main.ONOS1.git_pull() |
| 58 | main.ONOS2.git_pull() |
| 59 | main.ONOS3.git_pull() |
| 60 | # main.ONOS4.git_pull() |
| 61 | ver1 = main.ONOS1.get_version() |
| 62 | ver2 = main.ONOS3.get_version() |
| 63 | if ver1==ver2: |
| 64 | break |
| 65 | elif i==1: |
| 66 | main.ONOS2.git_pull("ONOS1 master") |
| 67 | main.ONOS3.git_pull("ONOS1 master") |
| 68 | # main.ONOS4.git_pull("ONOS1 master") |
| 69 | if uptodate==0: |
| 70 | # if 1: |
| 71 | main.ONOS1.git_compile() |
| 72 | main.ONOS2.git_compile() |
| 73 | main.ONOS3.git_compile() |
| 74 | # main.ONOS4.git_compile() |
| 75 | main.ONOS1.print_version() |
| 76 | # main.RamCloud1.git_pull() |
| 77 | # main.RamCloud2.git_pull() |
| 78 | # main.RamCloud3.git_pull() |
| 79 | # main.RamCloud4.git_pull() |
| 80 | # main.ONOS1.get_version() |
| 81 | # main.ONOS2.get_version() |
| 82 | # main.ONOS3.get_version() |
| 83 | # main.ONOS4.get_version() |
| 84 | # main.ONOS1.start_all() |
| 85 | # main.ONOS2.start_all() |
| 86 | # main.ONOS3.start_all() |
| 87 | # main.ONOS4.start_all() |
| 88 | |
| 89 | """ |
| 90 | main.RamCloud1.start_coor() |
| 91 | main.RamCloud1.start_serv() |
| 92 | main.RamCloud2.start_serv() |
| 93 | main.RamCloud3.start_serv() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 94 | time.sleep(5) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 95 | main.ONOS1.start() |
| 96 | main.ONOS2.start() |
| 97 | main.ONOS3.start() |
| 98 | #main.ONOS4.start() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 99 | time.sleep(5) |
| 100 | |
| 101 | #main.ONOS1.handle.sendline("./onos.sh core start") |
| 102 | #main.ONOS1.handle.sendline("./onos.sh core start") |
| 103 | #main.ONOS1.handle.sendline("./onos.sh core start") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 104 | |
| 105 | main.ONOS1.start_rest() |
| 106 | main.ONOS2.start_rest() |
| 107 | main.ONOS3.start_rest() |
| 108 | test= main.ONOS2.rest_status() |
| 109 | if test == main.FALSE: |
| 110 | main.ONOS1.start_rest() |
| 111 | main.ONOS1.get_version() |
| 112 | main.log.report("Startup check Zookeeper1, RamCloud1, and ONOS1 connections") |
| 113 | main.step("Testing startup Zookeeper") |
| 114 | data = main.Zookeeper1.isup() and main.Zookeeper2.isup() and main.Zookeeper3.isup() |
| 115 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...") |
| 116 | |
| 117 | main.step("Testing startup RamCloud") |
| 118 | data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv() |
| 119 | if data == main.FALSE: |
| 120 | main.RamCloud1.stop_coor() |
| 121 | main.RamCloud1.stop_serv() |
| 122 | main.RamCloud2.stop_serv() |
| 123 | main.RamCloud3.stop_serv() |
| 124 | # main.RamCloud4.stop_serv() |
| 125 | |
| 126 | time.sleep(5) |
| 127 | main.RamCloud1.start_coor() |
| 128 | main.RamCloud1.start_serv() |
| 129 | main.RamCloud2.start_serv() |
| 130 | main.RamCloud3.start_serv() |
| 131 | # main.RamCloud4.start_serv() |
| 132 | time.sleep(5) |
| 133 | data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv() |
| 134 | |
| 135 | |
| 136 | |
| 137 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...") |
| 138 | |
| 139 | main.step("Testing startup ONOS") |
| 140 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup() |
| 141 | for i in range(3): |
| 142 | if data == main.FALSE: |
| 143 | #main.log.report("Something is funny... restarting ONOS") |
| 144 | #main.ONOS1.stop() |
| 145 | time.sleep(3) |
| 146 | #main.ONOS1.start() |
| 147 | #time.sleep(5) |
| 148 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup() |
| 149 | else: |
| 150 | break |
| 151 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...") |
| 152 | time.sleep(10) |
| 153 | |
| 154 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 155 | def CASE31(self,main): |
| 156 | main.case("Staring SB load with 3 ONOS nodes") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 157 | ip1 = main.params['CTRL']['ip1'] |
| 158 | ip2 = main.params['CTRL']['ip2'] |
| 159 | ip3 = main.params['CTRL']['ip3'] |
| 160 | rate1 = main.params['RATE1'] |
| 161 | run_dur = main.params['RUN_DUR'] |
| 162 | loop = int( main.params['loop']) |
| 163 | port = main.params['port'] |
| 164 | switches_num = main.params['switches_num'] |
| 165 | print loop |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 166 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 167 | sleep_t =int( main.params['sleep_t']) |
| 168 | main.case("Starting SB load on 3 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 169 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 170 | main.log.info("Adding switches and ports.....") |
| 171 | main.Mininet2.handle.expect("Starting SB load....", timeout=400) |
| 172 | main.log.info("Starting SB load....") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 173 | import time |
| 174 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 175 | import math |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 176 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 177 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", 'w').close() |
| 178 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 179 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 180 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 181 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", "a") |
| 182 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 183 | tpval = 0.0 |
| 184 | global tpavg3n |
| 185 | tpavg3n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 186 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 187 | j1 = main.ONOS2.get_json(url1) |
| 188 | j2 = main.ONOS2.get_json(url2) |
| 189 | j3 = main.ONOS2.get_json(url3) |
| 190 | json_str = [] |
| 191 | json_str.append(0) |
| 192 | json_str.append(j1) |
| 193 | json_str.append(j2) |
| 194 | json_str.append(j3) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 195 | #float jval = 0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 196 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "": |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 197 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 198 | #print str(json_str["meters"][4]) |
| 199 | #f.write(str(json_str["meters"][4])) |
| 200 | #f.write('\n') |
| 201 | #time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 202 | for j in range(1,4): |
| 203 | f.write("ONOS" + str(j) + "\n") |
| 204 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 205 | f.write('\t') |
| 206 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 207 | f.write('\t') |
| 208 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 209 | f.write('\t') |
| 210 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 211 | f.write('\t') |
| 212 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 213 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 214 | if j == 3: |
| 215 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 216 | #print tpval |
| 217 | #print ("\n") |
| 218 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 219 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 220 | f.write('\n') |
| 221 | f.write('\n') |
| 222 | |
| 223 | f.write("--------------------------------------------------------------------------------- \n") |
| 224 | time.sleep(sleep_t) |
| 225 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 226 | # print tpval |
| 227 | print("\n") |
| 228 | tpavg3n = round(tpval)/loop |
| 229 | print tpavg3n |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 230 | main.log.report("Topology Event Throughput for 3-node ONOS cluster = " +str(tpavg3n) + " Events/sec") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 231 | main.Mininet2.handle.expect("\$", timeout=900) |
| 232 | # main.Mininet2.handle.sendline("sudo mn -c") |
| 233 | #main.Mininet2.handle.expect("\$") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 234 | # main.Mininet2.handle.expect("\$", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 235 | time.sleep(180) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 236 | |
| 237 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 238 | def CASE32(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 239 | ip1 = main.params['CTRL']['ip1'] |
| 240 | ip2 = main.params['CTRL']['ip2'] |
| 241 | ip3 = main.params['CTRL']['ip3'] |
| 242 | import time |
| 243 | rate2 = main.params['RATE2'] |
| 244 | run_dur = main.params['RUN_DUR'] |
| 245 | loop = int(main.params['loop']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 246 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 247 | sleep_t = int(main.params['sleep_t']) |
| 248 | port = main.params['port'] |
| 249 | switches_num = main.params['switches_num'] |
| 250 | main.case("Starting SB load on 3 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 251 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"") |
| 252 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 253 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"10.128.10.1\" 100 50 1200 \"11\"") |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 254 | main.Mininet2.handle.expect("Starting SB load....", timeout=900 ) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 255 | time.sleep(sleep_init ) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 256 | import json |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 257 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 258 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", 'w').close() |
| 259 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 260 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 261 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 262 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate2", "a") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 263 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 264 | j1 = main.ONOS1.get_json(url1) |
| 265 | j2 = main.ONOS1.get_json(url2) |
| 266 | j3 = main.ONOS1.get_json(url3) |
| 267 | json_str = [] |
| 268 | json_str.append(0) |
| 269 | json_str.append(j1) |
| 270 | json_str.append(j2) |
| 271 | json_str.append(j3) |
| 272 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "": |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 273 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 274 | #print str(json_str["meters"][4]) |
| 275 | #f.write(str(json_str["meters"][4])) |
| 276 | #f.write('\n') |
| 277 | #time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 278 | for j in range(1,4): |
| 279 | f.write("ONOS" + str(j) + "\n") |
| 280 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 281 | f.write('\t') |
| 282 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 283 | f.write('\t') |
| 284 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 285 | f.write('\t') |
| 286 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 287 | f.write('\t') |
| 288 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 289 | f.write('\n') |
| 290 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 291 | f.write('\n') |
| 292 | f.write('\n') |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 293 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 294 | f.write("--------------------------------------------------------------------------------- \n") |
| 295 | time.sleep(sleep_t) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 296 | f.close() |
| 297 | #time.sleep(10) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 298 | main.Mininet2.handle.expect("\$", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 299 | time.sleep(180) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 300 | # main.Mininet2.handle.sendline("sudo mn -c") |
| 301 | #time.sleep(5) |
| 302 | # main.Mininet2.handle.expect("\$", timeout=900) |
| 303 | |
| 304 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 305 | def CASE33(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 306 | |
| 307 | main.case("Starting NB Throughput test") |
| 308 | ip1 = main.params['CTRL']['ip1'] |
| 309 | ip2 = main.params['CTRL']['ip2'] |
| 310 | ip3 = main.params['CTRL']['ip3'] |
| 311 | import time |
| 312 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 313 | int_num = main.params['int_num'] |
| 314 | addrate = main.params['addrate'] |
| 315 | NBdur = main.params['NBdur'] |
| 316 | NBsleep = int(main.params['NBsleep']) |
| 317 | NBsleep_init = int(main.params['NBsleep_init']) |
| 318 | NBloop = int(main.params['NBloop']) |
| 319 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 320 | main.Mininet4.handle.expect("\$") |
| 321 | #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp") |
| 322 | #main.Mininet2.handle.expect("mininet>" , timeout=400) |
| 323 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633") |
| 324 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.1:6633") |
| 325 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.2:6633") |
| 326 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.2:6633") |
| 327 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.3:6633") |
| 328 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633") |
| 329 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.3:6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 330 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 331 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 332 | main.ONOS3.handle.expect("\$") |
| 333 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 334 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 3 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 335 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 336 | time.sleep(NBsleep_init) |
| 337 | #time.sleep(60) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 338 | import json |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 339 | nbtpval = 0.0 |
| 340 | global nbtpavg3n |
| 341 | nbtpavg3n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 342 | |
| 343 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close() |
| 344 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 345 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 346 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 347 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a") |
| 348 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 349 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 350 | j1 = main.ONOS1.get_json(url1) |
| 351 | j2 = main.ONOS1.get_json(url2) |
| 352 | j3 = main.ONOS1.get_json(url3) |
| 353 | json_str = [] |
| 354 | json_str.append(0) |
| 355 | json_str.append(j1) |
| 356 | json_str.append(j2) |
| 357 | json_str.append(j3) |
| 358 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "": |
| 359 | for j in range(1,4): |
| 360 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 361 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 362 | f.write('\t') |
| 363 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 364 | f.write('\t') |
| 365 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 366 | f.write('\t') |
| 367 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 368 | f.write('\t') |
| 369 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 370 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 371 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 372 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 373 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 374 | f.write("--------------------------------------------------------------------------------- \n") |
| 375 | |
| 376 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 377 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 378 | f.write('\t') |
| 379 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 380 | f.write('\t') |
| 381 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 382 | f.write('\t') |
| 383 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 384 | f.write('\t') |
| 385 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 386 | f.write('\n') |
| 387 | f.write('\n') |
| 388 | f.write('\n') |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 389 | if j == 3: |
| 390 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 391 | |
| 392 | f.write("--------------------------------------------------------------------------------- \n") |
| 393 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 394 | time.sleep(NBsleep) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 395 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 396 | print("\n") |
| 397 | nbtpavg3n = round(nbtpval)/NBloop |
| 398 | print nbtpavg3n |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 399 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 400 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 401 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 402 | main.log.report("Intent Throughput for 3-node ONOS cluster = " + str(nbtpavg3n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 403 | |
| 404 | def CASE4(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 405 | |
| 406 | main.case("Starting ONOS scale-up to 4 nodes ") |
| 407 | import time |
| 408 | # main.RamCloud4.start_serv() |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 409 | main.ONOS5.handle.sendline("./onos.sh core stop") |
| 410 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 411 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 412 | |
| 413 | |
| 414 | main.Zookeeper4.start() |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 415 | time.sleep(5) |
| 416 | |
| 417 | main.RamCloud4.del_db() |
| 418 | time.sleep(3) |
| 419 | main.RamCloud4.start_serv() |
| 420 | time.sleep(3) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 421 | main.ONOS4.start() |
| 422 | main.ONOS4.start_rest() |
| 423 | time.sleep(5) |
| 424 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 425 | for i in range(3): |
| 426 | if data == main.FALSE: |
| 427 | #main.log.report("Something is funny... restarting ONOS") |
| 428 | #main.ONOS1.stop() |
| 429 | time.sleep(3) |
| 430 | #main.ONOS1.start() |
| 431 | #time.sleep(5) |
| 432 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 433 | else: |
| 434 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 435 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 4-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 436 | |
| 437 | time.sleep(10) |
| 438 | |
| 439 | def CASE5(self,main): |
| 440 | |
| 441 | main.case("Starting ONOS scale-up/down to 5 nodes ") |
| 442 | import time |
| 443 | # main.RamCloud4.start_serv() |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 444 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 445 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 446 | #pdata = main.ONOS5.isup() |
| 447 | |
| 448 | main.Zookeeper5.start() |
| 449 | time.sleep(5) |
| 450 | |
| 451 | main.RamCloud5.del_db() |
| 452 | time.sleep(3) |
| 453 | main.RamCloud5.start_serv() |
| 454 | time.sleep(3) |
| 455 | main.ONOS5.start() |
| 456 | main.ONOS5.start_rest() |
| 457 | time.sleep(5) |
| 458 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 459 | for i in range(3): |
| 460 | if data == main.FALSE: |
| 461 | #main.log.report("Something is funny... restarting ONOS") |
| 462 | #main.ONOS1.stop() |
| 463 | time.sleep(3) |
| 464 | #main.ONOS1.start() |
| 465 | #time.sleep(5) |
| 466 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 467 | else: |
| 468 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 469 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 5-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 470 | time.sleep(10) |
| 471 | |
| 472 | def CASE6(self,main): |
| 473 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 474 | main.case("Starting ONOS scale-up/down to 6 nodes ") |
| 475 | import time |
| 476 | # main.RamCloud4.start_serv() |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 477 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 478 | #pdata = main.ONOS6.isup() |
| 479 | |
| 480 | main.Zookeeper6.start() |
| 481 | time.sleep(5) |
| 482 | |
| 483 | main.RamCloud6.del_db() |
| 484 | time.sleep(3) |
| 485 | main.RamCloud6.start_serv() |
| 486 | time.sleep(3) |
| 487 | main.ONOS6.start() |
| 488 | main.ONOS6.start_rest() |
| 489 | time.sleep(5) |
| 490 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 491 | for i in range(3): |
| 492 | if data == main.FALSE: |
| 493 | #main.log.report("Something is funny... restarting ONOS") |
| 494 | #main.ONOS1.stop() |
| 495 | time.sleep(3) |
| 496 | #main.ONOS1.start() |
| 497 | #time.sleep(5) |
| 498 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 499 | else: |
| 500 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 501 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 6-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 502 | time.sleep(10) |
| 503 | |
| 504 | def CASE7(self,main): |
| 505 | |
| 506 | main.case("Starting ONOS scale-up/down to 7 nodes ") |
| 507 | import time |
| 508 | # main.RamCloud4.start_serv() |
| 509 | #pdata = main.ONOS7.isup() |
| 510 | |
| 511 | main.Zookeeper7.start() |
| 512 | time.sleep(5) |
| 513 | |
| 514 | main.RamCloud7.del_db() |
| 515 | time.sleep(3) |
| 516 | main.RamCloud7.start_serv() |
| 517 | time.sleep(3) |
| 518 | main.ONOS7.start() |
| 519 | main.ONOS7.start_rest() |
| 520 | time.sleep(5) |
| 521 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 522 | for i in range(3): |
| 523 | if data == main.FALSE: |
| 524 | #main.log.report("Something is funny... restarting ONOS") |
| 525 | #main.ONOS1.stop() |
| 526 | time.sleep(3) |
| 527 | #main.ONOS1.start() |
| 528 | #time.sleep(5) |
| 529 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 530 | else: |
| 531 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 532 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 7-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 533 | time.sleep(10) |
| 534 | |
| 535 | |
| 536 | |
| 537 | def CASE41(self,main): |
| 538 | main.case("Starting SB test for 4 nodes") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 539 | ip1 = main.params['CTRL']['ip1'] |
| 540 | ip2 = main.params['CTRL']['ip2'] |
| 541 | ip3 = main.params['CTRL']['ip3'] |
| 542 | ip4 = main.params['CTRL']['ip4'] |
| 543 | rate1 = main.params['RATE1'] |
| 544 | run_dur = main.params['RUN_DUR'] |
| 545 | loop = int( main.params['loop']) |
| 546 | switches_num = main.params['switches_num'] |
| 547 | port = main.params['port'] |
| 548 | print loop |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 549 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 550 | sleep_t =int( main.params['sleep_t']) |
| 551 | main.case("Starting SB load on 4 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 552 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"") |
| 553 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 554 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 555 | import time |
| 556 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 557 | import math |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 558 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 559 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close() |
| 560 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 561 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 562 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 563 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 564 | tpval = 0.0 |
| 565 | global tpavg4n |
| 566 | tpavg4n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 567 | |
| 568 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a") |
| 569 | #time.sleep(10) |
| 570 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 571 | j1 = main.ONOS2.get_json(url1) |
| 572 | j2 = main.ONOS2.get_json(url2) |
| 573 | j3 = main.ONOS2.get_json(url3) |
| 574 | j4 = main.ONOS2.get_json(url4) |
| 575 | json_str = [] |
| 576 | json_str.append(0) |
| 577 | json_str.append(j1) |
| 578 | json_str.append(j2) |
| 579 | json_str.append(j3) |
| 580 | json_str.append(j4) |
| 581 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "": |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 582 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 583 | #print str(json_str["meters"][4]) |
| 584 | #f.write(str(json_str["meters"][4])) |
| 585 | #f.write('\n') |
| 586 | #time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 587 | for j in range(1,5): |
| 588 | f.write("ONOS" + str(j) + "\n") |
| 589 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 590 | f.write('\t') |
| 591 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 592 | f.write('\t') |
| 593 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 594 | f.write('\t') |
| 595 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 596 | f.write('\t') |
| 597 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 598 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 599 | if j == 3: |
| 600 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 601 | # print tpval |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 602 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 603 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 604 | f.write('\n') |
| 605 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 606 | f.write("--------------------------------------------------------------------------------- \n") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 607 | time.sleep(sleep_t) |
| 608 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 609 | # print tpval |
| 610 | print("\n") |
| 611 | tpavg4n = round(tpval)/loop |
| 612 | print tpavg4n |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 613 | main.log.report("Topology Event Throughput for 4-node ONOS cluster = " + str(tpavg4n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 614 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 615 | #main.Mininet2.handle.expect("\$", timeout=900) |
| 616 | #main.Mininet2.handle.sendline("sudo mn -c") |
| 617 | #main.Mininet2.handle.expect("\$") |
| 618 | time.sleep(5) |
| 619 | main.Mininet2.handle.expect("\$", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 620 | time.sleep(180) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 621 | |
| 622 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 623 | def CASE42(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 624 | |
| 625 | ip1 = main.params['CTRL']['ip1'] |
| 626 | ip2 = main.params['CTRL']['ip2'] |
| 627 | ip3 = main.params['CTRL']['ip3'] |
| 628 | ip4 = main.params['CTRL']['ip4'] |
| 629 | |
| 630 | import time |
| 631 | import json |
| 632 | rate2 = main.params['RATE2'] |
| 633 | run_dur = main.params['RUN_DUR'] |
| 634 | loop = int(main.params['loop']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 635 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 636 | sleep_t = int(main.params['sleep_t']) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 637 | switches_num = main.params['switches_num'] |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 638 | port = main.params['port'] |
| 639 | main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 640 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"") |
| 641 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur) |
| 642 | main.Mininet2.handle.expect("Starting SB load....", timeout=900 ) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 643 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 644 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", 'w').close() |
| 645 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 646 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 647 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 648 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 649 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate2", "a") |
| 650 | #time.sleep(10) |
| 651 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 652 | j1 = main.ONOS2.get_json(url1) |
| 653 | j2 = main.ONOS2.get_json(url2) |
| 654 | j3 = main.ONOS2.get_json(url3) |
| 655 | j4 = main.ONOS2.get_json(url4) |
| 656 | json_str = [] |
| 657 | json_str.append(0) |
| 658 | json_str.append(j1) |
| 659 | json_str.append(j2) |
| 660 | json_str.append(j3) |
| 661 | json_str.append(j4) |
| 662 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "": |
| 663 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 664 | #print str(json_str["meters"][4]) |
| 665 | #f.write(str(json_str["meters"][4])) |
| 666 | #f.write('\n') |
| 667 | #time.sleep(3) |
| 668 | for j in range(1,5): |
| 669 | f.write("ONOS" + str(j) + "\n") |
| 670 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 671 | f.write('\t') |
| 672 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 673 | f.write('\t') |
| 674 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 675 | f.write('\t') |
| 676 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 677 | f.write('\t') |
| 678 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 679 | f.write('\n') |
| 680 | |
| 681 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 682 | f.write('\n') |
| 683 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 684 | f.write("--------------------------------------------------------------------------------- \n") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 685 | time.sleep(sleep_t) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 686 | f.close() |
| 687 | time.sleep(180) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 688 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 689 | def CASE43(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 690 | |
| 691 | main.case("Starting NB Throughput test after scaling up to 4 onos nodes") |
| 692 | ip1 = main.params['CTRL']['ip1'] |
| 693 | ip2 = main.params['CTRL']['ip2'] |
| 694 | ip3 = main.params['CTRL']['ip3'] |
| 695 | ip4 = main.params['CTRL']['ip4'] |
| 696 | |
| 697 | import time |
| 698 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 699 | int_num = main.params['int_num'] |
| 700 | addrate = main.params['addrate'] |
| 701 | NBdur = main.params['NBdur'] |
| 702 | NBsleep = int(main.params['NBsleep']) |
| 703 | NBsleep_init = int(main.params['NBsleep_init']) |
| 704 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 705 | nbtpval = 0.0 |
| 706 | global nbtpavg4n |
| 707 | nbtpavg4n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 708 | |
| 709 | main.Mininet4.handle.expect("\$") |
| 710 | #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp") |
| 711 | #main.Mininet2.handle.expect("mininet>" , timeout=400) |
| 712 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633") |
| 713 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633") |
| 714 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633") |
| 715 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633") |
| 716 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.1:6633") |
| 717 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.2:6633") |
| 718 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.4:6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 719 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 720 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 721 | main.ONOS3.handle.expect("\$") |
| 722 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 723 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 4 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 724 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 725 | |
| 726 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 727 | time.sleep(NBsleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 728 | import json |
| 729 | |
| 730 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close() |
| 731 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 732 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 733 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 734 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 735 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a") |
| 736 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 737 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 738 | j1 = main.ONOS2.get_json(url1) |
| 739 | j2 = main.ONOS2.get_json(url2) |
| 740 | j3 = main.ONOS2.get_json(url3) |
| 741 | j4 = main.ONOS2.get_json(url4) |
| 742 | json_str = [] |
| 743 | json_str.append(0) |
| 744 | json_str.append(j1) |
| 745 | json_str.append(j2) |
| 746 | json_str.append(j3) |
| 747 | json_str.append(j4) |
| 748 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "": |
| 749 | for j in range(1,5): |
| 750 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 751 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 752 | f.write('\t') |
| 753 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 754 | f.write('\t') |
| 755 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 756 | f.write('\t') |
| 757 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 758 | f.write('\t') |
| 759 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 760 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 761 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 762 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 763 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 764 | f.write("--------------------------------------------------------------------------------- \n") |
| 765 | |
| 766 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 767 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 768 | f.write('\t') |
| 769 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 770 | f.write('\t') |
| 771 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 772 | f.write('\t') |
| 773 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 774 | f.write('\t') |
| 775 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 776 | f.write('\n') |
| 777 | f.write('\n') |
| 778 | f.write('\n') |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 779 | if j == 3: |
| 780 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 781 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 782 | f.write("--------------------------------------------------------------------------------- \n") |
| 783 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 784 | time.sleep(NBsleep) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 785 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 786 | print("\n") |
| 787 | nbtpavg4n = round(nbtpval)/NBloop |
| 788 | print nbtpavg4n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 789 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 790 | |
| 791 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 792 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 793 | main.log.report("Intent Throughput for 4-node ONOS cluster = " + str(nbtpavg4n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 794 | |
| 795 | def CASE51(self,main): |
| 796 | main.case("Starting SB test for 5 nodes") |
| 797 | ip1 = main.params['CTRL']['ip1'] |
| 798 | ip2 = main.params['CTRL']['ip2'] |
| 799 | ip3 = main.params['CTRL']['ip3'] |
| 800 | ip4 = main.params['CTRL']['ip4'] |
| 801 | ip5 = main.params['CTRL']['ip5'] |
| 802 | rate1 = main.params['RATE1'] |
| 803 | run_dur = main.params['RUN_DUR'] |
| 804 | loop = int( main.params['loop']) |
| 805 | switches_num = main.params['switches_num'] |
| 806 | port = main.params['port'] |
| 807 | print loop |
| 808 | sleep_init = int(main.params['sleep_init']) |
| 809 | sleep_t =int( main.params['sleep_t']) |
| 810 | main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
| 811 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"") |
| 812 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 813 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 814 | import time |
| 815 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 816 | tpval = 0.0 |
| 817 | global tpavg5n |
| 818 | tpavg5n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 819 | time.sleep(sleep_init) |
| 820 | |
| 821 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close() |
| 822 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 823 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 824 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 825 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 826 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 827 | |
| 828 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a") |
| 829 | #time.sleep(10) |
| 830 | for i in range(int (loop)): |
| 831 | j1 = main.ONOS2.get_json(url1) |
| 832 | j2 = main.ONOS2.get_json(url2) |
| 833 | j3 = main.ONOS2.get_json(url3) |
| 834 | j4 = main.ONOS2.get_json(url4) |
| 835 | j5 = main.ONOS2.get_json(url5) |
| 836 | json_str = [] |
| 837 | json_str.append(0) |
| 838 | json_str.append(j1) |
| 839 | json_str.append(j2) |
| 840 | json_str.append(j3) |
| 841 | json_str.append(j4) |
| 842 | json_str.append(j5) |
| 843 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "": |
| 844 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 845 | #print str(json_str["meters"][4]) |
| 846 | #f.write(str(json_str["meters"][4])) |
| 847 | #f.write('\n') |
| 848 | #time.sleep(3) |
| 849 | for j in range(1,6): |
| 850 | f.write("ONOS" + str(j) + "\n") |
| 851 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 852 | f.write('\t') |
| 853 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 854 | f.write('\t') |
| 855 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 856 | f.write('\t') |
| 857 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 858 | f.write('\t') |
| 859 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 860 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 861 | if j == 3: |
| 862 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 863 | #print tpval |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 864 | |
| 865 | f.write('\n') |
| 866 | f.write('\n') |
| 867 | |
| 868 | f.write("--------------------------------------------------------------------------------- \n") |
| 869 | time.sleep(sleep_t) |
| 870 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 871 | #print tpval |
| 872 | print("\n") |
| 873 | tpavg5n = round(tpval)/loop |
| 874 | print tpavg5n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 875 | |
| 876 | #main.Mininet2.handle.expect("\$", timeout=900) |
| 877 | #main.Mininet2.handle.sendline("sudo mn -c") |
| 878 | #main.Mininet2.handle.expect("\$") |
| 879 | time.sleep(5) |
| 880 | main.Mininet2.handle.expect("\$", timeout=900) |
| 881 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 882 | main.log.report("Topology Event Throughput for 5-node ONOS cluster = " + str(tpavg5n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 883 | |
| 884 | |
| 885 | def CASE52(self,main): |
| 886 | |
| 887 | ip1 = main.params['CTRL']['ip1'] |
| 888 | ip2 = main.params['CTRL']['ip2'] |
| 889 | ip3 = main.params['CTRL']['ip3'] |
| 890 | ip4 = main.params['CTRL']['ip4'] |
| 891 | ip5 = main.params['CTRL']['ip5'] |
| 892 | |
| 893 | import time |
| 894 | import json |
| 895 | rate2 = main.params['RATE2'] |
| 896 | run_dur = main.params['RUN_DUR'] |
| 897 | loop = int(main.params['loop']) |
| 898 | sleep_t = int(main.params['sleep_t']) |
| 899 | sleep_init = int(main.params['sleep_init']) |
| 900 | switches_num = main.params['switches_num'] |
| 901 | port = main.params['port'] |
| 902 | main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur) |
| 903 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"") |
| 904 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur) |
| 905 | main.Mininet2.handle.expect("Starting SB load....", timeout=900 ) |
| 906 | time.sleep(sleep_init) |
| 907 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", 'w').close() |
| 908 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 909 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 910 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 911 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 912 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 913 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate2", "a") |
| 914 | #time.sleep(10) |
| 915 | for i in range(int (loop)): |
| 916 | j1 = main.ONOS2.get_json(url1) |
| 917 | j2 = main.ONOS2.get_json(url2) |
| 918 | j3 = main.ONOS2.get_json(url3) |
| 919 | j4 = main.ONOS2.get_json(url4) |
| 920 | j5 = main.ONOS2.get_json(url5) |
| 921 | json_str = [] |
| 922 | json_str.append(0) |
| 923 | json_str.append(j1) |
| 924 | json_str.append(j2) |
| 925 | json_str.append(j3) |
| 926 | json_str.append(j4) |
| 927 | json_str.append(j5) |
| 928 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[4] != "": |
| 929 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 930 | #print str(json_str["meters"][4]) |
| 931 | #f.write(str(json_str["meters"][4])) |
| 932 | #f.write('\n') |
| 933 | #time.sleep(3) |
| 934 | for j in range(1,6): |
| 935 | f.write("ONOS" + str(j) + "\n") |
| 936 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 937 | f.write('\t') |
| 938 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 939 | f.write('\t') |
| 940 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 941 | f.write('\t') |
| 942 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 943 | f.write('\t') |
| 944 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 945 | f.write('\n') |
| 946 | |
| 947 | f.write('\n') |
| 948 | f.write('\n') |
| 949 | |
| 950 | f.write("--------------------------------------------------------------------------------- \n") |
| 951 | time.sleep(sleep_t) |
| 952 | f.close() |
| 953 | time.sleep(180) |
| 954 | |
| 955 | def CASE53(self,main): |
| 956 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 957 | main.case("Starting NB Throughput test after scaling up to 5 onos nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 958 | ip1 = main.params['CTRL']['ip1'] |
| 959 | ip2 = main.params['CTRL']['ip2'] |
| 960 | ip3 = main.params['CTRL']['ip3'] |
| 961 | ip4 = main.params['CTRL']['ip4'] |
| 962 | |
| 963 | import time |
| 964 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 965 | int_num = main.params['int_num'] |
| 966 | addrate = main.params['addrate'] |
| 967 | NBdur = main.params['NBdur'] |
| 968 | NBsleep = int(main.params['NBsleep']) |
| 969 | NBsleep_init = int(main.params['NBsleep_init']) |
| 970 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 971 | nbtpval = 0.0 |
| 972 | global nbtpavg5n |
| 973 | nbtpavg5n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 974 | |
| 975 | main.Mininet4.handle.expect("\$") |
| 976 | #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp") |
| 977 | #main.Mininet2.handle.expect("mininet>" , timeout=400) |
| 978 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633") |
| 979 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633") |
| 980 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633") |
| 981 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 982 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633") |
| 983 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.3:6633") |
| 984 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.5:6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 985 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 986 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 987 | main.ONOS3.handle.expect("\$") |
| 988 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 989 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 5 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 990 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 991 | |
| 992 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 993 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 994 | import json |
| 995 | |
| 996 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close() |
| 997 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 998 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 999 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1000 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1001 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1002 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a") |
| 1003 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1004 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1005 | j1 = main.ONOS2.get_json(url1) |
| 1006 | j2 = main.ONOS2.get_json(url2) |
| 1007 | j3 = main.ONOS2.get_json(url3) |
| 1008 | j4 = main.ONOS2.get_json(url4) |
| 1009 | j5 = main.ONOS2.get_json(url5) |
| 1010 | json_str = [] |
| 1011 | json_str.append(0) |
| 1012 | json_str.append(j1) |
| 1013 | json_str.append(j2) |
| 1014 | json_str.append(j3) |
| 1015 | json_str.append(j4) |
| 1016 | json_str.append(j5) |
| 1017 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "": |
| 1018 | for j in range(1,6): |
| 1019 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 1020 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 1021 | f.write('\t') |
| 1022 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 1023 | f.write('\t') |
| 1024 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 1025 | f.write('\t') |
| 1026 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 1027 | f.write('\t') |
| 1028 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 1029 | f.write('\n') |
| 1030 | |
| 1031 | f.write('\n') |
| 1032 | |
| 1033 | f.write("--------------------------------------------------------------------------------- \n") |
| 1034 | |
| 1035 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 1036 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 1037 | f.write('\t') |
| 1038 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 1039 | f.write('\t') |
| 1040 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 1041 | f.write('\t') |
| 1042 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 1043 | f.write('\t') |
| 1044 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 1045 | f.write('\n') |
| 1046 | f.write('\n') |
| 1047 | f.write('\n') |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1048 | if j == 3: |
| 1049 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
| 1050 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1051 | |
| 1052 | f.write("--------------------------------------------------------------------------------- \n") |
| 1053 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1054 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1055 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1056 | print("\n") |
| 1057 | nbtpavg5n = round(nbtpval)/NBloop |
| 1058 | print nbtpavg5n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1059 | |
| 1060 | |
| 1061 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1062 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1063 | main.log.report("Intent Throughput for 5-node ONOS cluster = " + str(nbtpavg5n) + " Events/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1064 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1065 | def CASE61(self,main): |
| 1066 | main.case("Starting SB test for 5 nodes") |
| 1067 | ip1 = main.params['CTRL']['ip1'] |
| 1068 | ip2 = main.params['CTRL']['ip2'] |
| 1069 | ip3 = main.params['CTRL']['ip3'] |
| 1070 | ip4 = main.params['CTRL']['ip4'] |
| 1071 | ip5 = main.params['CTRL']['ip5'] |
| 1072 | ip6 = main.params['CTRL']['ip6'] |
| 1073 | rate1 = main.params['RATE1'] |
| 1074 | run_dur = main.params['RUN_DUR'] |
| 1075 | loop = int( main.params['loop']) |
| 1076 | switches_num = main.params['switches_num'] |
| 1077 | port = main.params['port'] |
| 1078 | print loop |
| 1079 | sleep_t =int( main.params['sleep_t']) |
| 1080 | sleep_init = int(main.params['sleep_init']) |
| 1081 | main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
| 1082 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"") |
| 1083 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 1084 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 1085 | |
| 1086 | import time |
| 1087 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1088 | tpval = 0.0 |
| 1089 | global tpavg6n |
| 1090 | tpavg6n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1091 | time.sleep(sleep_init) |
| 1092 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close() |
| 1093 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1094 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1095 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1096 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1097 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1098 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1099 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1100 | |
| 1101 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a") |
| 1102 | #time.sleep(10) |
| 1103 | for i in range(int (loop)): |
| 1104 | j1 = main.ONOS2.get_json(url1) |
| 1105 | j2 = main.ONOS2.get_json(url2) |
| 1106 | j3 = main.ONOS2.get_json(url3) |
| 1107 | j4 = main.ONOS2.get_json(url4) |
| 1108 | j5 = main.ONOS2.get_json(url5) |
| 1109 | j6 = main.ONOS2.get_json(url6) |
| 1110 | json_str = [] |
| 1111 | json_str.append(0) |
| 1112 | json_str.append(j1) |
| 1113 | json_str.append(j2) |
| 1114 | json_str.append(j3) |
| 1115 | json_str.append(j4) |
| 1116 | json_str.append(j5) |
| 1117 | json_str.append(j6) |
| 1118 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "": |
| 1119 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 1120 | #print str(json_str["meters"][4]) |
| 1121 | #f.write(str(json_str["meters"][4])) |
| 1122 | #f.write('\n') |
| 1123 | #time.sleep(3) |
| 1124 | for j in range(1,7): |
| 1125 | f.write("ONOS" + str(j) + "\n") |
| 1126 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 1127 | f.write('\t') |
| 1128 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 1129 | f.write('\t') |
| 1130 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 1131 | f.write('\t') |
| 1132 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 1133 | f.write('\t') |
| 1134 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 1135 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1136 | if j == 3: |
| 1137 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 1138 | #print tpval |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1139 | |
| 1140 | f.write('\n') |
| 1141 | f.write('\n') |
| 1142 | |
| 1143 | f.write("--------------------------------------------------------------------------------- \n") |
| 1144 | time.sleep(sleep_t) |
| 1145 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1146 | #print tpval |
| 1147 | print("\n") |
| 1148 | tpavg6n = round(tpval)/loop |
| 1149 | print tpavg6n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1150 | |
| 1151 | #main.Mininet2.handle.expect("\$", timeout=900) |
| 1152 | #main.Mininet2.handle.sendline("sudo mn -c") |
| 1153 | #main.Mininet2.handle.expect("\$") |
| 1154 | time.sleep(5) |
| 1155 | main.Mininet2.handle.expect("\$", timeout=900) |
| 1156 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1157 | main.log.report("Topology Event Throughput for 6-node ONOS cluster = " + tpavg6n + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1158 | |
| 1159 | |
| 1160 | def CASE62(self,main): |
| 1161 | |
| 1162 | ip1 = main.params['CTRL']['ip1'] |
| 1163 | ip2 = main.params['CTRL']['ip2'] |
| 1164 | ip3 = main.params['CTRL']['ip3'] |
| 1165 | ip4 = main.params['CTRL']['ip4'] |
| 1166 | ip5 = main.params['CTRL']['ip5'] |
| 1167 | ip6 = main.params['CTRL']['ip6'] |
| 1168 | |
| 1169 | import time |
| 1170 | import json |
| 1171 | rate2 = main.params['RATE2'] |
| 1172 | run_dur = main.params['RUN_DUR'] |
| 1173 | loop = int(main.params['loop']) |
| 1174 | sleep_t = int(main.params['sleep_t']) |
| 1175 | switches_num = main.params['switches_num'] |
| 1176 | sleep_init = int(main.params['sleep_init']) |
| 1177 | port = main.params['port'] |
| 1178 | main.case("Starting SB load on 4 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur) |
| 1179 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"") |
| 1180 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur) |
| 1181 | main.Mininet2.handle.expect("Starting SB load....", timeout=900 ) |
| 1182 | time.sleep(sleep_init) |
| 1183 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", 'w').close() |
| 1184 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1185 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1186 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1187 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1188 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1189 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1190 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a") |
| 1191 | #time.sleep(10) |
| 1192 | for i in range(int (loop)): |
| 1193 | j1 = main.ONOS2.get_json(url1) |
| 1194 | j2 = main.ONOS2.get_json(url2) |
| 1195 | j3 = main.ONOS2.get_json(url3) |
| 1196 | j4 = main.ONOS2.get_json(url4) |
| 1197 | j5 = main.ONOS2.get_json(url5) |
| 1198 | j6 = main.ONOS2.get_json(url6) |
| 1199 | json_str = [] |
| 1200 | json_str.append(0) |
| 1201 | json_str.append(j1) |
| 1202 | json_str.append(j2) |
| 1203 | json_str.append(j3) |
| 1204 | json_str.append(j4) |
| 1205 | json_str.append(j5) |
| 1206 | json_str.append(j6) |
| 1207 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "": |
| 1208 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 1209 | #print str(json_str["meters"][4]) |
| 1210 | #f.write(str(json_str["meters"][4])) |
| 1211 | #f.write('\n') |
| 1212 | #time.sleep(3) |
| 1213 | for j in range(1,7): |
| 1214 | f.write("ONOS" + str(j) + "\n") |
| 1215 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 1216 | f.write('\t') |
| 1217 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 1218 | f.write('\t') |
| 1219 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 1220 | f.write('\t') |
| 1221 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 1222 | f.write('\t') |
| 1223 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 1224 | f.write('\n') |
| 1225 | |
| 1226 | f.write('\n') |
| 1227 | f.write('\n') |
| 1228 | |
| 1229 | f.write("--------------------------------------------------------------------------------- \n") |
| 1230 | time.sleep(sleep_t) |
| 1231 | f.close() |
| 1232 | time.sleep(180) |
| 1233 | |
| 1234 | def CASE63(self,main): |
| 1235 | |
| 1236 | main.case("Starting NB Throughput test after scaling up to 4 onos nodes") |
| 1237 | ip1 = main.params['CTRL']['ip1'] |
| 1238 | ip2 = main.params['CTRL']['ip2'] |
| 1239 | ip3 = main.params['CTRL']['ip3'] |
| 1240 | ip4 = main.params['CTRL']['ip4'] |
| 1241 | |
| 1242 | import time |
| 1243 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1244 | int_num = main.params['int_num'] |
| 1245 | addrate = main.params['addrate'] |
| 1246 | NBdur = main.params['NBdur'] |
| 1247 | NBsleep = int(main.params['NBsleep']) |
| 1248 | NBsleep_init = int(main.params['NBsleep_init']) |
| 1249 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1250 | nbtpval = 0.0 |
| 1251 | global nbtpavg6n |
| 1252 | nbtpavg6n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1253 | |
| 1254 | main.Mininet4.handle.expect("\$") |
| 1255 | #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp") |
| 1256 | #main.Mininet2.handle.expect("mininet>" , timeout=400) |
| 1257 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633") |
| 1258 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633") |
| 1259 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633") |
| 1260 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1261 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633") |
| 1262 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633") |
| 1263 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.6:6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1264 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1265 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 1266 | main.ONOS3.handle.expect("\$") |
| 1267 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1268 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 6 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.5:8080 10.128.10.6:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1269 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1270 | |
| 1271 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1272 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1273 | import json |
| 1274 | |
| 1275 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close() |
| 1276 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1277 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1278 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1279 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1280 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1281 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1282 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a") |
| 1283 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1284 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1285 | j1 = main.ONOS2.get_json(url1) |
| 1286 | j2 = main.ONOS2.get_json(url2) |
| 1287 | j3 = main.ONOS2.get_json(url3) |
| 1288 | j4 = main.ONOS2.get_json(url4) |
| 1289 | j5 = main.ONOS2.get_json(url5) |
| 1290 | j6 = main.ONOS2.get_json(url6) |
| 1291 | json_str = [] |
| 1292 | json_str.append(0) |
| 1293 | json_str.append(j1) |
| 1294 | json_str.append(j2) |
| 1295 | json_str.append(j3) |
| 1296 | json_str.append(j4) |
| 1297 | json_str.append(j5) |
| 1298 | json_str.append(j6) |
| 1299 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "": |
| 1300 | for j in range(1,7): |
| 1301 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 1302 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 1303 | f.write('\t') |
| 1304 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 1305 | f.write('\t') |
| 1306 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 1307 | f.write('\t') |
| 1308 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 1309 | f.write('\t') |
| 1310 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 1311 | f.write('\n') |
| 1312 | |
| 1313 | f.write('\n') |
| 1314 | |
| 1315 | f.write("--------------------------------------------------------------------------------- \n") |
| 1316 | |
| 1317 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 1318 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 1319 | f.write('\t') |
| 1320 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 1321 | f.write('\t') |
| 1322 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 1323 | f.write('\t') |
| 1324 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 1325 | f.write('\t') |
| 1326 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 1327 | f.write('\n') |
| 1328 | f.write('\n') |
| 1329 | f.write('\n') |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1330 | if j == 3: |
| 1331 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
| 1332 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1333 | |
| 1334 | f.write("--------------------------------------------------------------------------------- \n") |
| 1335 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1336 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1337 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1338 | print("\n") |
| 1339 | nbtpavg6n = round(nbtpval)/NBloop |
| 1340 | print nbtpavg6n |
| 1341 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1342 | |
| 1343 | |
| 1344 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1345 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1346 | main.log.report("Intent Throughput for 6-node ONOS cluster = " + str(nbtpavg6n) + " Events/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1347 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1348 | def CASE71(self,main): |
| 1349 | main.case("Starting SB test for 7 nodes") |
| 1350 | ip1 = main.params['CTRL']['ip1'] |
| 1351 | ip2 = main.params['CTRL']['ip2'] |
| 1352 | ip3 = main.params['CTRL']['ip3'] |
| 1353 | ip4 = main.params['CTRL']['ip4'] |
| 1354 | ip5 = main.params['CTRL']['ip5'] |
| 1355 | ip6 = main.params['CTRL']['ip6'] |
| 1356 | ip7 = main.params['CTRL']['ip7'] |
| 1357 | rate1 = main.params['RATE1'] |
| 1358 | run_dur = main.params['RUN_DUR'] |
| 1359 | loop = int( main.params['loop']) |
| 1360 | switches_num = main.params['switches_num'] |
| 1361 | port = main.params['port'] |
| 1362 | print loop |
| 1363 | sleep_t =int( main.params['sleep_t']) |
| 1364 | sleep_init = int(main.params['sleep_init']) |
| 1365 | main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
| 1366 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate1 + " " + run_dur + " \"11\"") |
| 1367 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + " " + ip7 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 1368 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 1369 | import time |
| 1370 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1371 | tpval = 0.0 |
| 1372 | global tpavg7n |
| 1373 | tpavg7n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1374 | time.sleep(sleep_init) |
| 1375 | |
| 1376 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close() |
| 1377 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1378 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1379 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1380 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1381 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1382 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1383 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1384 | url7 = "http://10.128.10.7:8080/wm/onos/metrics" |
| 1385 | |
| 1386 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a") |
| 1387 | #time.sleep(10) |
| 1388 | for i in range(int (loop)): |
| 1389 | j1 = main.ONOS2.get_json(url1) |
| 1390 | j2 = main.ONOS2.get_json(url2) |
| 1391 | j3 = main.ONOS2.get_json(url3) |
| 1392 | j4 = main.ONOS2.get_json(url4) |
| 1393 | j5 = main.ONOS2.get_json(url5) |
| 1394 | j6 = main.ONOS2.get_json(url6) |
| 1395 | j7 = main.ONOS2.get_json(url7) |
| 1396 | json_str = [] |
| 1397 | json_str.append(0) |
| 1398 | json_str.append(j1) |
| 1399 | json_str.append(j2) |
| 1400 | json_str.append(j3) |
| 1401 | json_str.append(j4) |
| 1402 | json_str.append(j5) |
| 1403 | json_str.append(j6) |
| 1404 | json_str.append(j7) |
| 1405 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[7] != "": |
| 1406 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 1407 | #print str(json_str["meters"][4]) |
| 1408 | #f.write(str(json_str["meters"][4])) |
| 1409 | #f.write('\n') |
| 1410 | #time.sleep(3) |
| 1411 | for j in range(1,8): |
| 1412 | f.write("ONOS" + str(j) + "\n") |
| 1413 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 1414 | f.write('\t') |
| 1415 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 1416 | f.write('\t') |
| 1417 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 1418 | f.write('\t') |
| 1419 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 1420 | f.write('\t') |
| 1421 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 1422 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1423 | if j == 3: |
| 1424 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 1425 | #print tpval |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1426 | |
| 1427 | f.write('\n') |
| 1428 | f.write('\n') |
| 1429 | |
| 1430 | f.write("--------------------------------------------------------------------------------- \n") |
| 1431 | time.sleep(sleep_t) |
| 1432 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1433 | #print tpval |
| 1434 | print("\n") |
| 1435 | tpavg7n = round(tpval)/loop |
| 1436 | print tpavg7n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1437 | |
| 1438 | #main.Mininet2.handle.expect("\$", timeout=900) |
| 1439 | #main.Mininet2.handle.sendline("sudo mn -c") |
| 1440 | #main.Mininet2.handle.expect("\$") |
| 1441 | time.sleep(5) |
| 1442 | main.Mininet2.handle.expect("\$", timeout=900) |
| 1443 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1444 | main.log.report("Topology Event Throughput for 7-node ONOS cluster = " + str(tpavg7n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1445 | |
| 1446 | |
| 1447 | def CASE72(self,main): |
| 1448 | |
| 1449 | ip1 = main.params['CTRL']['ip1'] |
| 1450 | ip2 = main.params['CTRL']['ip2'] |
| 1451 | ip3 = main.params['CTRL']['ip3'] |
| 1452 | ip4 = main.params['CTRL']['ip4'] |
| 1453 | ip5 = main.params['CTRL']['ip5'] |
| 1454 | ip6 = main.params['CTRL']['ip6'] |
| 1455 | ip7 = main.params['CTRL']['ip7'] |
| 1456 | |
| 1457 | import time |
| 1458 | import json |
| 1459 | rate2 = main.params['RATE2'] |
| 1460 | run_dur = main.params['RUN_DUR'] |
| 1461 | loop = int(main.params['loop']) |
| 1462 | sleep_t = int(main.params['sleep_t']) |
| 1463 | sleep_init = int(main.params['sleep_init']) |
| 1464 | switches_num = main.params['switches_num'] |
| 1465 | port = main.params['port'] |
| 1466 | main.case("Starting SB load on 7 nodes from mininet with " + rate2 +" added/removed/s for " + run_dur) |
| 1467 | #main.Mininet2.handle.sendline("./loadgen_SB.sh startload \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + "\"" + " " + switches_num + " " + port + " " + rate2 + " " + run_dur + " \"11\"") |
| 1468 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + " " + ip4 + " " + ip5 + " " + ip6 + " " + ip7 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate2 + " -d " + rate2 + " -l " + run_dur) |
| 1469 | main.Mininet2.handle.expect("Starting SB load....", timeout=900 ) |
| 1470 | |
| 1471 | time.sleep(sleep_init) |
| 1472 | |
| 1473 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate2", 'w').close() |
| 1474 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1475 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1476 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1477 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1478 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1479 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1480 | url7 = "http://10.128.10.7:8080/wm/onos/metrics" |
| 1481 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate2", "a") |
| 1482 | #time.sleep(10) |
| 1483 | for i in range(int (loop)): |
| 1484 | j1 = main.ONOS2.get_json(url1) |
| 1485 | j2 = main.ONOS2.get_json(url2) |
| 1486 | j3 = main.ONOS2.get_json(url3) |
| 1487 | j4 = main.ONOS2.get_json(url4) |
| 1488 | j5 = main.ONOS2.get_json(url5) |
| 1489 | j6 = main.ONOS2.get_json(url6) |
| 1490 | j7 = main.ONOS2.get_json(url7) |
| 1491 | json_str = [] |
| 1492 | json_str.append(0) |
| 1493 | json_str.append(j1) |
| 1494 | json_str.append(j2) |
| 1495 | json_str.append(j3) |
| 1496 | json_str.append(j4) |
| 1497 | json_str.append(j5) |
| 1498 | json_str.append(j6) |
| 1499 | json_str.append(j7) |
| 1500 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[7] != "": |
| 1501 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 1502 | #print str(json_str["meters"][4]) |
| 1503 | #f.write(str(json_str["meters"][4])) |
| 1504 | #f.write('\n') |
| 1505 | #time.sleep(3) |
| 1506 | for j in range(1,8): |
| 1507 | f.write("ONOS" + str(j) + "\n") |
| 1508 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 1509 | f.write('\t') |
| 1510 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 1511 | f.write('\t') |
| 1512 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 1513 | f.write('\t') |
| 1514 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 1515 | f.write('\t') |
| 1516 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 1517 | f.write('\n') |
| 1518 | |
| 1519 | f.write('\n') |
| 1520 | f.write('\n') |
| 1521 | |
| 1522 | f.write("--------------------------------------------------------------------------------- \n") |
| 1523 | time.sleep(sleep_t) |
| 1524 | f.close() |
| 1525 | time.sleep(180) |
| 1526 | |
| 1527 | def CASE73(self,main): |
| 1528 | |
| 1529 | main.case("Starting NB Throughput test after scaling up to 4 onos nodes") |
| 1530 | ip1 = main.params['CTRL']['ip1'] |
| 1531 | ip2 = main.params['CTRL']['ip2'] |
| 1532 | ip3 = main.params['CTRL']['ip3'] |
| 1533 | ip4 = main.params['CTRL']['ip4'] |
| 1534 | |
| 1535 | import time |
| 1536 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1537 | int_num = main.params['int_num'] |
| 1538 | addrate = main.params['addrate'] |
| 1539 | NBdur = main.params['NBdur'] |
| 1540 | NBsleep = int(main.params['NBsleep']) |
| 1541 | NBsleep_init = int(main.params['NBsleep_init']) |
| 1542 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1543 | nbtpval = 0.0 |
| 1544 | global nbtpavg7n |
| 1545 | nbtpavg7n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1546 | |
| 1547 | main.Mininet4.handle.expect("\$") |
| 1548 | #main.Mininet2.handle.sendline("sudo mn --custom topo-intentTPtest.py --topo mytopo --mac --arp") |
| 1549 | #main.Mininet2.handle.expect("mininet>" , timeout=400) |
| 1550 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:10.128.10.1:6633") |
| 1551 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:10.128.10.2:6633") |
| 1552 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:10.128.10.3:6633") |
| 1553 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:10.128.10.4:6633") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1554 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:10.128.10.5:6633") |
| 1555 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:10.128.10.6:6633") |
| 1556 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:10.128.10.7:6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1557 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1558 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 1559 | main.ONOS3.handle.expect("\$") |
| 1560 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1561 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 7 -u \"10.128.10.1:8080 10.128.10.2:8080 10.128.10.3:8080 10.128.10.4:8080 10.128.10.6:8080 10.128.10.5:8080 10.128.10.7:8080 \" -i " + int_num + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1562 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1563 | |
| 1564 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1565 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1566 | import json |
| 1567 | |
| 1568 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close() |
| 1569 | url1 = "http://10.128.10.1:8080/wm/onos/metrics" |
| 1570 | url2 = "http://10.128.10.2:8080/wm/onos/metrics" |
| 1571 | url3 = "http://10.128.10.3:8080/wm/onos/metrics" |
| 1572 | url4 = "http://10.128.10.4:8080/wm/onos/metrics" |
| 1573 | url5 = "http://10.128.10.5:8080/wm/onos/metrics" |
| 1574 | url6 = "http://10.128.10.6:8080/wm/onos/metrics" |
| 1575 | url7 = "http://10.128.10.7:8080/wm/onos/metrics" |
| 1576 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a") |
| 1577 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1578 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1579 | j1 = main.ONOS2.get_json(url1) |
| 1580 | j2 = main.ONOS2.get_json(url2) |
| 1581 | j3 = main.ONOS2.get_json(url3) |
| 1582 | j4 = main.ONOS2.get_json(url4) |
| 1583 | j5 = main.ONOS2.get_json(url5) |
| 1584 | j6 = main.ONOS2.get_json(url6) |
| 1585 | j7 = main.ONOS2.get_json(url7) |
| 1586 | json_str = [] |
| 1587 | json_str.append(0) |
| 1588 | json_str.append(j1) |
| 1589 | json_str.append(j2) |
| 1590 | json_str.append(j3) |
| 1591 | json_str.append(j4) |
| 1592 | json_str.append(j5) |
| 1593 | json_str.append(j6) |
| 1594 | json_str.append(j7) |
| 1595 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "" and json_str[6] != "": |
| 1596 | for j in range(1,8): |
| 1597 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 1598 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 1599 | f.write('\t') |
| 1600 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 1601 | f.write('\t') |
| 1602 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 1603 | f.write('\t') |
| 1604 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 1605 | f.write('\t') |
| 1606 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 1607 | f.write('\n') |
| 1608 | |
| 1609 | f.write('\n') |
| 1610 | |
| 1611 | f.write("--------------------------------------------------------------------------------- \n") |
| 1612 | |
| 1613 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 1614 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 1615 | f.write('\t') |
| 1616 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 1617 | f.write('\t') |
| 1618 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 1619 | f.write('\t') |
| 1620 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 1621 | f.write('\t') |
| 1622 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 1623 | f.write('\n') |
| 1624 | f.write('\n') |
| 1625 | f.write('\n') |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1626 | if j == 3: |
| 1627 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
| 1628 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1629 | |
| 1630 | f.write("--------------------------------------------------------------------------------- \n") |
| 1631 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1632 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1633 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1634 | print("\n") |
| 1635 | nbtpavg7n = round(nbtpval)/NBloop |
| 1636 | print nbtpavg7n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1637 | |
| 1638 | |
| 1639 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1640 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1641 | main.log.report("Intent Throughput for 7-node ONOS cluster = " + str(nbtpavg7n) + " Events/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1642 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1643 | def CASE8(self,main): |
| 1644 | import time |
| 1645 | main.case("Scaling ONOS down to 6 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1646 | main.ONOS7.handle.sendline("./onos.sh core stop") |
| 1647 | time.sleep(8) |
| 1648 | pdata = main.ONOS7.isup() |
| 1649 | utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...") |
| 1650 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1651 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 1652 | for i in range(3): |
| 1653 | if data == main.FALSE: |
| 1654 | #main.log.report("Something is funny... restarting ONOS") |
| 1655 | #main.ONOS1.stop() |
| 1656 | time.sleep(3) |
| 1657 | #main.ONOS1.start() |
| 1658 | #time.sleep(5) |
| 1659 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 1660 | else: |
| 1661 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1662 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull -6-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1663 | |
| 1664 | def CASE9(self,main): |
| 1665 | |
| 1666 | main.case("Scaling ONOS down to 5 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1667 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 1668 | time.sleep(8) |
| 1669 | pdata = main.ONOS6.isup() and main.ONOS7.isup() |
| 1670 | utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1671 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 1672 | for i in range(3): |
| 1673 | if data == main.FALSE: |
| 1674 | #main.log.report("Something is funny... restarting ONOS") |
| 1675 | #main.ONOS1.stop() |
| 1676 | time.sleep(3) |
| 1677 | #main.ONOS1.start() |
| 1678 | #time.sleep(5) |
| 1679 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 1680 | else: |
| 1681 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1682 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull - 5 node ONOS clsuter is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1683 | |
| 1684 | def CASE10(self,main): |
| 1685 | |
| 1686 | main.case("Scaling ONOS down to 4 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1687 | |
| 1688 | main.ONOS5.handle.sendline("./onos.sh core stop ") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1689 | time.sleep(5) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1690 | pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 1691 | utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1692 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 1693 | for i in range(3): |
| 1694 | if data == main.FALSE: |
| 1695 | #main.log.report("Something is funny... restarting ONOS") |
| 1696 | #main.ONOS1.stop() |
| 1697 | time.sleep(3) |
| 1698 | #main.ONOS1.start() |
| 1699 | #time.sleep(5) |
| 1700 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 1701 | else: |
| 1702 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1703 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 4 node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1704 | |
| 1705 | def CASE11(self,main): |
| 1706 | |
| 1707 | main.case("Scaling ONOS down to 3 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1708 | main.ONOS4.handle.sendline("./onos.sh core stop ") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1709 | time.sleep(5) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1710 | pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 1711 | utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1712 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() |
| 1713 | for i in range(3): |
| 1714 | if data == main.FALSE: |
| 1715 | #main.log.report("Something is funny... restarting ONOS") |
| 1716 | #main.ONOS1.stop() |
| 1717 | time.sleep(3) |
| 1718 | #main.ONOS1.start() |
| 1719 | #time.sleep(5) |
| 1720 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() |
| 1721 | else: |
| 1722 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1723 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 3 node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1724 | |
| 1725 | def CASE100(self,main): |
| 1726 | import os |
| 1727 | import time |
| 1728 | global timestr |
| 1729 | timestr = time.strftime("%Y%m%d-%H%M%S") |
| 1730 | main.case("Scale-up tests complete...now making final changes") |
| 1731 | main.log.info("moving logs....") |
| 1732 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1733 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1734 | time.sleep(2) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1735 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "") |
| 1736 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1737 | time.sleep(2) |
| 1738 | os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1739 | time.sleep(180) |
| 1740 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1741 | def CASE101(self,main): |
| 1742 | |
| 1743 | import os |
| 1744 | import time |
| 1745 | main.case("Scale-down tests complete...now making final changes") |
| 1746 | global timestr |
| 1747 | main.case("Scale-down tests complete...now making final changes") |
| 1748 | main.log.info("moving logs....") |
| 1749 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1750 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1751 | time.sleep(2) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1752 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "") |
| 1753 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/NBscale* ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1754 | time.sleep(2) |
| 1755 | os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*") |
| 1756 | time.sleep(2) |
| 1757 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1758 | def CASE103(self,main): |
| 1759 | import os |
| 1760 | import time |
| 1761 | main.case("Posting the results to http://10.128.5.54/scale.html ....") |
| 1762 | db_script = main.params['db_script'] |
santhosh | 581e415 | 2014-08-20 12:13:40 -0700 | [diff] [blame] | 1763 | os.system(db_script + " -n='100SwitchScaleUp" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1764 | |
| 1765 | def CASE104(self,main): |
| 1766 | import os |
| 1767 | import time |
| 1768 | main.case("Posting the results to http://10.128.5.54/scale.html ....") |
| 1769 | db_script = main.params['db_script'] |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 1770 | os.system(db_script + " -n='100SwitchScaleDown" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1771 | |
| 1772 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1773 | def CASE105(self,main): |
| 1774 | import os |
| 1775 | import time |
| 1776 | main.case("Posting the results to http://10.128.5.54/scale.html ....") |
| 1777 | db_script = main.params['db_script'] |
| 1778 | os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'") |
| 1779 | |
| 1780 | def CASE106(self,main): |
| 1781 | import os |
| 1782 | import time |
| 1783 | main.case("Posting the results to http://10.128.5.54/scale.html ....") |
| 1784 | db_script = main.params['db_script'] |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1785 | os.system(db_script + " -n='1000IntentsScaleDown" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'") |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1786 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1787 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 1788 | |