admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 1 | |
| 2 | class RCOnosPerf4nodes: |
| 3 | |
| 4 | def __init__(self) : |
| 5 | self.default = '' |
| 6 | |
| 7 | def CASE1(self,main) : |
| 8 | ''' |
| 9 | First case is to simply check if ONOS, ZK, and RamCloud are all running properly. |
| 10 | If ONOS if not running properly, it will restart ONOS once before continuing. |
| 11 | It will then check if the ONOS has a view of all the switches and links as defined in the params file. |
| 12 | The test will only pass if ONOS is running properly, and has a full view of all topology elements. |
| 13 | ''' |
| 14 | import time |
admin | 1723f1c | 2014-05-19 16:08:39 -0700 | [diff] [blame] | 15 | |
| 16 | |
| 17 | |
| 18 | |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 19 | main.ONOS1.stop() |
| 20 | main.ONOS2.stop() |
| 21 | main.ONOS3.stop() |
| 22 | main.ONOS4.stop() |
admin | aef0055 | 2014-05-08 09:18:36 -0700 | [diff] [blame] | 23 | main.RamCloud1.stop_coor() |
| 24 | main.RamCloud1.stop_serv() |
| 25 | main.RamCloud2.stop_serv() |
| 26 | main.RamCloud3.stop_serv() |
| 27 | main.RamCloud4.stop_serv() |
admin | 1723f1c | 2014-05-19 16:08:39 -0700 | [diff] [blame] | 28 | main.Zookeeper1.stop() |
| 29 | main.Zookeeper2.stop() |
| 30 | main.Zookeeper3.stop() |
| 31 | main.Zookeeper4.stop() |
| 32 | |
| 33 | main.Zookeeper1.start() |
| 34 | main.Zookeeper2.start() |
| 35 | main.Zookeeper3.start() |
| 36 | main.Zookeeper4.start() |
| 37 | main.RamCloud1.del_db() |
| 38 | main.RamCloud2.del_db() |
| 39 | main.RamCloud3.del_db() |
| 40 | main.RamCloud4.del_db() |
| 41 | |
| 42 | |
admin | aef0055 | 2014-05-08 09:18:36 -0700 | [diff] [blame] | 43 | time.sleep(10) |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 44 | main.RamCloud1.start_coor() |
| 45 | main.RamCloud1.start_serv() |
| 46 | main.RamCloud2.start_serv() |
| 47 | main.RamCloud3.start_serv() |
| 48 | main.RamCloud4.start_serv() |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 49 | main.ONOS1.start() |
| 50 | time.sleep(10) |
| 51 | main.ONOS2.start() |
| 52 | main.ONOS3.start() |
| 53 | main.ONOS4.start() |
| 54 | main.ONOS1.start_rest() |
| 55 | time.sleep(5) |
| 56 | test= main.ONOS1.rest_status() |
| 57 | if test == main.FALSE: |
| 58 | main.ONOS1.start_rest() |
| 59 | main.ONOS1.get_version() |
| 60 | main.log.report("Startup check Zookeeper1, RamCloud1, and ONOS1 connections") |
| 61 | main.case("Checking if the startup was clean...") |
| 62 | main.step("Testing startup Zookeeper") |
| 63 | data = main.Zookeeper1.isup() |
| 64 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="Zookeeper is up!",onfail="Zookeeper is down...") |
| 65 | main.step("Testing startup RamCloud") |
Jon Hall | e80ef8c | 2014-04-29 15:29:13 -0700 | [diff] [blame] | 66 | data = main.RamCloud1.server_status() |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 67 | if data == main.FALSE: |
| 68 | main.RamCloud1.stop_coor() |
| 69 | main.RamCloud1.stop_serv() |
| 70 | main.RamCloud2.stop_serv() |
| 71 | main.RamCloud3.stop_serv() |
| 72 | main.RamCloud4.stop_serv() |
| 73 | |
| 74 | time.sleep(5) |
| 75 | main.RamCloud1.start_coor() |
| 76 | main.RamCloud1.start_serv() |
| 77 | main.RamCloud2.start_serv() |
| 78 | main.RamCloud3.start_serv() |
| 79 | main.RamCloud4.start_serv() |
| 80 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="RamCloud is up!",onfail="RamCloud is down...") |
| 81 | main.step("Testing startup ONOS") |
| 82 | data = main.ONOS1.isup() |
| 83 | data = data and main.ONOS2.isup() |
| 84 | data = data and main.ONOS3.isup() |
| 85 | data = data and main.ONOS4.isup() |
| 86 | if data == main.FALSE: |
| 87 | main.log.report("Something is funny... restarting ONOS") |
| 88 | main.ONOS1.stop() |
| 89 | main.ONOS2.stop() |
| 90 | main.ONOS3.stop() |
| 91 | main.ONOS4.stop() |
| 92 | time.sleep(5) |
| 93 | main.ONOS1.start() |
| 94 | time.sleep(10) |
| 95 | main.ONOS2.start() |
| 96 | main.ONOS3.start() |
| 97 | main.ONOS4.start() |
| 98 | data = main.ONOS1.isup() |
| 99 | utilities.assert_equals(expect=main.TRUE,actual=data,onpass="ONOS is up and running!",onfail="ONOS didn't start...") |
| 100 | |
| 101 | def CASE2(self,main) : |
| 102 | ''' |
| 103 | Makes sure that the HW links are all up |
| 104 | Verifies that at least one mininet host exists. |
| 105 | Proves that there is actually a mininet that we are working with |
| 106 | ''' |
| 107 | import time |
| 108 | main.step("Checking if MN switches exist") |
| 109 | main.log.report("Check if MN switches exist") |
| 110 | #result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links']) |
| 111 | #for i in range(2): |
| 112 | # if result == main.FALSE: |
| 113 | # time.sleep(5) |
| 114 | # result = main.ONOS1.check_status_report(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links']) |
| 115 | # else: |
| 116 | # break |
| 117 | #main.step("Verifying the result") |
| 118 | #utilities.assert_equals(expect=main.TRUE,actual=result,onpass="MN switches exist",onfail="MN is missing switches and or links...") |
| 119 | |
| 120 | main.step("assigning ONOS controllers to switches") |
| 121 | for i in range(25): |
| 122 | if i < 3: |
| 123 | j=i+1 |
| 124 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1']) |
| 125 | time.sleep(1) |
| 126 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4']) |
| 127 | elif i >= 3 and i < 5: |
| 128 | j=i+1 |
| 129 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip2'],port1=main.params['CTRL']['port2']) |
| 130 | time.sleep(1) |
| 131 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4']) |
| 132 | elif i >= 5 and i < 15: |
| 133 | j=i+1 |
| 134 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip3'],port1=main.params['CTRL']['port3']) |
| 135 | time.sleep(1) |
| 136 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4']) |
| 137 | else: |
| 138 | j=i+16 |
| 139 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip4'],port1=main.params['CTRL']['port4']) |
| 140 | time.sleep(1) |
| 141 | main.Mininet1.assign_sw_controller(sw=str(j),ip1=main.params['CTRL']['ip1'],port1=main.params['CTRL']['port1'],ip2=main.params['CTRL']['ip2'],port2=main.params['CTRL']['port2'],ip3=main.params['CTRL']['ip3'],port3=main.params['CTRL']['port3'],ip4=main.params['CTRL']['ip4'],port4=main.params['CTRL']['port4']) |
| 142 | main.Mininet1.get_sw_controller("s1") |
| 143 | time.sleep(5) |
| 144 | |
| 145 | def CASE3(self,main) : |
| 146 | ''' |
| 147 | Verifies that ONOS sees the right topology... |
| 148 | ''' |
| 149 | import time |
| 150 | main.log.report("checking if ONOS sees the right topo...") |
| 151 | main.case("TOPO check") |
| 152 | main.step("calling rest calls") |
| 153 | for i in range(4): |
| 154 | result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links']) |
| 155 | time.sleep(5) |
| 156 | if result == 1: |
| 157 | break |
| 158 | if result == 0: |
| 159 | main.ONOS1.start() |
| 160 | main.ONOS2.start() |
| 161 | main.ONOS3.start() |
| 162 | main.ONOS4.start() |
| 163 | time.sleep(45) |
| 164 | for i in range(4): |
| 165 | result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links']) |
| 166 | time.sleep(5) |
| 167 | if result == 1: |
| 168 | break |
| 169 | utilities.assert_equals(expect=1,actual=result) |
| 170 | |
| 171 | def CASE4(self,main) : |
| 172 | ''' |
| 173 | This Test case: |
| 174 | - Clears out any leftover flows |
| 175 | - Adds new flows into ONOS |
| 176 | - Checks flows up to 10 times waiting for each flow to be caluculated and no "NOT" statements inte get_flow |
| 177 | ''' |
| 178 | import time |
| 179 | main.log.report("Deleting and adding flows") |
| 180 | main.case("Taking care of these flows!") |
| 181 | main.step("Cleaning out any leftover flows...") |
| 182 | main.log.info("deleting...") |
Jon Hall | e80ef8c | 2014-04-29 15:29:13 -0700 | [diff] [blame] | 183 | main.ONOS1.rm_flow() |
| 184 | # main.ONOS1.delete_flow("all") |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 185 | main.log.info("adding...") |
| 186 | t1 = time.time() |
Jon Hall | e80ef8c | 2014-04-29 15:29:13 -0700 | [diff] [blame] | 187 | main.ONOS1.ad_flow() |
| 188 | # main.ONOS1.add_flow(main.params['FLOWDEF']) |
admin | cb59391 | 2014-04-14 10:34:41 -0700 | [diff] [blame] | 189 | main.log.info("Checking...") |
| 190 | for i in range(15): |
| 191 | result = main.ONOS1.check_flow() |
| 192 | if result == main.TRUE: |
| 193 | t2 = time.time() |
| 194 | main.log.info( 'Adding flows took %0.3f s' % (t2-t1)) |
| 195 | break |
| 196 | time.sleep(5) |
| 197 | main.log.info("Checking Flows again...") |
| 198 | |
| 199 | strtTime = time.time() |
| 200 | count = 1 |
| 201 | i = 6 |
| 202 | while i < 16 : |
| 203 | main.log.info("\n\t\t\t\th"+str(i)+" IS PINGING h"+str(i+25) ) |
| 204 | ping = main.Mininet1.pingHost(src="h"+str(i),target="h"+str(i+25)) |
| 205 | if ping == main.FALSE and count < 3: |
| 206 | count = count + 1 |
| 207 | i = 6 |
| 208 | main.log.info("Ping failed, making attempt number "+str(count)+" in 10 seconds") |
| 209 | time.sleep(10) |
| 210 | elif ping == main.FALSE and count ==3: |
| 211 | main.log.error("Ping test failed") |
| 212 | i = 17 |
| 213 | result = main.FALSE |
| 214 | elif ping == main.TRUE: |
| 215 | i = i + 1 |
| 216 | result = main.TRUE |
| 217 | endTime = time.time() |
| 218 | if result == main.TRUE: |
| 219 | main.log.info("\tTime to complete ping test: "+str(round(endTime-strtTime,2))+" seconds") |
| 220 | else: |
| 221 | main.log.info("\tPING TEST FAIL") |
| 222 | |
| 223 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="flows are good",onfail="FLOWS not correct") |
| 224 | |
| 225 | main.log.report("checking if ONOS sees the right topo...") |
| 226 | main.case("TOPO check") |
| 227 | main.step("calling rest calls") |
| 228 | for i in range(3): |
| 229 | result = main.ONOS1.check_status(main.params['RestIP'],main.params['NR_Switches'],main.params['NR_Links']) |
| 230 | time.sleep(5) |
| 231 | if result == 1: |
| 232 | break |
| 233 | |
| 234 | def CASE5(self,main) : |
| 235 | ''' |
| 236 | Tests a single ping |
| 237 | ''' |
| 238 | main.log.report("Testing a single ping") |
| 239 | main.case("Testing ping...") |
| 240 | ping_result = main.Mininet4.pingHost(src=main.params['PING']['source1'],target=main.params['PING']['target1']) |
| 241 | utilities.assert_equals(expect=main.TRUE,actual=ping_result,onpass="NO PACKET LOSS, HOST IS REACHABLE",onfail="PACKET LOST, HOST IS NOT REACHABLE") |
| 242 | |
| 243 | |
| 244 | def CASE6(self,main) : |
| 245 | ''' |
| 246 | Starts continuous pings on the Mininet nodes |
| 247 | ''' |
| 248 | main.log.report("Starting continuous ping, then toggle a single link in the center triangle") |
| 249 | import time |
| 250 | import os |
| 251 | main.case("Starting long ping... ") |
| 252 | main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1']) |
| 253 | main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2']) |
| 254 | main.Mininet4.pingLong(src=main.params['PING']['source3'],target=main.params['PING']['target3']) |
| 255 | main.Mininet4.pingLong(src=main.params['PING']['source4'],target=main.params['PING']['target4']) |
| 256 | main.Mininet4.pingLong(src=main.params['PING']['source5'],target=main.params['PING']['target5']) |
| 257 | main.Mininet4.pingLong(src=main.params['PING']['source6'],target=main.params['PING']['target6']) |
| 258 | main.Mininet4.pingLong(src=main.params['PING']['source7'],target=main.params['PING']['target7']) |
| 259 | main.Mininet4.pingLong(src=main.params['PING']['source8'],target=main.params['PING']['target8']) |
| 260 | main.Mininet4.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9']) |
| 261 | main.Mininet4.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10']) |
| 262 | main.step("Check that the pings are going") |
| 263 | result = main.Mininet4.pingstatus(src=main.params['PING']['source1']) |
| 264 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source2']) |
| 265 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source3']) |
| 266 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source4']) |
| 267 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source5']) |
| 268 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source6']) |
| 269 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source7']) |
| 270 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source8']) |
| 271 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source9']) |
| 272 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source10']) |
| 273 | main.step( "Link down number of iterations: " + main.params['Iterations'] ) |
| 274 | for i in range(int(main.params['Iterations'])): |
| 275 | main.log.info("Bringing Link down... ") |
| 276 | main.Mininet1.link(END1="s1",END2="s2",OPTION="down") |
| 277 | main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " ) |
| 278 | time.sleep( int(main.params['WaitTime']) ) |
| 279 | main.log.info("Bringing Link up... ") |
| 280 | main.Mininet1.link(END1="s1",END2="s2",OPTION="up") |
| 281 | main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " ) |
| 282 | time.sleep( int(main.params['WaitTime']) ) |
| 283 | main.case("Killing remote ping processes ") |
| 284 | result = result & main.Mininet4.pingKill() |
| 285 | utilities.assert_equals(expect=main.TRUE,actual=result) |
| 286 | |
| 287 | |
| 288 | def CASE7(self,main) : |
| 289 | ''' |
| 290 | Processes all of the ping data and outputs raw data and an overall average |
| 291 | ''' |
| 292 | import os |
| 293 | import time |
| 294 | main.log.report("Process ping data (Fail is time is >20 seconds)") |
| 295 | main.case("Processing Ping data") |
| 296 | time.sleep(3) |
| 297 | #result=os.popen("/home/admin/tools/shell.sh " + main.params['Iterations']).read() |
| 298 | try: |
| 299 | result=os.popen("/home/admin/ONLabTest/TestON/scripts/get_reroute_times.py").read() |
| 300 | average=result.split(":")[1] |
| 301 | main.log.info( "Reroute times are... " ) |
| 302 | main.log.report( result + " seconds" ) |
| 303 | try: |
| 304 | if float(average) < float(main.params['TargetTime']) : |
| 305 | test=main.TRUE |
| 306 | else: |
| 307 | test=main.FALSE |
| 308 | except ValueError: |
| 309 | main.log.error("Data is corrupted") |
| 310 | test=main.FALSE |
| 311 | except: |
| 312 | main.log.report("No data") |
| 313 | test=main.FALSE |
| 314 | utilities.assert_equals(expect=main.TRUE,actual=test,onpass="Average is less then the target time!",onfail="Average is worse then target time... ") |
| 315 | |
| 316 | def CASE8(self,main) : |
| 317 | ''' |
| 318 | Starts continuous pings on the Mininet nodes |
| 319 | ''' |
| 320 | main.log.report("Start continuous pings, then toggle multiple links in center triangle") |
| 321 | import time |
| 322 | import os |
| 323 | time.sleep(20) |
| 324 | main.case("Starting long ping... ") |
| 325 | main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1']) |
| 326 | main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2']) |
| 327 | main.Mininet4.pingLong(src=main.params['PING']['source3'],target=main.params['PING']['target3']) |
| 328 | main.Mininet4.pingLong(src=main.params['PING']['source4'],target=main.params['PING']['target4']) |
| 329 | main.Mininet4.pingLong(src=main.params['PING']['source5'],target=main.params['PING']['target5']) |
| 330 | main.Mininet4.pingLong(src=main.params['PING']['source6'],target=main.params['PING']['target6']) |
| 331 | main.Mininet4.pingLong(src=main.params['PING']['source7'],target=main.params['PING']['target7']) |
| 332 | main.Mininet4.pingLong(src=main.params['PING']['source8'],target=main.params['PING']['target8']) |
| 333 | main.Mininet4.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9']) |
| 334 | main.Mininet4.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10']) |
| 335 | main.step("Check that the pings are going") |
| 336 | result = main.Mininet4.pingstatus(src=main.params['PING']['source1']) |
| 337 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source2']) |
| 338 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source3']) |
| 339 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source4']) |
| 340 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source5']) |
| 341 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source6']) |
| 342 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source7']) |
| 343 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source8']) |
| 344 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source9']) |
| 345 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source10']) |
| 346 | main.step( "Making topo change while flows are rerouting") |
| 347 | main.step( "Link down number of iterations: " + main.params['Iterations'] ) |
| 348 | for i in range(int(main.params['Iterations'])): |
| 349 | main.log.info("s1-s2 link down") |
| 350 | main.Mininet1.link(END1="s1",END2="s2",OPTION="down") |
| 351 | main.Mininet1.link(END1="s1",END2="s3",OPTION="up") |
| 352 | main.Mininet1.link(END1="s2",END2="s3",OPTION="up") |
| 353 | |
| 354 | time.sleep(5) |
| 355 | |
| 356 | main.log.info("s1-s2 link up | s1-s3 link down | s2-s3 link down") |
| 357 | main.Mininet1.link(END1="s1",END2="s2",OPTION="up") |
| 358 | main.Mininet1.link(END1="s1",END2="s3",OPTION="down") |
| 359 | main.Mininet1.link(END1="s2",END2="s3",OPTION="down") |
| 360 | |
| 361 | main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " ) |
| 362 | time.sleep( int(main.params['WaitTime']) + 60 ) |
| 363 | |
| 364 | main.case("Killing remote ping processes ") |
| 365 | result = result & main.Mininet4.pingKill() |
| 366 | utilities.assert_equals(expect=main.TRUE,actual=result) |
| 367 | main.log.info("Make sure all links in triangle are up") |
| 368 | main.Mininet1.link(END1="s1",END2="s2",OPTION="up") |
| 369 | main.Mininet1.link(END1="s1",END2="s3",OPTION="up") |
| 370 | main.Mininet1.link(END1="s2",END2="s3",OPTION="up") |
| 371 | |
| 372 | def CASE9(self,main) : |
| 373 | ''' |
| 374 | Starts continuous pings on the Mininet nodes |
| 375 | ''' |
| 376 | main.log.report("Start continuous pings, then toggle one link in center triangle and start/stop 1 ONOS node") |
| 377 | import time |
| 378 | import os |
| 379 | |
| 380 | time.sleep(20) |
| 381 | main.case("Starting long ping... ") |
| 382 | main.Mininet4.pingLong(src=main.params['PING']['source1'],target=main.params['PING']['target1']) |
| 383 | main.Mininet4.pingLong(src=main.params['PING']['source2'],target=main.params['PING']['target2']) |
| 384 | main.Mininet4.pingLong(src=main.params['PING']['source3'],target=main.params['PING']['target3']) |
| 385 | main.Mininet4.pingLong(src=main.params['PING']['source4'],target=main.params['PING']['target4']) |
| 386 | main.Mininet4.pingLong(src=main.params['PING']['source5'],target=main.params['PING']['target5']) |
| 387 | main.Mininet4.pingLong(src=main.params['PING']['source6'],target=main.params['PING']['target6']) |
| 388 | main.Mininet4.pingLong(src=main.params['PING']['source7'],target=main.params['PING']['target7']) |
| 389 | main.Mininet4.pingLong(src=main.params['PING']['source8'],target=main.params['PING']['target8']) |
| 390 | main.Mininet4.pingLong(src=main.params['PING']['source9'],target=main.params['PING']['target9']) |
| 391 | main.Mininet4.pingLong(src=main.params['PING']['source10'],target=main.params['PING']['target10']) |
| 392 | main.step("Check that the pings are going") |
| 393 | result = main.Mininet4.pingstatus(src=main.params['PING']['source1']) |
| 394 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source2']) |
| 395 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source3']) |
| 396 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source4']) |
| 397 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source5']) |
| 398 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source6']) |
| 399 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source7']) |
| 400 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source8']) |
| 401 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source9']) |
| 402 | result = result & main.Mininet4.pingstatus(src=main.params['PING']['source10']) |
| 403 | main.step( "Making topo change while flows are rerouting") |
| 404 | main.step( "Link down number of iterations: " + main.params['Iterations'] ) |
| 405 | for i in range(int(main.params['Iterations'])): |
| 406 | main.log.info("s1-s2 link down | Onos 1 down") |
| 407 | main.Mininet1.link(END1="s1",END2="s2",OPTION="down") |
| 408 | if i % 4 == 0: |
| 409 | main.ONOS1.stop() |
| 410 | elif i % 4 == 1: |
| 411 | main.ONOS2.stop() |
| 412 | elif i % 4 == 2: |
| 413 | main.ONOS3.stop() |
| 414 | else: |
| 415 | main.ONOS4.stop() |
| 416 | |
| 417 | time.sleep(5) |
| 418 | |
| 419 | main.log.info("s1-s2 link up | Onos 1 back up") |
| 420 | main.Mininet1.link(END1="s1",END2="s2",OPTION="up") |
| 421 | if i % 4 == 0: |
| 422 | main.ONOS1.start() |
| 423 | main.ONOS1.isup() |
| 424 | elif i % 4 == 1: |
| 425 | main.ONOS2.start() |
| 426 | main.ONOS2.isup() |
| 427 | elif i % 4 == 2: |
| 428 | main.ONOS3.start() |
| 429 | main.ONOS3.isup() |
| 430 | else: |
| 431 | main.ONOS4.start() |
| 432 | main.ONOS4.isup() |
| 433 | |
| 434 | main.log.info( "Waiting " + main.params['WaitTime'] + " seconds.... " ) |
| 435 | time.sleep( int(main.params['WaitTime']) ) |
| 436 | |
| 437 | main.case("Killing remote ping processes ") |
| 438 | result = result & main.Mininet4.pingKill() |
| 439 | utilities.assert_equals(expect=main.TRUE,actual=result) |
| 440 | |
admin | 1723f1c | 2014-05-19 16:08:39 -0700 | [diff] [blame] | 441 | def CASE66(self, main): |
| 442 | main.log.report("Checking ONOS logs for exceptions") |
| 443 | check1 = main.ONOS1.check_exceptions() |
| 444 | main.log.report("Exceptions in ONOS1 logs: \n" + check1) |
| 445 | check2 = main.ONOS2.check_exceptions() |
| 446 | main.log.report("Exceptions in ONOS2 logs: \n" + check2) |
| 447 | check3 = main.ONOS3.check_exceptions() |
| 448 | main.log.report("Exceptions in ONOS3 logs: \n" + check3) |
| 449 | check4 = main.ONOS4.check_exceptions() |
| 450 | main.log.report("Exceptions in ONOS4 logs: \n" + check4) |
| 451 | result = main.FALSE |
| 452 | if (check1 or check2 or check3 or check4): |
| 453 | result = main.TRUE |
| 454 | utilities.assert_equals(expect=main.TRUE,actual=result,onpass="No Exceptions found in the logs",onfail="Exceptions found") |
| 455 | |
| 456 | |