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