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