pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 1 | # Testing the functionality of SDN-IP with single ONOS instance |
| 2 | class USECASE_SdnipFunctionCluster: |
| 3 | |
| 4 | def __init__( self ): |
| 5 | self.default = '' |
| 6 | global branchName |
| 7 | |
| 8 | def CASE100( self, main ): |
| 9 | """ |
| 10 | Start mininet |
| 11 | """ |
| 12 | import imp |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 13 | main.case( "Setup the Mininet testbed" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 14 | main.dependencyPath = main.testDir + \ |
| 15 | main.params[ 'DEPENDENCY' ][ 'path' ] |
| 16 | main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ] |
| 17 | |
| 18 | main.step( "Starting Mininet Topology" ) |
| 19 | topology = main.dependencyPath + main.topology |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 20 | topoResult = main.Mininet.startNet( topoFile=topology ) |
| 21 | utilities.assert_equals( expect=main.TRUE, |
| 22 | actual=topoResult, |
| 23 | onpass="Successfully loaded topology", |
| 24 | onfail="Failed to load topology" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 25 | # Exit if topology did not load properly |
| 26 | if not topoResult: |
| 27 | main.cleanup() |
| 28 | main.exit() |
| 29 | main.step( "Connect switches to controllers" ) |
| 30 | |
| 31 | # connect all switches to controllers |
| 32 | swResult = main.TRUE |
| 33 | for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ): |
| 34 | sw = "sw%s" % ( i ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 35 | swResult = swResult and main.Mininet.assignSwController( sw, main.ONOSip ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 36 | utilities.assert_equals( expect=main.TRUE, |
| 37 | actual=swResult, |
| 38 | onpass="Successfully connect all switches to ONOS", |
| 39 | onfail="Failed to connect all switches to ONOS" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 40 | if not swResult: |
| 41 | main.cleanup() |
| 42 | main.exit() |
| 43 | |
| 44 | |
| 45 | def CASE101( self, main ): |
| 46 | """ |
| 47 | Package ONOS and install it |
| 48 | Startup sequence: |
| 49 | cell <name> |
| 50 | onos-verify-cell |
| 51 | onos-package |
| 52 | onos-install -f |
| 53 | onos-wait-for-start |
| 54 | """ |
| 55 | import json |
| 56 | import time |
| 57 | import os |
| 58 | from operator import eq |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 59 | global p64514 |
| 60 | global p64515 |
| 61 | global p64516 |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 62 | p64514 = main.params[ 'config' ][ 'p64514' ] |
| 63 | p64515 = main.params[ 'config' ][ 'p64515' ] |
| 64 | p64516 = main.params[ 'config' ][ 'p64516' ] |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 65 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 66 | try: |
| 67 | from tests.USECASE.dependencies.sdnipBaseFunction import SdnBase |
| 68 | except ImportError: |
| 69 | main.log.error( "sdnBase not found. exiting the test" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 70 | main.exit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 71 | try: |
| 72 | main.sdnBase |
| 73 | except ( NameError, AttributeError ): |
| 74 | main.sdnBase = SdnBase() |
| 75 | |
| 76 | main.sdnBase.initSetup() |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 77 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 78 | def CASE200( self, main ): |
| 79 | main.case( "Activate sdn-ip application" ) |
| 80 | main.log.info( "waiting link discovery......" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 81 | time.sleep( int( main.params['timers']['TopoDiscovery'] ) ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 82 | |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 83 | main.step( "Get links in the network" ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 84 | summaryResult = main.ONOScli1.summary() |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 85 | linkNum = json.loads( summaryResult )[ "links" ] |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 86 | main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 87 | if linkNum < 100: |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 88 | main.log.error( "Link number is wrong! Retrying..." ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 89 | time.sleep( int( main.params['timers']['TopoDiscovery'] ) ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 90 | summaryResult = main.ONOScli1.summary() |
| 91 | linkNum = json.loads( summaryResult )[ "links" ] |
| 92 | main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) ) |
| 93 | utilities.assert_equals( expect=100, |
| 94 | actual=linkNum, |
| 95 | onpass="ONOS correctly discovered all links", |
| 96 | onfail="ONOS Failed to discover all links" ) |
| 97 | if linkNum < 100: |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 98 | main.cleanup() |
| 99 | main.exit() |
| 100 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 101 | main.step( "Activate sdn-ip application" ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 102 | activeSDNIPresult = main.ONOScli1.activateApp( "org.onosproject.sdnip" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 103 | utilities.assert_equals( expect=main.TRUE, |
| 104 | actual=activeSDNIPresult, |
| 105 | onpass="Activate SDN-IP succeeded", |
| 106 | onfail="Activate SDN-IP failed" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 107 | if not activeSDNIPresult: |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 108 | main.log.info( "Activate SDN-IP failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 109 | main.cleanup() |
| 110 | main.exit() |
| 111 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 112 | def CASE102( self, main ): |
| 113 | ''' |
| 114 | This test case is to load the methods from other Python files, and create |
| 115 | tunnels from mininet host to onos nodes. |
| 116 | ''' |
| 117 | import time |
| 118 | main.case( "Load methods from other Python file and create tunnels" ) |
| 119 | # load the methods from other file |
| 120 | wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ] |
| 121 | main.Functions = imp.load_source( wrapperFile1, |
| 122 | main.dependencyPath + |
| 123 | wrapperFile1 + |
| 124 | ".py" ) |
| 125 | # Create tunnels |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 126 | for i in range ( len( main.ONOSip ) ): |
| 127 | main.Functions.setupTunnel( main, '1.1.1.' + str( ( i + 1 ) * 2 ), 2000, main.ONOSip[ i ], 2000 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 128 | |
| 129 | main.log.info( "Wait SDN-IP to finish installing connectivity intents \ |
| 130 | and the BGP paths in data plane are ready..." ) |
| 131 | time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) ) |
| 132 | |
| 133 | main.log.info( "Wait Quagga to finish delivery all routes to each \ |
| 134 | other and to sdn-ip, plus finish installing all intents..." ) |
| 135 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 136 | |
| 137 | def CASE1( self, main ): |
| 138 | ''' |
| 139 | ping test from 3 bgp peers to BGP speaker |
| 140 | ''' |
| 141 | |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 142 | main.case( "Ping between BGP peers and speakers" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 143 | main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ], |
| 144 | peers=[ "p64514", "p64515", "p64516" ], |
| 145 | expectAllSuccess=True ) |
| 146 | |
| 147 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 148 | peers=[ p64514, p64515, p64516 ], |
| 149 | expectAllSuccess=True ) |
| 150 | |
| 151 | main.Functions.pingSpeakerToPeer( main, speakers=[ "spk3" ], |
| 152 | peers=[ "p64519", "p64520" ], |
| 153 | expectAllSuccess=True ) |
| 154 | |
| 155 | main.Functions.pingSpeakerToPeer( main, speakers=[ "spk4" ], |
| 156 | peers=[ "p64517", "p64518" ], |
| 157 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 158 | |
| 159 | def CASE2( self, main ): |
| 160 | ''' |
| 161 | point-to-point intents test for each BGP peer and BGP speaker pair |
| 162 | ''' |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 163 | main.sdnBase.pToPIntentTest( 12 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 164 | |
| 165 | def CASE3( self, main ): |
| 166 | ''' |
| 167 | routes and intents check to all BGP peers |
| 168 | ''' |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 169 | import time |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 170 | main.case( "Check routes and M2S intents to all BGP peers" ) |
| 171 | |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 172 | main.step( "Check routes installed" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 173 | allRoutesExpected = [] |
| 174 | allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" ) |
| 175 | allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" ) |
| 176 | allRoutesExpected.append( "6.0.0.0/24" + "/" + "10.0.6.1" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 177 | allRoutesExpected.append( "7.0.0.0/24" + "/" + "10.0.7.1" ) |
| 178 | allRoutesExpected.append( "8.0.0.0/24" + "/" + "10.0.8.1" ) |
| 179 | allRoutesExpected.append( "9.0.0.0/24" + "/" + "10.0.9.1" ) |
| 180 | allRoutesExpected.append( "20.0.0.0/24" + "/" + "10.0.20.1" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 181 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 182 | main.sdnBase.routeAndIntentCheck( allRoutesExpected, 7 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 183 | |
| 184 | |
| 185 | def CASE4( self, main ): |
| 186 | ''' |
| 187 | Ping test in data plane for each route |
| 188 | ''' |
| 189 | main.case( "Ping test for each route, all hosts behind BGP peers" ) |
| 190 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 191 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 192 | expectAllSuccess=True ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 193 | main.Functions.pingHostToHost(main, |
| 194 | hosts=["h64517", "h64518"], |
| 195 | expectAllSuccess=True) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 196 | main.Functions.pingHostToHost( main, |
| 197 | hosts=[ "h64519", "h64520" ], |
| 198 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 199 | |
| 200 | def CASE5( self, main ): |
| 201 | ''' |
| 202 | Cut links to peers one by one, check routes/intents |
| 203 | ''' |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 204 | main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516", |
| 205 | 6, 6, 5, 5, 4, 4, |
| 206 | "spk1", [ "h64514", "h64515", "h64516" ], |
| 207 | "down" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 208 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 209 | def CASE6( self, main ): |
| 210 | ''' |
| 211 | Recover links to peers one by one, check routes/intents |
| 212 | ''' |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 213 | main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516", |
| 214 | 5, 5, 6, 6, 7, 7, |
| 215 | "spk1", [ "h64514", "h64515", "h64516" ], |
| 216 | "up" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 217 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 218 | def CASE7( self, main ): |
| 219 | ''' |
| 220 | Shut down a edge switch, check P-2-P and M-2-S intents, ping test |
| 221 | ''' |
| 222 | import time |
| 223 | main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" ) |
| 224 | main.step( "Stop sw32" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 225 | result = main.Mininet.switch( SW="sw32", OPTION="stop" ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 226 | utilities.assert_equals( expect=main.TRUE, actual=result, |
| 227 | onpass="Stopping switch succeeded!", |
| 228 | onfail="Stopping switch failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 229 | |
| 230 | if result == main.TRUE: |
| 231 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 232 | main.Functions.checkRouteNum( main, 6 ) |
| 233 | main.Functions.checkM2SintentNum( main, 6 ) |
| 234 | main.Functions.checkP2PintentNum( main, 48 ) #14 * 2 |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 235 | else: |
| 236 | main.log.error( "Stopping switch failed!" ) |
| 237 | main.cleanup() |
| 238 | main.exit() |
| 239 | |
| 240 | main.step( "Check ping between hosts behind BGP peers" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 241 | result1 = main.Mininet.pingHost( src="h64514", target="h64515" ) |
| 242 | result2 = main.Mininet.pingHost( src="h64515", target="h64516" ) |
| 243 | result3 = main.Mininet.pingHost( src="h64514", target="h64516" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 244 | |
| 245 | pingResult1 = ( result1 == main.FALSE ) and ( result2 == main.TRUE ) \ |
| 246 | and ( result3 == main.FALSE ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 247 | utilities.assert_equals( expect=True, actual=pingResult1, |
| 248 | onpass="Ping test result is correct", |
| 249 | onfail="Ping test result is wrong" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 250 | |
| 251 | if pingResult1 == False: |
| 252 | main.cleanup() |
| 253 | main.exit() |
| 254 | |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 255 | main.step( "Check ping between BGP peers and spk1" ) |
| 256 | result4 = main.Mininet.pingHost( src="spk1", target="p64514" ) |
| 257 | result5 = main.Mininet.pingHost( src="spk1", target="p64515" ) |
| 258 | result6 = main.Mininet.pingHost( src="spk1", target="p64516" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 259 | |
| 260 | pingResult2 = ( result4 == main.FALSE ) and ( result5 == main.TRUE ) \ |
| 261 | and ( result6 == main.TRUE ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 262 | utilities.assert_equals( expect=True, actual=pingResult2, |
| 263 | onpass="Speaker1 ping peers successful", |
| 264 | onfail="Speaker1 ping peers NOT successful" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 265 | |
| 266 | if pingResult2 == False: |
| 267 | main.cleanup() |
| 268 | main.exit() |
| 269 | |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 270 | main.step( "Check ping between BGP peers and spk2" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 271 | # TODO |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 272 | result7 = main.Mininet.pingHost( src="spk2", target=p64514 ) |
| 273 | result8 = main.Mininet.pingHost( src="spk2", target=p64515 ) |
| 274 | result9 = main.Mininet.pingHost( src="spk2", target=p64516 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 275 | |
| 276 | pingResult3 = ( result7 == main.FALSE ) and ( result8 == main.TRUE ) \ |
| 277 | and ( result9 == main.TRUE ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 278 | utilities.assert_equals( expect=True, actual=pingResult2, |
| 279 | onpass="Speaker2 ping peers successful", |
| 280 | onfail="Speaker2 ping peers NOT successful" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 281 | |
| 282 | if pingResult3 == False: |
| 283 | main.cleanup() |
| 284 | main.exit() |
| 285 | |
| 286 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 287 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 288 | main.FALSE, |
| 289 | kwargs={'isPENDING':False}, |
| 290 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 291 | utilities.assert_equals( expect=main.TRUE, |
| 292 | actual=flowCheck, |
| 293 | onpass="Flow status is correct!", |
| 294 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 295 | |
| 296 | def CASE8( self, main ): |
| 297 | ''' |
| 298 | Bring up the edge switch (sw32) which was shut down in CASE7, |
| 299 | check P-2-P and M-2-S intents, ping test |
| 300 | ''' |
| 301 | import time |
| 302 | main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" ) |
| 303 | main.step( "Start sw32" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 304 | result1 = main.Mininet.switch( SW="sw32", OPTION="start" ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 305 | utilities.assert_equals( expect=main.TRUE, |
| 306 | actual=result1, |
| 307 | onpass="Starting switch succeeded!", |
| 308 | onfail="Starting switch failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 309 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 310 | result2 = main.Mininet.assignSwController( "sw32", main.ONOSip[ 0 ] ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 311 | utilities.assert_equals( expect=main.TRUE, |
| 312 | actual=result2, |
| 313 | onpass="Connect switch to ONOS succeeded!", |
| 314 | onfail="Connect switch to ONOS failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 315 | |
| 316 | if result1 and result2: |
| 317 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 318 | main.Functions.checkRouteNum( main, 7 ) |
| 319 | main.Functions.checkM2SintentNum( main, 7 ) |
| 320 | main.Functions.checkP2PintentNum( main, 30 * 2 ) # 18*2 |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 321 | else: |
| 322 | main.log.error( "Starting switch failed!" ) |
| 323 | main.cleanup() |
| 324 | main.exit() |
| 325 | |
| 326 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 327 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 328 | main.FALSE, |
| 329 | kwargs={'isPENDING':False}, |
| 330 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 331 | utilities.assert_equals( expect=main.TRUE, |
| 332 | actual=flowCheck, |
| 333 | onpass="Flow status is correct!", |
| 334 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 335 | |
| 336 | # Ping test |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 337 | main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ], |
| 338 | peers=["p64514", "p64515", "p64516"], |
| 339 | expectAllSuccess=True ) |
| 340 | |
| 341 | main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ], |
| 342 | peers=[ p64514, p64515, p64516 ], |
| 343 | expectAllSuccess=True ) |
| 344 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 345 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 346 | hosts=[ "h64514", "h64515", "h64516" ], |
| 347 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 348 | |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 349 | def CASE9( self, main ): |
| 350 | ''' |
| 351 | Bring down a switch in best path, check: |
| 352 | route number, P2P intent number, M2S intent number, ping test |
| 353 | ''' |
| 354 | main.case( "Stop sw11 located in best path, \ |
| 355 | check route number, P2P intent number, M2S intent number, ping test" ) |
| 356 | |
| 357 | main.log.info( "Check the flow number correctness before stopping sw11" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 358 | main.Functions.checkFlowNum( main, "sw11", 49 ) |
| 359 | main.Functions.checkFlowNum( main, "sw1", 7 ) |
| 360 | main.Functions.checkFlowNum( main, "sw7", 34 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 361 | main.log.info( main.Mininet.checkFlows( "sw11" ) ) |
| 362 | main.log.info( main.Mininet.checkFlows( "sw1" ) ) |
| 363 | main.log.info( main.Mininet.checkFlows( "sw7" ) ) |
| 364 | |
| 365 | main.step( "Stop sw11" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 366 | result = main.Mininet.switch( SW="sw11", OPTION="stop" ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 367 | utilities.assert_equals( expect=main.TRUE, actual=result, |
| 368 | onpass="Stopping switch succeeded!", |
| 369 | onfail="Stopping switch failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 370 | if result: |
| 371 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
| 372 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 373 | main.Functions.checkRouteNum( main, 7 ) |
| 374 | main.Functions.checkM2SintentNum( main, 7 ) |
| 375 | main.Functions.checkP2PintentNum( main, 30 * 2 ) #18 * 2 |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 376 | else: |
| 377 | main.log.error( "Stopping switch failed!" ) |
| 378 | main.cleanup() |
| 379 | main.exit() |
| 380 | |
| 381 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 382 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 383 | main.FALSE, |
| 384 | kwargs={'isPENDING':False}, |
| 385 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 386 | utilities.assert_equals( expect=main.TRUE, |
| 387 | actual=flowCheck, |
| 388 | onpass="Flow status is correct!", |
| 389 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 390 | # Ping test |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 391 | main.Functions.pingSpeakerToPeer( main, speakers=["spk1"], |
| 392 | peers=["p64514", "p64515", "p64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 393 | expectAllSuccess=True ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 394 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 395 | peers=[p64514, p64515, p64516], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 396 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 397 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 398 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 399 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 400 | |
| 401 | |
| 402 | def CASE10( self, main ): |
| 403 | ''' |
| 404 | Bring up the switch which was stopped in CASE9, check: |
| 405 | route number, P2P intent number, M2S intent number, ping test |
| 406 | ''' |
| 407 | main.case( "Start sw11 which was stopped in CASE9, \ |
| 408 | check route number, P2P intent number, M2S intent number, ping test" ) |
| 409 | |
| 410 | main.log.info( "Check the flow status before starting sw11" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 411 | main.Functions.checkFlowNum( main, "sw1", 36 ) |
| 412 | main.Functions.checkFlowNum( main, "sw7", 30 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 413 | main.log.info( main.Mininet.checkFlows( "sw1" ) ) |
| 414 | main.log.info( main.Mininet.checkFlows( "sw7" ) ) |
| 415 | |
| 416 | main.step( "Start sw11" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 417 | result1 = main.Mininet.switch( SW="sw11", OPTION="start" ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 418 | utilities.assert_equals( expect=main.TRUE, actual=result1, |
| 419 | onpass="Starting switch succeeded!", |
| 420 | onfail="Starting switch failed!" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 421 | result2 = main.Mininet.assignSwController( "sw11", main.ONOSip[ 0 ] ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 422 | utilities.assert_equals( expect=main.TRUE, actual=result2, |
| 423 | onpass="Connect switch to ONOS succeeded!", |
| 424 | onfail="Connect switch to ONOS failed!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 425 | if result1 and result2: |
| 426 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 427 | main.Functions.checkRouteNum( main, 7 ) |
| 428 | main.Functions.checkM2SintentNum( main, 7 ) |
| 429 | main.Functions.checkP2PintentNum( main, 30 * 2 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 430 | |
| 431 | main.log.debug( main.Mininet.checkFlows( "sw11" ) ) |
| 432 | main.log.debug( main.Mininet.checkFlows( "sw1" ) ) |
| 433 | main.log.debug( main.Mininet.checkFlows( "sw7" ) ) |
| 434 | else: |
| 435 | main.log.error( "Starting switch failed!" ) |
| 436 | main.cleanup() |
| 437 | main.exit() |
| 438 | |
| 439 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 440 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 441 | main.FALSE, |
| 442 | kwargs={'isPENDING':False}, |
| 443 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 444 | utilities.assert_equals( expect=main.TRUE, |
| 445 | actual=flowCheck, |
| 446 | onpass="Flow status is correct!", |
| 447 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 448 | # Ping test |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 449 | main.Functions.pingSpeakerToPeer( main, speakers=["spk1"], |
| 450 | peers=["p64514", "p64515", "p64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 451 | expectAllSuccess=True ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 452 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 453 | peers=[p64514, p64515, p64516], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 454 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 455 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 456 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 457 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 458 | |
| 459 | |
| 460 | def CASE11(self, main): |
| 461 | import time |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 462 | main.case( "Kill spk1, check:\ |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 463 | route number, P2P intent number, M2S intent number, ping test" ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 464 | main.log.info( "Check network status before killing spk1" ) |
| 465 | main.Functions.checkRouteNum( main, 7 ) |
| 466 | main.Functions.checkM2SintentNum( main, 7 ) |
| 467 | main.Functions.checkP2PintentNum( main, 30 * 2 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 468 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 469 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 470 | main.FALSE, |
| 471 | kwargs={'isPENDING':False}, |
| 472 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 473 | utilities.assert_equals( expect=main.TRUE, |
| 474 | actual=flowCheck, |
| 475 | onpass="Flow status is correct!", |
| 476 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 477 | |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 478 | main.Functions.pingSpeakerToPeer( main, speakers=["spk1"], |
| 479 | peers=["p64514", "p64515", "p64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 480 | expectAllSuccess=True ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 481 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 482 | peers=[p64514, p64515, p64516], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 483 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 484 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 485 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 486 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 487 | |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 488 | main.step( "Kill spk1" ) |
pingping-lin | 145cd0a | 2015-10-09 17:44:34 -0700 | [diff] [blame] | 489 | command1 = "ps -e | grep bgp -c" |
| 490 | result1 = main.Mininet.node( "root", command1 ) |
| 491 | |
| 492 | # The total BGP daemon number in this test environment is 5. |
| 493 | if "5" in result1: |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 494 | main.log.debug( "Before kill spk1, 5 BGP daemons - correct" ) |
pingping-lin | 145cd0a | 2015-10-09 17:44:34 -0700 | [diff] [blame] | 495 | else: |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 496 | main.log.warn( "Before kill spk1, number of BGP daemons is wrong" ) |
pingping-lin | 145cd0a | 2015-10-09 17:44:34 -0700 | [diff] [blame] | 497 | main.log.info( result1 ) |
| 498 | |
| 499 | command2 = "sudo kill -9 `ps -ef | grep quagga-sdn.conf | grep -v grep | awk '{print $2}'`" |
| 500 | result2 = main.Mininet.node( "root", command2 ) |
| 501 | |
| 502 | result3 = main.Mininet.node( "root", command1 ) |
| 503 | |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 504 | utilities.assert_equals( expect=True, |
| 505 | actual=( "4" in result3 ), |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 506 | onpass="Kill spk1 succeeded", |
| 507 | onfail="Kill spk1 failed" ) |
pingping-lin | 145cd0a | 2015-10-09 17:44:34 -0700 | [diff] [blame] | 508 | if ( "4" not in result3 ) : |
| 509 | main.log.info( result3 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 510 | main.cleanup() |
| 511 | main.exit() |
| 512 | |
| 513 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 514 | main.Functions.checkRouteNum( main, 7 ) |
| 515 | main.Functions.checkM2SintentNum( main, 7 ) |
| 516 | main.Functions.checkP2PintentNum( main, 30 * 2 ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 517 | |
| 518 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 519 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 520 | main.FALSE, |
| 521 | kwargs={'isPENDING':False}, |
| 522 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 523 | utilities.assert_equals( expect=main.TRUE, |
| 524 | actual=flowCheck, |
| 525 | onpass="Flow status is correct!", |
| 526 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 527 | |
| 528 | ''' |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 529 | main.Functions.pingSpeakerToPeer( main, speakers=["spk1"], |
| 530 | peers=["p64514", "p64515", "p64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 531 | expectAllSuccess=False ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 532 | ''' |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 533 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 534 | peers=[p64514, p64515, p64516], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 535 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 536 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 537 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 538 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 539 | |
| 540 | |
| 541 | def CASE12( self, main ): |
| 542 | import time |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 543 | import json |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 544 | main.case( "Bring down leader ONOS node, check: \ |
| 545 | route number, P2P intent number, M2S intent number, ping test" ) |
| 546 | main.step( "Find out ONOS leader node" ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 547 | result = main.ONOScli1.leaders() |
pingping-lin | 3f932a7 | 2015-10-09 16:44:50 -0700 | [diff] [blame] | 548 | jsonResult = json.loads( result ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 549 | leaderIP = "" |
| 550 | for entry in jsonResult: |
| 551 | if entry["topic"] == "org.onosproject.sdnip": |
| 552 | leaderIP = entry["leader"] |
| 553 | main.log.info( "leaderIP is: " ) |
| 554 | main.log.info( leaderIP ) |
| 555 | |
| 556 | main.step( "Uninstall ONOS/SDN-IP leader node" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 557 | for ip in main.ONOSip: |
| 558 | if leaderIP == ip: |
| 559 | uninstallResult = main.ONOSbench.onosStop( ip ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 560 | |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 561 | utilities.assert_equals( expect=main.TRUE, |
| 562 | actual=uninstallResult, |
| 563 | onpass="Uninstall ONOS leader succeeded", |
| 564 | onfail="Uninstall ONOS leader failed" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 565 | if uninstallResult != main.TRUE: |
| 566 | main.cleanup() |
| 567 | main.exit() |
| 568 | time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 569 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 570 | if leaderIP == main.ONOSip[ 0 ]: |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 571 | main.Functions.checkRouteNum( main, 7, ONOScli="ONOScli2" ) |
| 572 | main.Functions.checkM2SintentNum( main, 7, ONOScli="ONOScli2" ) |
| 573 | main.Functions.checkP2PintentNum( main, 30 * 2, ONOScli="ONOScli2" ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 574 | |
| 575 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 576 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 577 | main.FALSE, |
| 578 | kwargs={'isPENDING':False}, |
| 579 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 580 | utilities.assert_equals( expect=main.TRUE, |
| 581 | actual=flowCheck, |
| 582 | onpass="Flow status is correct!", |
| 583 | onfail="Flow status is wrong!" ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 584 | else: |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 585 | main.Functions.checkRouteNum( main, 7 ) |
| 586 | main.Functions.checkM2SintentNum( main, 7 ) |
| 587 | main.Functions.checkP2PintentNum( main, 30 * 2 ) |
pingping-lin | a14c7c8 | 2015-10-09 15:44:36 -0700 | [diff] [blame] | 588 | |
| 589 | main.step( "Check whether all flow status are ADDED" ) |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 590 | flowCheck = utilities.retry( main.ONOScli1.checkFlowsState, |
| 591 | main.FALSE, |
| 592 | kwargs={'isPENDING':False}, |
| 593 | attempts=10 ) |
Jon Hall | 362aa92 | 2016-03-31 09:39:26 -0700 | [diff] [blame] | 594 | utilities.assert_equals( expect=main.TRUE, |
| 595 | actual=flowCheck, |
| 596 | onpass="Flow status is correct!", |
| 597 | onfail="Flow status is wrong!" ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 598 | |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 599 | main.Functions.pingSpeakerToPeer( main, speakers=["spk1"], |
| 600 | peers=["p64514", "p64515", "p64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 601 | expectAllSuccess=True ) |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 602 | main.Functions.pingSpeakerToPeer( main, speakers=["spk2"], |
| 603 | peers=[p64514, p64515, p64516], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 604 | expectAllSuccess=True ) |
pingping-lin | ea32cf8 | 2015-10-08 22:37:37 -0700 | [diff] [blame] | 605 | main.Functions.pingHostToHost( main, |
alison | 62006dd | 2016-12-15 16:21:28 -0800 | [diff] [blame] | 606 | hosts=["h64514", "h64515", "h64516"], |
Jon Hall | 6e9897d | 2016-02-29 14:41:32 -0800 | [diff] [blame] | 607 | expectAllSuccess=True ) |