santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1 | #Author: Santhosh Jayashankar |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 2 | class scaleONOS7nodes : |
| 3 | |
| 4 | |
| 5 | |
| 6 | def __init__(self) : |
| 7 | self.default = '' |
| 8 | |
| 9 | # def print_hello_world(self,main): |
| 10 | # print("hello world") |
| 11 | #***************************************************************************************************************************************************************************************** |
| 12 | #Test startup |
| 13 | #Tests the startup of Zookeeper1, RamCloud1, and ONOS1 to be certain that all started up successfully |
| 14 | def CASE1(self,main) : #Check to be sure ZK, Cass, and ONOS are up, then get ONOS version |
| 15 | main.case("Initial setup") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 16 | main.log.report("Starting 3-node ONOS cluster.") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 17 | main.step("Stop ONOS") |
| 18 | import time |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 19 | main.log.info("Stopping all ONOS nodes...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 20 | main.ONOS1.stop_all() |
| 21 | main.ONOS2.stop_all() |
| 22 | main.ONOS3.stop_all() |
| 23 | # main.print_hello_world() |
| 24 | main.ONOS4.stop_all() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 25 | main.ONOS5.stop_all() |
| 26 | main.ONOS6.stop_all() |
| 27 | main.ONOS7.stop_all() |
| 28 | #main.ONOS2.stop_rest() |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 29 | time.sleep(5) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 30 | #main.ONOS1.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 31 | #main.ONOS2.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 32 | #main.ONOS3.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 33 | #main.ONOS4.handle.sendline("cp ~/onos.properties.proactive ~/ONOS/conf/onos.properties") |
| 34 | #main.step("Start tcpdump on mn") |
| 35 | #main.Mininet2.start_tcpdump(main.params['tcpdump']['filename'], intf = main.params['tcpdump']['intf'], port = main.params['tcpdump']['port']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 36 | main.step("Starting 3 ONOS nodes...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 37 | main.Zookeeper1.start() |
| 38 | main.Zookeeper2.start() |
| 39 | main.Zookeeper3.start() |
| 40 | main.Zookeeper4.start() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 41 | main.Zookeeper5.start() |
| 42 | main.Zookeeper6.start() |
| 43 | main.Zookeeper7.start() |
| 44 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 45 | time.sleep(5) |
| 46 | |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 47 | """ |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 48 | main.RamCloud1.del_db() |
| 49 | main.RamCloud2.del_db() |
| 50 | main.RamCloud3.del_db() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 51 | # main.RamCloud4.del_db() |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 52 | |
| 53 | time.sleep(5) |
| 54 | #main.log.report("Pulling latest code from github to all nodes") |
| 55 | |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 56 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 57 | for i in range(2): |
| 58 | uptodate = main.ONOS1.git_pull() |
| 59 | main.ONOS2.git_pull() |
| 60 | main.ONOS3.git_pull() |
| 61 | # main.ONOS4.git_pull() |
| 62 | ver1 = main.ONOS1.get_version() |
| 63 | ver2 = main.ONOS3.get_version() |
| 64 | if ver1==ver2: |
| 65 | break |
| 66 | elif i==1: |
| 67 | main.ONOS2.git_pull("ONOS1 master") |
| 68 | main.ONOS3.git_pull("ONOS1 master") |
| 69 | # main.ONOS4.git_pull("ONOS1 master") |
| 70 | if uptodate==0: |
| 71 | # if 1: |
| 72 | main.ONOS1.git_compile() |
| 73 | main.ONOS2.git_compile() |
| 74 | main.ONOS3.git_compile() |
| 75 | # main.ONOS4.git_compile() |
| 76 | main.ONOS1.print_version() |
| 77 | # main.RamCloud1.git_pull() |
| 78 | # main.RamCloud2.git_pull() |
| 79 | # main.RamCloud3.git_pull() |
| 80 | # main.RamCloud4.git_pull() |
| 81 | # main.ONOS1.get_version() |
| 82 | # main.ONOS2.get_version() |
| 83 | # main.ONOS3.get_version() |
| 84 | # main.ONOS4.get_version() |
| 85 | # main.ONOS1.start_all() |
| 86 | # main.ONOS2.start_all() |
| 87 | # main.ONOS3.start_all() |
| 88 | # main.ONOS4.start_all() |
| 89 | |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 90 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 91 | main.RamCloud1.start_coor() |
| 92 | main.RamCloud1.start_serv() |
| 93 | main.RamCloud2.start_serv() |
| 94 | main.RamCloud3.start_serv() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 95 | time.sleep(5) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 96 | main.ONOS1.start() |
| 97 | main.ONOS2.start() |
| 98 | main.ONOS3.start() |
| 99 | #main.ONOS4.start() |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 100 | time.sleep(5) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 101 | """ |
| 102 | main.ONOS1.handle.sendline("./onos.sh core start") |
| 103 | main.ONOS2.handle.sendline("./onos.sh core start") |
| 104 | main.ONOS3.handle.sendline("./onos.sh core start") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 105 | |
| 106 | main.ONOS1.start_rest() |
| 107 | main.ONOS2.start_rest() |
| 108 | main.ONOS3.start_rest() |
| 109 | test= main.ONOS2.rest_status() |
| 110 | if test == main.FALSE: |
| 111 | main.ONOS1.start_rest() |
| 112 | main.ONOS1.get_version() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 113 | main.log.report("Startup check Zookeeper, and ONOS connections") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 114 | main.step("Testing startup Zookeeper") |
| 115 | data = main.Zookeeper1.isup() and main.Zookeeper2.isup() and main.Zookeeper3.isup() |
| 116 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...") |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 117 | """ |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 118 | main.step("Testing startup RamCloud") |
| 119 | data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv() |
| 120 | if data == main.FALSE: |
| 121 | main.RamCloud1.stop_coor() |
| 122 | main.RamCloud1.stop_serv() |
| 123 | main.RamCloud2.stop_serv() |
| 124 | main.RamCloud3.stop_serv() |
| 125 | # main.RamCloud4.stop_serv() |
| 126 | |
| 127 | time.sleep(5) |
| 128 | main.RamCloud1.start_coor() |
| 129 | main.RamCloud1.start_serv() |
| 130 | main.RamCloud2.start_serv() |
| 131 | main.RamCloud3.start_serv() |
| 132 | # main.RamCloud4.start_serv() |
| 133 | time.sleep(5) |
| 134 | data = main.RamCloud1.status_serv() and main.RamCloud2.status_serv() and main.RamCloud3.status_serv() #and main.RamCloud4.status_serv() |
| 135 | |
| 136 | |
| 137 | |
| 138 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...") |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 139 | """ |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 140 | main.step("Testing startup ONOS") |
| 141 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup() |
| 142 | for i in range(3): |
| 143 | if data == main.FALSE: |
| 144 | #main.log.report("Something is funny... restarting ONOS") |
| 145 | #main.ONOS1.stop() |
| 146 | time.sleep(3) |
| 147 | #main.ONOS1.start() |
| 148 | #time.sleep(5) |
| 149 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() #and main.ONOS4.isup() |
| 150 | else: |
| 151 | break |
| 152 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...") |
| 153 | time.sleep(10) |
| 154 | |
| 155 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 156 | def CASE31(self,main): |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 157 | main.log.report("SB Throughput test: loading ONOS cluster with 740 Topo Events/s") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 158 | main.case("Staring SB load with 3 ONOS nodes") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 159 | ip1 = main.params['CTRL']['ip1'] |
| 160 | ip2 = main.params['CTRL']['ip2'] |
| 161 | ip3 = main.params['CTRL']['ip3'] |
| 162 | rate1 = main.params['RATE1'] |
| 163 | run_dur = main.params['RUN_DUR'] |
| 164 | loop = int( main.params['loop']) |
| 165 | port = main.params['port'] |
| 166 | switches_num = main.params['switches_num'] |
| 167 | print loop |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 168 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 169 | sleep_t =int( main.params['sleep_t']) |
| 170 | main.case("Starting SB load on 3 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 171 | main.Mininet2.handle.sendline("sudo ./loadgen_SB.py -u \"" + ip1 + " " + ip2 + " " + ip3 + "\"" + " -s " + switches_num + " -p " + port + " -a " + rate1 + " -d " + rate1 + " -l " + run_dur) |
| 172 | main.log.info("Adding switches and ports.....") |
| 173 | main.Mininet2.handle.expect("Starting SB load....", timeout=400) |
| 174 | main.log.info("Starting SB load....") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 175 | import time |
| 176 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 177 | import math |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 178 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 179 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 180 | url1 = main.params['url1'] |
| 181 | url2 = main.params['url2'] |
| 182 | url3 = main.params['url3'] |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 183 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale3nodesrate1", "a") |
| 184 | #time.sleep(10) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 185 | tpval = 0.0 |
| 186 | global tpavg3n |
| 187 | tpavg3n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 188 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 189 | j1 = main.ONOS2.get_json(url1) |
| 190 | j2 = main.ONOS2.get_json(url2) |
| 191 | j3 = main.ONOS2.get_json(url3) |
| 192 | json_str = [] |
| 193 | json_str.append(0) |
| 194 | json_str.append(j1) |
| 195 | json_str.append(j2) |
| 196 | json_str.append(j3) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 197 | #float jval = 0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 198 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "": |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 199 | # write_str = str(json_str["meters"][4]["meter"][2]) |
| 200 | #print str(json_str["meters"][4]) |
| 201 | #f.write(str(json_str["meters"][4])) |
| 202 | #f.write('\n') |
| 203 | #time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 204 | for j in range(1,4): |
| 205 | f.write("ONOS" + str(j) + "\n") |
| 206 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 207 | f.write('\t') |
| 208 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 209 | f.write('\t') |
| 210 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 211 | f.write('\t') |
| 212 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 213 | f.write('\t') |
| 214 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 215 | f.write('\n') |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 216 | if j == 3: |
| 217 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
| 218 | #print tpval |
| 219 | #print ("\n") |
| 220 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 221 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 222 | f.write('\n') |
| 223 | f.write('\n') |
| 224 | |
| 225 | f.write("--------------------------------------------------------------------------------- \n") |
| 226 | time.sleep(sleep_t) |
| 227 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 228 | # print tpval |
| 229 | print("\n") |
| 230 | tpavg3n = round(tpval)/loop |
| 231 | print tpavg3n |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 232 | main.log.report("Topology Event Throughput for 3-node ONOS cluster = " +str(tpavg3n) + " Events/sec") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 233 | main.Mininet2.handle.expect("\$", timeout=900) |
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 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 236 | def CASE33(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 237 | |
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 | import json |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 243 | int_num = int(main.params['int_num']) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 244 | addrate = main.params['addrate'] |
| 245 | NBdur = main.params['NBdur'] |
| 246 | NBsleep = int(main.params['NBsleep']) |
| 247 | NBsleep_init = int(main.params['NBsleep_init']) |
| 248 | NBloop = int(main.params['NBloop']) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 249 | int_r = 3 * int_num |
| 250 | main.log.report("Starting NB Throughput test: loading 3-node ONOS cluster with " + str(int_num) + " Intents/s on each node" ) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 251 | main.Mininet4.handle.expect("\$") |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 252 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633") |
| 253 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip1 + ":6633") |
| 254 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip2 + ":6633") |
| 255 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip2 + ":6633") |
| 256 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip3 + ":6633") |
| 257 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip3 + ":6633") |
| 258 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip3 + ":6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 259 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 260 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 261 | main.ONOS3.handle.expect("\$") |
| 262 | |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 263 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 3 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 264 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 265 | time.sleep(NBsleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 266 | import json |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 267 | nbtpval = 0.0 |
| 268 | global nbtpavg3n |
| 269 | nbtpavg3n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 270 | |
| 271 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 272 | url1 = main.params['url1'] |
| 273 | url2 = main.params['url2'] |
| 274 | url3 = main.params['url3'] |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 275 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale3nodesrate1", "a") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 276 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 277 | j1 = main.ONOS1.get_json(url1) |
| 278 | j2 = main.ONOS1.get_json(url2) |
| 279 | j3 = main.ONOS1.get_json(url3) |
| 280 | json_str = [] |
| 281 | json_str.append(0) |
| 282 | json_str.append(j1) |
| 283 | json_str.append(j2) |
| 284 | json_str.append(j3) |
| 285 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "": |
| 286 | for j in range(1,4): |
| 287 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 288 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 289 | f.write('\t') |
| 290 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 291 | f.write('\t') |
| 292 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 293 | f.write('\t') |
| 294 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 295 | f.write('\t') |
| 296 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 297 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 298 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 299 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 300 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 301 | f.write("--------------------------------------------------------------------------------- \n") |
| 302 | |
| 303 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 304 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 305 | f.write('\t') |
| 306 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 307 | f.write('\t') |
| 308 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 309 | f.write('\t') |
| 310 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 311 | f.write('\t') |
| 312 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 313 | f.write('\n') |
| 314 | f.write('\n') |
| 315 | f.write('\n') |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 316 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 317 | |
| 318 | f.write("--------------------------------------------------------------------------------- \n") |
| 319 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 320 | time.sleep(NBsleep) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 321 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 322 | print("\n") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 323 | nbtpavg3n = round(round(nbtpval)/NBloop,2) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 324 | print nbtpavg3n |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 325 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 326 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 327 | #time.sleep(180) |
| 328 | main.log.report("Intent Throughput for 3-node ONOS cluster = " + str(nbtpavg3n) + " Intents/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 329 | |
| 330 | def CASE4(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 331 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 332 | main.log.report("Scale-up ONOS to 4-nodes ") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 333 | main.case("Starting ONOS scale-up to 4 nodes ") |
| 334 | import time |
| 335 | # main.RamCloud4.start_serv() |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 336 | main.ONOS5.handle.sendline("./onos.sh core stop") |
| 337 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 338 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 339 | |
| 340 | |
| 341 | main.Zookeeper4.start() |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 342 | time.sleep(5) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 343 | """ |
santhosh | f686378 | 2014-08-11 15:28:24 -0700 | [diff] [blame] | 344 | main.RamCloud4.del_db() |
| 345 | time.sleep(3) |
| 346 | main.RamCloud4.start_serv() |
| 347 | time.sleep(3) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 348 | """ |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 349 | main.ONOS4.start() |
| 350 | main.ONOS4.start_rest() |
| 351 | time.sleep(5) |
| 352 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 353 | for i in range(3): |
| 354 | if data == main.FALSE: |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 355 | time.sleep(3) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 356 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 357 | else: |
| 358 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 359 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 4-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 360 | |
| 361 | time.sleep(10) |
| 362 | |
| 363 | def CASE5(self,main): |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 364 | main.log.report("Scale-up ONOS to 5-nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 365 | main.case("Starting ONOS scale-up/down to 5 nodes ") |
| 366 | import time |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 367 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 368 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 369 | |
| 370 | main.Zookeeper5.start() |
| 371 | time.sleep(5) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 372 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 373 | main.RamCloud5.del_db() |
| 374 | time.sleep(3) |
| 375 | main.RamCloud5.start_serv() |
| 376 | time.sleep(3) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 377 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 378 | main.ONOS5.start() |
| 379 | main.ONOS5.start_rest() |
| 380 | time.sleep(5) |
| 381 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 382 | for i in range(3): |
| 383 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 384 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 385 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 386 | else: |
| 387 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 388 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 5-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 389 | time.sleep(10) |
| 390 | |
| 391 | def CASE6(self,main): |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 392 | main.log.report("Scale-up ONOS to 6-nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 393 | main.case("Starting ONOS scale-up/down to 6 nodes ") |
| 394 | import time |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 395 | main.ONOS7.handle.sendline("./onos.sh core stop") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 396 | |
| 397 | main.Zookeeper6.start() |
| 398 | time.sleep(5) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 399 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 400 | main.RamCloud6.del_db() |
| 401 | time.sleep(3) |
| 402 | main.RamCloud6.start_serv() |
| 403 | time.sleep(3) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 404 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 405 | main.ONOS6.start() |
| 406 | main.ONOS6.start_rest() |
| 407 | time.sleep(5) |
| 408 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 409 | for i in range(3): |
| 410 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 411 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 412 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 413 | else: |
| 414 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 415 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 6-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 416 | time.sleep(10) |
| 417 | |
| 418 | def CASE7(self,main): |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 419 | main.log.report("Scale-up ONOS to 7-nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 420 | main.case("Starting ONOS scale-up/down to 7 nodes ") |
| 421 | import time |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 422 | |
| 423 | main.Zookeeper7.start() |
| 424 | time.sleep(5) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 425 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 426 | main.RamCloud7.del_db() |
| 427 | time.sleep(3) |
| 428 | main.RamCloud7.start_serv() |
| 429 | time.sleep(3) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 430 | """ |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 431 | main.ONOS7.start() |
| 432 | main.ONOS7.start_rest() |
| 433 | time.sleep(5) |
| 434 | 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() |
| 435 | for i in range(3): |
| 436 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 437 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 438 | 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() |
| 439 | else: |
| 440 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 441 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale up successful - 7-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 442 | time.sleep(10) |
| 443 | |
| 444 | |
| 445 | |
| 446 | def CASE41(self,main): |
| 447 | main.case("Starting SB test for 4 nodes") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 448 | main.log.report("SB Throughput test: loading 4-node ONOS cluster with 740 Topo Events/s") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 449 | ip1 = main.params['CTRL']['ip1'] |
| 450 | ip2 = main.params['CTRL']['ip2'] |
| 451 | ip3 = main.params['CTRL']['ip3'] |
| 452 | ip4 = main.params['CTRL']['ip4'] |
| 453 | rate1 = main.params['RATE1'] |
| 454 | run_dur = main.params['RUN_DUR'] |
| 455 | loop = int( main.params['loop']) |
| 456 | switches_num = main.params['switches_num'] |
| 457 | port = main.params['port'] |
| 458 | print loop |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 459 | sleep_init = int(main.params['sleep_init']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 460 | sleep_t =int( main.params['sleep_t']) |
| 461 | 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] | 462 | 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) |
| 463 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 464 | import time |
| 465 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 466 | import math |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 467 | time.sleep(sleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 468 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 469 | url1 = main.params['url1'] |
| 470 | url2 = main.params['url2'] |
| 471 | url3 = main.params['url3'] |
| 472 | url4 = main.params['url4'] |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 473 | tpval = 0.0 |
| 474 | global tpavg4n |
| 475 | tpavg4n = 0.0 |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 476 | |
| 477 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale4nodesrate1", "a") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 478 | for i in range(int (loop)): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 479 | j1 = main.ONOS2.get_json(url1) |
| 480 | j2 = main.ONOS2.get_json(url2) |
| 481 | j3 = main.ONOS2.get_json(url3) |
| 482 | j4 = main.ONOS2.get_json(url4) |
| 483 | json_str = [] |
| 484 | json_str.append(0) |
| 485 | json_str.append(j1) |
| 486 | json_str.append(j2) |
| 487 | json_str.append(j3) |
| 488 | json_str.append(j4) |
| 489 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "": |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 490 | for j in range(1,5): |
| 491 | f.write("ONOS" + str(j) + "\n") |
| 492 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 493 | f.write('\t') |
| 494 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 495 | f.write('\t') |
| 496 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 497 | f.write('\t') |
| 498 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 499 | f.write('\t') |
| 500 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 501 | f.write('\n') |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 502 | if j == 4: |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 503 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 504 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 505 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 506 | f.write('\n') |
| 507 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 508 | f.write("--------------------------------------------------------------------------------- \n") |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 509 | time.sleep(sleep_t) |
| 510 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 511 | print("\n") |
| 512 | tpavg4n = round(tpval)/loop |
| 513 | print tpavg4n |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 514 | main.log.report("Topology Event Throughput for 4-node ONOS cluster = " + str(tpavg4n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 515 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 516 | time.sleep(5) |
| 517 | main.Mininet2.handle.expect("\$", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 518 | time.sleep(180) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 519 | |
| 520 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 521 | def CASE43(self,main): |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 522 | |
| 523 | main.case("Starting NB Throughput test after scaling up to 4 onos nodes") |
| 524 | ip1 = main.params['CTRL']['ip1'] |
| 525 | ip2 = main.params['CTRL']['ip2'] |
| 526 | ip3 = main.params['CTRL']['ip3'] |
| 527 | ip4 = main.params['CTRL']['ip4'] |
| 528 | |
| 529 | import time |
| 530 | import json |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 531 | int_num = int(main.params['int_num']) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 532 | addrate = main.params['addrate'] |
| 533 | NBdur = main.params['NBdur'] |
| 534 | NBsleep = int(main.params['NBsleep']) |
| 535 | NBsleep_init = int(main.params['NBsleep_init']) |
| 536 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 537 | nbtpval = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 538 | main.log.report("Starting NB Throughput test: loading 4-node ONOS cluster with " +str(int_num) + " Intents/s on each node" ) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 539 | global nbtpavg4n |
| 540 | nbtpavg4n = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 541 | int_r = 4 * int_num |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 542 | main.Mininet4.handle.expect("\$") |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 543 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633") |
| 544 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633") |
| 545 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633") |
| 546 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633") |
| 547 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip1 + ":6633") |
| 548 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip2 + ":6633") |
| 549 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip4 + ":6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 550 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 551 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 552 | main.ONOS3.handle.expect("\$") |
| 553 | |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 554 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 4 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 555 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 556 | |
| 557 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 558 | time.sleep(NBsleep_init) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 559 | import json |
| 560 | |
| 561 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 562 | url1 = main.params['url1'] |
| 563 | url2 = main.params['url2'] |
| 564 | url3 = main.params['url3'] |
| 565 | url4 = main.params['url4'] |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 566 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale4nodesrate1", "a") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 567 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 568 | j1 = main.ONOS2.get_json(url1) |
| 569 | j2 = main.ONOS2.get_json(url2) |
| 570 | j3 = main.ONOS2.get_json(url3) |
| 571 | j4 = main.ONOS2.get_json(url4) |
| 572 | json_str = [] |
| 573 | json_str.append(0) |
| 574 | json_str.append(j1) |
| 575 | json_str.append(j2) |
| 576 | json_str.append(j3) |
| 577 | json_str.append(j4) |
| 578 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "": |
| 579 | for j in range(1,5): |
| 580 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 581 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 582 | f.write('\t') |
| 583 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 584 | f.write('\t') |
| 585 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 586 | f.write('\t') |
| 587 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 588 | f.write('\t') |
| 589 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 590 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 591 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 592 | f.write('\n') |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 593 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 594 | f.write("--------------------------------------------------------------------------------- \n") |
| 595 | |
| 596 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 597 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 598 | f.write('\t') |
| 599 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 600 | f.write('\t') |
| 601 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 602 | f.write('\t') |
| 603 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 604 | f.write('\t') |
| 605 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 606 | f.write('\n') |
| 607 | f.write('\n') |
| 608 | f.write('\n') |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 609 | |
| 610 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 611 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 612 | f.write("--------------------------------------------------------------------------------- \n") |
| 613 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 614 | time.sleep(NBsleep) |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 615 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 616 | print("\n") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 617 | nbtpavg4n = round(round(nbtpval)/NBloop,2) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 618 | print nbtpavg4n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 619 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 620 | |
| 621 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 622 | time.sleep(180) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 623 | main.log.report("Intent Throughput for 4-node ONOS cluster = " + str(nbtpavg4n) + " Intents/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 624 | |
| 625 | def CASE51(self,main): |
| 626 | main.case("Starting SB test for 5 nodes") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 627 | main.log.report("SB Throughput test: loading 5-node ONOS cluster with 740 Topo Events/s") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 628 | ip1 = main.params['CTRL']['ip1'] |
| 629 | ip2 = main.params['CTRL']['ip2'] |
| 630 | ip3 = main.params['CTRL']['ip3'] |
| 631 | ip4 = main.params['CTRL']['ip4'] |
| 632 | ip5 = main.params['CTRL']['ip5'] |
| 633 | rate1 = main.params['RATE1'] |
| 634 | run_dur = main.params['RUN_DUR'] |
| 635 | loop = int( main.params['loop']) |
| 636 | switches_num = main.params['switches_num'] |
| 637 | port = main.params['port'] |
| 638 | print loop |
| 639 | sleep_init = int(main.params['sleep_init']) |
| 640 | sleep_t =int( main.params['sleep_t']) |
| 641 | main.case("Starting SB load on 5 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 642 | 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) |
| 643 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 644 | import time |
| 645 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 646 | tpval = 0.0 |
| 647 | global tpavg5n |
| 648 | tpavg5n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 649 | time.sleep(sleep_init) |
| 650 | |
| 651 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 652 | url1 = main.params['url1'] |
| 653 | url2 = main.params['url2'] |
| 654 | url3 = main.params['url3'] |
| 655 | url4 = main.params['url4'] |
| 656 | url5 = main.params['url5'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 657 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale5nodesrate1", "a") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 658 | for i in range(int (loop)): |
| 659 | j1 = main.ONOS2.get_json(url1) |
| 660 | j2 = main.ONOS2.get_json(url2) |
| 661 | j3 = main.ONOS2.get_json(url3) |
| 662 | j4 = main.ONOS2.get_json(url4) |
| 663 | j5 = main.ONOS2.get_json(url5) |
| 664 | json_str = [] |
| 665 | json_str.append(0) |
| 666 | json_str.append(j1) |
| 667 | json_str.append(j2) |
| 668 | json_str.append(j3) |
| 669 | json_str.append(j4) |
| 670 | json_str.append(j5) |
| 671 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "": |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 672 | for j in range(1,6): |
| 673 | f.write("ONOS" + str(j) + "\n") |
| 674 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 675 | f.write('\t') |
| 676 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 677 | f.write('\t') |
| 678 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 679 | f.write('\t') |
| 680 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 681 | f.write('\t') |
| 682 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 683 | f.write('\n') |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 684 | if j == 4: |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 685 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 686 | |
| 687 | f.write('\n') |
| 688 | f.write('\n') |
| 689 | |
| 690 | f.write("--------------------------------------------------------------------------------- \n") |
| 691 | time.sleep(sleep_t) |
| 692 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 693 | print("\n") |
| 694 | tpavg5n = round(tpval)/loop |
| 695 | print tpavg5n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 696 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 697 | time.sleep(5) |
| 698 | main.Mininet2.handle.expect("\$", timeout=900) |
| 699 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 700 | main.log.report("Topology Event Throughput for 5-node ONOS cluster = " + str(tpavg5n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 701 | |
| 702 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 703 | def CASE53(self,main): |
| 704 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 705 | main.case("Starting NB Throughput test after scaling up to 5 onos nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 706 | ip1 = main.params['CTRL']['ip1'] |
| 707 | ip2 = main.params['CTRL']['ip2'] |
| 708 | ip3 = main.params['CTRL']['ip3'] |
| 709 | ip4 = main.params['CTRL']['ip4'] |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 710 | ip5 = main.params['CTRL']['ip5'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 711 | |
| 712 | import time |
| 713 | import json |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 714 | int_num = int(main.params['int_num']) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 715 | addrate = main.params['addrate'] |
| 716 | NBdur = main.params['NBdur'] |
| 717 | NBsleep = int(main.params['NBsleep']) |
| 718 | NBsleep_init = int(main.params['NBsleep_init']) |
| 719 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 720 | nbtpval = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 721 | main.log.report("Starting NB Throughput test: loading 5-node ONOS cluster with " + str(int_num) + " Intents/s on each node" ) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 722 | global nbtpavg5n |
| 723 | nbtpavg5n = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 724 | int_r = 5 * int_num |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 725 | main.Mininet4.handle.expect("\$") |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 726 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633") |
| 727 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633") |
| 728 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633") |
| 729 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633") |
| 730 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633") |
| 731 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip3 + ":6633") |
| 732 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip5 + ":6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 733 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 734 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 735 | main.ONOS3.handle.expect("\$") |
| 736 | |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 737 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 5 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip5 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 738 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 739 | |
| 740 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 741 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 742 | import json |
| 743 | |
| 744 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 745 | url1 = main.params['url1'] |
| 746 | url2 = main.params['url2'] |
| 747 | url3 = main.params['url3'] |
| 748 | url4 = main.params['url4'] |
| 749 | url5 = main.params['url5'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 750 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale5nodesrate1", "a") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 751 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 752 | j1 = main.ONOS2.get_json(url1) |
| 753 | j2 = main.ONOS2.get_json(url2) |
| 754 | j3 = main.ONOS2.get_json(url3) |
| 755 | j4 = main.ONOS2.get_json(url4) |
| 756 | j5 = main.ONOS2.get_json(url5) |
| 757 | json_str = [] |
| 758 | json_str.append(0) |
| 759 | json_str.append(j1) |
| 760 | json_str.append(j2) |
| 761 | json_str.append(j3) |
| 762 | json_str.append(j4) |
| 763 | json_str.append(j5) |
| 764 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "": |
| 765 | for j in range(1,6): |
| 766 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 767 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 768 | f.write('\t') |
| 769 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 770 | f.write('\t') |
| 771 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 772 | f.write('\t') |
| 773 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 774 | f.write('\t') |
| 775 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 776 | f.write('\n') |
| 777 | |
| 778 | f.write('\n') |
| 779 | |
| 780 | f.write("--------------------------------------------------------------------------------- \n") |
| 781 | |
| 782 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 783 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 784 | f.write('\t') |
| 785 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 786 | f.write('\t') |
| 787 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 788 | f.write('\t') |
| 789 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 790 | f.write('\t') |
| 791 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 792 | f.write('\n') |
| 793 | f.write('\n') |
| 794 | f.write('\n') |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 795 | |
| 796 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 797 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 798 | |
| 799 | f.write("--------------------------------------------------------------------------------- \n") |
| 800 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 801 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 802 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 803 | print("\n") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 804 | nbtpavg5n = round(round(nbtpval)/NBloop,2) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 805 | print nbtpavg5n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 806 | |
| 807 | |
| 808 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 809 | time.sleep(180) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 810 | main.log.report("Intent Throughput for 5-node ONOS cluster = " + str(nbtpavg5n) + " Intents/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 811 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 812 | def CASE61(self,main): |
| 813 | main.case("Starting SB test for 5 nodes") |
| 814 | ip1 = main.params['CTRL']['ip1'] |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 815 | main.log.report("SB Throughput test: loading 6-node ONOS cluster with 740 Topo Events/s") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 816 | ip2 = main.params['CTRL']['ip2'] |
| 817 | ip3 = main.params['CTRL']['ip3'] |
| 818 | ip4 = main.params['CTRL']['ip4'] |
| 819 | ip5 = main.params['CTRL']['ip5'] |
| 820 | ip6 = main.params['CTRL']['ip6'] |
| 821 | rate1 = main.params['RATE1'] |
| 822 | run_dur = main.params['RUN_DUR'] |
| 823 | loop = int( main.params['loop']) |
| 824 | switches_num = main.params['switches_num'] |
| 825 | port = main.params['port'] |
| 826 | print loop |
| 827 | sleep_t =int( main.params['sleep_t']) |
| 828 | sleep_init = int(main.params['sleep_init']) |
| 829 | main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 830 | 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) |
| 831 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 832 | |
| 833 | import time |
| 834 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 835 | tpval = 0.0 |
| 836 | global tpavg6n |
| 837 | tpavg6n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 838 | time.sleep(sleep_init) |
| 839 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 840 | url1 = main.params['url1'] |
| 841 | url2 = main.params['url2'] |
| 842 | url3 = main.params['url3'] |
| 843 | url4 = main.params['url4'] |
| 844 | url5 = main.params['url5'] |
| 845 | url6 = main.params['url6'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 846 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale6nodesrate1", "a") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 847 | for i in range(int (loop)): |
| 848 | j1 = main.ONOS2.get_json(url1) |
| 849 | j2 = main.ONOS2.get_json(url2) |
| 850 | j3 = main.ONOS2.get_json(url3) |
| 851 | j4 = main.ONOS2.get_json(url4) |
| 852 | j5 = main.ONOS2.get_json(url5) |
| 853 | j6 = main.ONOS2.get_json(url6) |
| 854 | json_str = [] |
| 855 | json_str.append(0) |
| 856 | json_str.append(j1) |
| 857 | json_str.append(j2) |
| 858 | json_str.append(j3) |
| 859 | json_str.append(j4) |
| 860 | json_str.append(j5) |
| 861 | json_str.append(j6) |
| 862 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "": |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 863 | for j in range(1,7): |
| 864 | f.write("ONOS" + str(j) + "\n") |
| 865 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 866 | f.write('\t') |
| 867 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 868 | f.write('\t') |
| 869 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 870 | f.write('\t') |
| 871 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 872 | f.write('\t') |
| 873 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 874 | f.write('\n') |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 875 | if j == 4: |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 876 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 877 | |
| 878 | f.write('\n') |
| 879 | f.write('\n') |
| 880 | |
| 881 | f.write("--------------------------------------------------------------------------------- \n") |
| 882 | time.sleep(sleep_t) |
| 883 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 884 | print("\n") |
| 885 | tpavg6n = round(tpval)/loop |
| 886 | print tpavg6n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 887 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 888 | time.sleep(5) |
| 889 | main.Mininet2.handle.expect("\$", timeout=900) |
| 890 | time.sleep(180) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 891 | main.log.report("Topology Event Throughput for 6-node ONOS cluster = " + str(tpavg6n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 892 | |
| 893 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 894 | def CASE63(self,main): |
| 895 | |
| 896 | main.case("Starting NB Throughput test after scaling up to 4 onos nodes") |
| 897 | ip1 = main.params['CTRL']['ip1'] |
| 898 | ip2 = main.params['CTRL']['ip2'] |
| 899 | ip3 = main.params['CTRL']['ip3'] |
| 900 | ip4 = main.params['CTRL']['ip4'] |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 901 | ip5 = main.params['CTRL']['ip5'] |
| 902 | ip6 = main.params['CTRL']['ip6'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 903 | |
| 904 | import time |
| 905 | import json |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 906 | int_num = int(main.params['int_num']) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 907 | addrate = main.params['addrate'] |
| 908 | NBdur = main.params['NBdur'] |
| 909 | NBsleep = int(main.params['NBsleep']) |
| 910 | NBsleep_init = int(main.params['NBsleep_init']) |
| 911 | NBloop = int(main.params['NBloop']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 912 | nbtpval = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 913 | main.log.report("Starting NB Throughput test: loading 6-node ONOS cluster with " + str(int_num) + " Intents/s" ) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 914 | global nbtpavg6n |
| 915 | nbtpavg6n = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 916 | int_r = 6 * int_num |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 917 | main.Mininet4.handle.expect("\$") |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 918 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633") |
| 919 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633") |
| 920 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633") |
| 921 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633") |
| 922 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633") |
| 923 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip6 + ":6633") |
| 924 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip6 + ":6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 925 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 926 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 927 | main.ONOS3.handle.expect("\$") |
| 928 | |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 929 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 6 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip5 + ":8080 " + ip6 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 930 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 931 | |
| 932 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 933 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 934 | import json |
| 935 | |
| 936 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 937 | url1 = main.params['url1'] |
| 938 | url2 = main.params['url2'] |
| 939 | url3 = main.params['url3'] |
| 940 | url4 = main.params['url4'] |
| 941 | url5 = main.params['url5'] |
| 942 | url6 = main.params['url6'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 943 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale6nodesrate1", "a") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 944 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 945 | j1 = main.ONOS2.get_json(url1) |
| 946 | j2 = main.ONOS2.get_json(url2) |
| 947 | j3 = main.ONOS2.get_json(url3) |
| 948 | j4 = main.ONOS2.get_json(url4) |
| 949 | j5 = main.ONOS2.get_json(url5) |
| 950 | j6 = main.ONOS2.get_json(url6) |
| 951 | json_str = [] |
| 952 | json_str.append(0) |
| 953 | json_str.append(j1) |
| 954 | json_str.append(j2) |
| 955 | json_str.append(j3) |
| 956 | json_str.append(j4) |
| 957 | json_str.append(j5) |
| 958 | json_str.append(j6) |
| 959 | if json_str[1] != "" and json_str[2] != "" and json_str[3] != "" and json_str[4] != "" and json_str[5] != "" and json_str[6] != "": |
| 960 | for j in range(1,7): |
| 961 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 962 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 963 | f.write('\t') |
| 964 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 965 | f.write('\t') |
| 966 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 967 | f.write('\t') |
| 968 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 969 | f.write('\t') |
| 970 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 971 | f.write('\n') |
| 972 | |
| 973 | f.write('\n') |
| 974 | |
| 975 | f.write("--------------------------------------------------------------------------------- \n") |
| 976 | |
| 977 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 978 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 979 | f.write('\t') |
| 980 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 981 | f.write('\t') |
| 982 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 983 | f.write('\t') |
| 984 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 985 | f.write('\t') |
| 986 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 987 | f.write('\n') |
| 988 | f.write('\n') |
| 989 | f.write('\n') |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 990 | |
| 991 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 992 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 993 | |
| 994 | f.write("--------------------------------------------------------------------------------- \n") |
| 995 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 996 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 997 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 998 | print("\n") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 999 | nbtpavg6n = round(round(nbtpval)/NBloop,2) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1000 | print nbtpavg6n |
| 1001 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1002 | |
| 1003 | |
| 1004 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1005 | time.sleep(180) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1006 | main.log.report("Intent Throughput for 6-node ONOS cluster = " + str(nbtpavg6n) + " Intents/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1007 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1008 | def CASE71(self,main): |
| 1009 | main.case("Starting SB test for 7 nodes") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1010 | main.log.report("SB Throughput test: loading 7-node ONOS cluster with 740 Topo Events/s") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1011 | ip1 = main.params['CTRL']['ip1'] |
| 1012 | ip2 = main.params['CTRL']['ip2'] |
| 1013 | ip3 = main.params['CTRL']['ip3'] |
| 1014 | ip4 = main.params['CTRL']['ip4'] |
| 1015 | ip5 = main.params['CTRL']['ip5'] |
| 1016 | ip6 = main.params['CTRL']['ip6'] |
| 1017 | ip7 = main.params['CTRL']['ip7'] |
| 1018 | rate1 = main.params['RATE1'] |
| 1019 | run_dur = main.params['RUN_DUR'] |
| 1020 | loop = int( main.params['loop']) |
| 1021 | switches_num = main.params['switches_num'] |
| 1022 | port = main.params['port'] |
| 1023 | print loop |
| 1024 | sleep_t =int( main.params['sleep_t']) |
| 1025 | sleep_init = int(main.params['sleep_init']) |
| 1026 | main.case("Starting SB load on 6 nodes from mininet with " + rate1 +" added/removed/s for " + run_dur) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1027 | 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) |
| 1028 | main.Mininet2.handle.expect("Starting SB load....", timeout=900) |
| 1029 | import time |
| 1030 | import json |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1031 | tpval = 0.0 |
| 1032 | global tpavg7n |
| 1033 | tpavg7n = 0.0 |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1034 | time.sleep(sleep_init) |
| 1035 | |
| 1036 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1037 | url1 = main.params['url1'] |
| 1038 | url2 = main.params['url2'] |
| 1039 | url3 = main.params['url3'] |
| 1040 | url4 = main.params['url4'] |
| 1041 | url5 = main.params['url5'] |
| 1042 | url6 = main.params['url6'] |
| 1043 | url7 = main.params['url7'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1044 | |
| 1045 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/scale7nodesrate1", "a") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1046 | for i in range(int (loop)): |
| 1047 | j1 = main.ONOS2.get_json(url1) |
| 1048 | j2 = main.ONOS2.get_json(url2) |
| 1049 | j3 = main.ONOS2.get_json(url3) |
| 1050 | j4 = main.ONOS2.get_json(url4) |
| 1051 | j5 = main.ONOS2.get_json(url5) |
| 1052 | j6 = main.ONOS2.get_json(url6) |
| 1053 | j7 = main.ONOS2.get_json(url7) |
| 1054 | json_str = [] |
| 1055 | json_str.append(0) |
| 1056 | json_str.append(j1) |
| 1057 | json_str.append(j2) |
| 1058 | json_str.append(j3) |
| 1059 | json_str.append(j4) |
| 1060 | json_str.append(j5) |
| 1061 | json_str.append(j6) |
| 1062 | json_str.append(j7) |
| 1063 | 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] != "": |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1064 | for j in range(1,8): |
| 1065 | f.write("ONOS" + str(j) + "\n") |
| 1066 | f.write(str(json_str[j]["meters"][4]['meter']['count'])) |
| 1067 | f.write('\t') |
| 1068 | f.write(str(json_str[j]["meters"][4]['meter']['m1_rate'])) |
| 1069 | f.write('\t') |
| 1070 | f.write(str(json_str[j]["meters"][4]['meter']['m5_rate'])) |
| 1071 | f.write('\t') |
| 1072 | f.write(str(json_str[j]["meters"][4]['meter']['m15_rate'])) |
| 1073 | f.write('\t') |
| 1074 | f.write(str(json_str[j]["meters"][4]['meter']['mean_rate'])) |
| 1075 | f.write('\n') |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1076 | if j == 4: |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1077 | tpval += float(json_str[j]["meters"][4]['meter']['m1_rate']) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1078 | |
| 1079 | f.write('\n') |
| 1080 | f.write('\n') |
| 1081 | |
| 1082 | f.write("--------------------------------------------------------------------------------- \n") |
| 1083 | time.sleep(sleep_t) |
| 1084 | f.close() |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1085 | print("\n") |
| 1086 | tpavg7n = round(tpval)/loop |
| 1087 | print tpavg7n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1088 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1089 | time.sleep(5) |
| 1090 | main.Mininet2.handle.expect("\$", timeout=900) |
| 1091 | time.sleep(180) |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1092 | main.log.report("Topology Event Throughput for 7-node ONOS cluster = " + str(tpavg7n) + " Events/sec") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1093 | |
| 1094 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1095 | def CASE73(self,main): |
| 1096 | |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 1097 | main.case("Starting NB Throughput test after scaling up to 7 onos nodes") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1098 | ip1 = main.params['CTRL']['ip1'] |
| 1099 | ip2 = main.params['CTRL']['ip2'] |
| 1100 | ip3 = main.params['CTRL']['ip3'] |
| 1101 | ip4 = main.params['CTRL']['ip4'] |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1102 | ip5 = main.params['CTRL']['ip5'] |
| 1103 | ip6 = main.params['CTRL']['ip6'] |
| 1104 | ip7 = main.params['CTRL']['ip7'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1105 | |
| 1106 | import time |
| 1107 | import json |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 1108 | int_num = int(main.params['int_num']) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1109 | addrate = main.params['addrate'] |
| 1110 | NBdur = main.params['NBdur'] |
| 1111 | NBsleep = int(main.params['NBsleep']) |
| 1112 | NBsleep_init = int(main.params['NBsleep_init']) |
| 1113 | NBloop = int(main.params['NBloop']) |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 1114 | main.log.report("Starting NB Throughput test: loading 7-node ONOS cluster with " + str(int_num) + " Intents/s" ) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1115 | nbtpval = 0.0 |
| 1116 | global nbtpavg7n |
| 1117 | nbtpavg7n = 0.0 |
santhosh | fe0c27d | 2014-08-29 11:18:25 -0700 | [diff] [blame] | 1118 | int_r = 7 * int_num |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1119 | main.Mininet4.handle.expect("\$") |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1120 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s1 tcp:" + ip1 + ":6633") |
| 1121 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s2 tcp:" + ip2 + ":6633") |
| 1122 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s3 tcp:" + ip3 + ":6633") |
| 1123 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s4 tcp:" + ip4 + ":6633") |
| 1124 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s5 tcp:" + ip5 + ":6633") |
| 1125 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s6 tcp:" + ip6 + ":6633") |
| 1126 | main.Mininet4.handle.sendline("sudo ovs-vsctl set-controller s7 tcp:" + ip7 + ":6633") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1127 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1128 | main.ONOS3.handle.sendline("cd ~admin/suibin-dev") |
| 1129 | main.ONOS3.handle.expect("\$") |
| 1130 | |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1131 | main.ONOS3.handle.sendline("./loadgen_NB.py -n 7 -u \"" + ip1 + ":8080 " + ip2 + ":8080 " + ip3 + ":8080 " + ip4 + ":8080 " + ip6 + ":8080 " + ip5 + ":8080 " + ip7 + ":8080 \" -i " + str(int_r) + " -a " + addrate + " -l " + NBdur + " -p 20") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1132 | main.ONOS3.handle.expect("Pause between add and delete:", timeout=900) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1133 | |
| 1134 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1135 | time.sleep(NBsleep_init) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1136 | import json |
| 1137 | |
| 1138 | open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", 'w').close() |
santhosh | c587750 | 2014-09-08 12:07:23 -0700 | [diff] [blame^] | 1139 | url1 = main.params['url1'] |
| 1140 | url2 = main.params['url2'] |
| 1141 | url3 = main.params['url3'] |
| 1142 | url4 = main.params['url4'] |
| 1143 | url5 = main.params['url5'] |
| 1144 | url6 = main.params['url6'] |
| 1145 | url7 = main.params['url7'] |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1146 | f = open("/home/admin/TestON/tests/scaleONOS7nodes/logs/NBscale7nodesrate1", "a") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1147 | for i in range(NBloop): |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1148 | j1 = main.ONOS2.get_json(url1) |
| 1149 | j2 = main.ONOS2.get_json(url2) |
| 1150 | j3 = main.ONOS2.get_json(url3) |
| 1151 | j4 = main.ONOS2.get_json(url4) |
| 1152 | j5 = main.ONOS2.get_json(url5) |
| 1153 | j6 = main.ONOS2.get_json(url6) |
| 1154 | j7 = main.ONOS2.get_json(url7) |
| 1155 | json_str = [] |
| 1156 | json_str.append(0) |
| 1157 | json_str.append(j1) |
| 1158 | json_str.append(j2) |
| 1159 | json_str.append(j3) |
| 1160 | json_str.append(j4) |
| 1161 | json_str.append(j5) |
| 1162 | json_str.append(j6) |
| 1163 | json_str.append(j7) |
| 1164 | 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] != "": |
| 1165 | for j in range(1,8): |
| 1166 | f.write("*****************ONOS" + str(j) + " INCOMING RATE****************************" "\n") |
| 1167 | f.write(str(json_str[j]["meters"][0]['meter']['count'])) |
| 1168 | f.write('\t') |
| 1169 | f.write(str(json_str[j]["meters"][0]['meter']['m1_rate'])) |
| 1170 | f.write('\t') |
| 1171 | f.write(str(json_str[j]["meters"][0]['meter']['m5_rate'])) |
| 1172 | f.write('\t') |
| 1173 | f.write(str(json_str[j]["meters"][0]['meter']['m15_rate'])) |
| 1174 | f.write('\t') |
| 1175 | f.write(str(json_str[j]["meters"][0]['meter']['mean_rate'])) |
| 1176 | f.write('\n') |
| 1177 | |
| 1178 | f.write('\n') |
| 1179 | |
| 1180 | f.write("--------------------------------------------------------------------------------- \n") |
| 1181 | |
| 1182 | f.write("***************** ONOS" + str(j) + " PROCESSING RATE************************" + " \n ") |
| 1183 | f.write(str(json_str[j]["meters"][1]['meter']['count'])) |
| 1184 | f.write('\t') |
| 1185 | f.write(str(json_str[j]["meters"][1]['meter']['m1_rate'])) |
| 1186 | f.write('\t') |
| 1187 | f.write(str(json_str[j]["meters"][1]['meter']['m5_rate'])) |
| 1188 | f.write('\t') |
| 1189 | f.write(str(json_str[j]["meters"][1]['meter']['m15_rate'])) |
| 1190 | f.write('\t') |
| 1191 | f.write(str(json_str[j]["meters"][1]['meter']['mean_rate'])) |
| 1192 | f.write('\n') |
| 1193 | f.write('\n') |
| 1194 | f.write('\n') |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1195 | |
| 1196 | nbtpval += float(json_str[j]["meters"][1]['meter']['m1_rate']) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1197 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1198 | |
| 1199 | f.write("--------------------------------------------------------------------------------- \n") |
| 1200 | f.write("--------------------------------------------------------------------------------- \n \n") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1201 | time.sleep(NBsleep) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1202 | f.close() |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1203 | print("\n") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1204 | nbtpavg7n = round(round(nbtpval)/NBloop,2) |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1205 | print nbtpavg7n |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1206 | |
| 1207 | |
| 1208 | main.ONOS3.handle.expect("\$", timeout=900) |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1209 | time.sleep(180) |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1210 | main.log.report("Intent Throughput for 7-node ONOS cluster = " + str(nbtpavg7n) + " Intents/sec") |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1211 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1212 | def CASE8(self,main): |
| 1213 | import time |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1214 | main.log.report("Scaling ONOS down to 6 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1215 | main.ONOS7.handle.sendline("./onos.sh core stop") |
| 1216 | time.sleep(8) |
| 1217 | pdata = main.ONOS7.isup() |
| 1218 | utilities.assert_equals(expect=main.FALSE,actual=pdata,onpass="ONOS7 stopped... ",onfail="ONOS scale down failed...") |
| 1219 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1220 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 1221 | for i in range(3): |
| 1222 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1223 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1224 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() |
| 1225 | else: |
| 1226 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1227 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull -6-node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1228 | |
| 1229 | def CASE9(self,main): |
| 1230 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1231 | main.log.report("Scaling ONOS down to 5 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1232 | main.ONOS6.handle.sendline("./onos.sh core stop") |
| 1233 | time.sleep(8) |
| 1234 | pdata = main.ONOS6.isup() and main.ONOS7.isup() |
| 1235 | 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] | 1236 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 1237 | for i in range(3): |
| 1238 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1239 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1240 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() and main.ONOS5.isup() |
| 1241 | else: |
| 1242 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1243 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successfull - 5 node ONOS clsuter is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1244 | |
| 1245 | def CASE10(self,main): |
| 1246 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1247 | main.log.report("Scaling ONOS down to 4 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1248 | |
| 1249 | main.ONOS5.handle.sendline("./onos.sh core stop ") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1250 | time.sleep(5) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1251 | pdata = main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 1252 | 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] | 1253 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 1254 | for i in range(3): |
| 1255 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1256 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1257 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() and main.ONOS4.isup() |
| 1258 | else: |
| 1259 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1260 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 4 node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1261 | |
| 1262 | def CASE11(self,main): |
| 1263 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1264 | main.log.report("Scaling ONOS down to 3 ONOS instances") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1265 | main.ONOS4.handle.sendline("./onos.sh core stop ") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1266 | time.sleep(5) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1267 | pdata = main.ONOS4.isup() and main.ONOS5.isup() and main.ONOS6.isup() and main.ONOS7.isup() |
| 1268 | 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] | 1269 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() |
| 1270 | for i in range(3): |
| 1271 | if data == main.FALSE: |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1272 | time.sleep(3) |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1273 | data = main.ONOS1.isup() and main.ONOS2.isup() and main.ONOS3.isup() |
| 1274 | else: |
| 1275 | break |
santhosh | 5d159cc | 2014-08-25 14:24:53 -0700 | [diff] [blame] | 1276 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Scale down successful - 3 node ONOS cluster is up and running!",onfail="ONOS didn't start...") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1277 | |
| 1278 | def CASE100(self,main): |
| 1279 | import os |
| 1280 | import time |
| 1281 | global timestr |
| 1282 | timestr = time.strftime("%Y%m%d-%H%M%S") |
| 1283 | main.case("Scale-up tests complete...now making final changes") |
| 1284 | main.log.info("moving logs....") |
| 1285 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1286 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_up" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1287 | time.sleep(2) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1288 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_up" + timestr + "") |
| 1289 | 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] | 1290 | time.sleep(2) |
| 1291 | os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1292 | time.sleep(180) |
| 1293 | |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1294 | def CASE101(self,main): |
| 1295 | |
| 1296 | import os |
| 1297 | import time |
| 1298 | main.case("Scale-down tests complete...now making final changes") |
| 1299 | global timestr |
| 1300 | main.case("Scale-down tests complete...now making final changes") |
| 1301 | main.log.info("moving logs....") |
| 1302 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1303 | os.system("sudo mkdir ~admin/TestON/tests/scaleONOS7nodes/logs/NBONOSscale_dwn" + timestr + "") |
santhosh | bc42142 | 2014-08-17 09:48:49 -0700 | [diff] [blame] | 1304 | time.sleep(2) |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1305 | os.system("sudo cp ~admin/TestON/tests/scaleONOS7nodes/logs/scale* ~admin/TestON/tests/scaleONOS7nodes/logs/ONOSscale_dwn" + timestr + "") |
| 1306 | 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] | 1307 | time.sleep(2) |
| 1308 | os.system("sudo rm ~admin/TestON/tests/scaleONOS7nodes/logs/*") |
| 1309 | time.sleep(2) |
| 1310 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1311 | def CASE103(self,main): |
| 1312 | import os |
| 1313 | import time |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1314 | main.log.report("Posting the results to http://10.128.5.54/scale.html") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1315 | db_script = main.params['db_script'] |
santhosh | 581e415 | 2014-08-20 12:13:40 -0700 | [diff] [blame] | 1316 | os.system(db_script + " -n='100SwitchScaleUp" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'") |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1317 | main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html") |
| 1318 | |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1319 | def CASE104(self,main): |
| 1320 | import os |
| 1321 | import time |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1322 | main.log.report("Posting the results to http://10.128.5.54/scale.html ....") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1323 | db_script = main.params['db_script'] |
santhosh | 483a416 | 2014-08-20 22:40:51 -0700 | [diff] [blame] | 1324 | os.system(db_script + " -n='100SwitchScaleDown" + "' -rate3='" + str(tpavg3n) + "' -rate4='" + str(tpavg4n) + "' -rate5='" + str(tpavg5n) + "' -rate6='" + str(tpavg6n) + "' -rate7='" + str(tpavg7n) + "' -table='onos_scale'") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1325 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1326 | main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1327 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1328 | def CASE105(self,main): |
| 1329 | import os |
| 1330 | import time |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1331 | main.log.report("Posting the results to http://10.128.5.54/scale.html ....") |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1332 | db_script = main.params['db_script'] |
| 1333 | os.system(db_script + " -n='1000IntentsScaleUp" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'") |
| 1334 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1335 | main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html") |
| 1336 | |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1337 | def CASE106(self,main): |
| 1338 | import os |
| 1339 | import time |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1340 | main.log.report("Posting the results to http://10.128.5.54/scale.html ....") |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1341 | db_script = main.params['db_script'] |
santhosh | d395712 | 2014-08-21 19:33:58 -0700 | [diff] [blame] | 1342 | os.system(db_script + " -n='1000IntentsScaleDown" + "' -rate3='" + str(nbtpavg3n) + "' -rate4='" + str(nbtpavg4n) + "' -rate5='" + str(nbtpavg5n) + "' -rate6='" + str(nbtpavg6n) + "' -rate7='" + str(nbtpavg7n) + "' -table='onos_scale'") |
santhosh | 518cc67 | 2014-08-20 16:32:26 -0700 | [diff] [blame] | 1343 | |
santhosh | 11cbaed | 2014-08-26 15:17:36 -0700 | [diff] [blame] | 1344 | main.log.report("The graphical view of the tests can be viewed at http://10.128.5.54/scale.html") |
santhosh | fe88a20 | 2014-08-19 18:53:23 -0700 | [diff] [blame] | 1345 | |
santhosh | 91195f1 | 2014-08-07 13:53:50 -0700 | [diff] [blame] | 1346 | |