Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1 | import sys |
| 2 | import os |
| 3 | import re |
| 4 | import time |
| 5 | import json |
| 6 | import itertools |
| 7 | |
| 8 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 9 | class CHOtest: |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 10 | |
| 11 | def __init__( self ): |
| 12 | self.default = '' |
| 13 | |
| 14 | def CASE1( self, main ): |
| 15 | """ |
| 16 | Startup sequence: |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 17 | apply cell <name> |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 18 | git pull |
| 19 | mvn clean install |
| 20 | onos-package |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 21 | onos-verify-cell |
| 22 | onos-uninstall |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 23 | onos-install |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 24 | onos-start-cli |
| 25 | """ |
| 26 | import time |
| 27 | |
| 28 | global intentState |
| 29 | main.threadID = 0 |
| 30 | main.pingTimeout = 300 |
| 31 | main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ] |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 32 | git_pull = main.params[ 'GIT' ][ 'autoPull' ] |
| 33 | git_branch = main.params[ 'GIT' ][ 'branch' ] |
Hari Krishna | 1006577 | 2015-07-10 15:55:53 -0700 | [diff] [blame] | 34 | karafTimeout = main.params['CTRL']['karafCliTimeout'] |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 35 | main.checkIntentsDelay = int( main.params['timers']['CheckIntentDelay'] ) |
GlennRC | f7be663 | 2015-10-20 13:04:07 -0700 | [diff] [blame] | 36 | main.failSwitch = main.params['TEST']['pauseTest'] |
GlennRC | 9e7465e | 2015-10-02 13:50:36 -0700 | [diff] [blame] | 37 | main.emailOnStop = main.params['TEST']['email'] |
GlennRC | f7be663 | 2015-10-20 13:04:07 -0700 | [diff] [blame] | 38 | main.intentCheck = int( main.params['TEST']['intentChecks'] ) |
| 39 | main.numPings = int( main.params['TEST']['numPings'] ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 40 | main.newTopo = "" |
| 41 | main.CLIs = [] |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 42 | |
GlennRC | 9e7465e | 2015-10-02 13:50:36 -0700 | [diff] [blame] | 43 | main.failSwitch = True if main.failSwitch == "on" else False |
| 44 | main.emailOnStop = True if main.emailOnStop == "on" else False |
| 45 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 46 | for i in range( 1, int(main.numCtrls) + 1 ): |
| 47 | main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 48 | |
| 49 | main.case( "Set up test environment" ) |
| 50 | main.log.report( "Set up test environment" ) |
| 51 | main.log.report( "_______________________" ) |
| 52 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 53 | main.step( "Apply Cell environment for ONOS" ) |
| 54 | if ( main.onoscell ): |
| 55 | cellName = main.onoscell |
| 56 | cell_result = main.ONOSbench.setCell( cellName ) |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 57 | utilities.assert_equals( expect=main.TRUE, actual=cell_result, |
| 58 | onpass="Test step PASS", |
| 59 | onfail="Test step FAIL" ) |
| 60 | else: |
| 61 | main.log.error( "Please provide onoscell option at TestON CLI to run CHO tests" ) |
| 62 | main.log.error( "Example: ~/TestON/bin/cli.py run OnosCHO onoscell <cellName>" ) |
| 63 | main.clean() |
| 64 | main.exit() |
| 65 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 66 | main.step( "Git checkout and pull " + git_branch ) |
| 67 | if git_pull == 'on': |
| 68 | checkout_result = main.ONOSbench.gitCheckout( git_branch ) |
| 69 | pull_result = main.ONOSbench.gitPull() |
| 70 | cp_result = ( checkout_result and pull_result ) |
| 71 | else: |
| 72 | checkout_result = main.TRUE |
| 73 | pull_result = main.TRUE |
| 74 | main.log.info( "Skipped git checkout and pull" ) |
| 75 | cp_result = ( checkout_result and pull_result ) |
| 76 | utilities.assert_equals( expect=main.TRUE, actual=cp_result, |
| 77 | onpass="Test step PASS", |
| 78 | onfail="Test step FAIL" ) |
| 79 | |
| 80 | main.step( "mvn clean & install" ) |
| 81 | if git_pull == 'on': |
| 82 | mvn_result = main.ONOSbench.cleanInstall() |
| 83 | utilities.assert_equals( expect=main.TRUE, actual=mvn_result, |
| 84 | onpass="Test step PASS", |
| 85 | onfail="Test step FAIL" ) |
| 86 | else: |
| 87 | mvn_result = main.TRUE |
| 88 | main.log.info("Skipped mvn clean install as git pull is disabled in params file") |
| 89 | |
| 90 | main.ONOSbench.getVersion( report=True ) |
| 91 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 92 | main.step( "Create ONOS package" ) |
| 93 | packageResult = main.ONOSbench.onosPackage() |
| 94 | utilities.assert_equals( expect=main.TRUE, actual=packageResult, |
| 95 | onpass="Test step PASS", |
| 96 | onfail="Test step FAIL" ) |
| 97 | |
| 98 | main.step( "Uninstall ONOS package on all Nodes" ) |
| 99 | uninstallResult = main.TRUE |
| 100 | for i in range( int( main.numCtrls ) ): |
| 101 | main.log.info( "Uninstalling package on ONOS Node IP: " + main.onosIPs[i] ) |
| 102 | u_result = main.ONOSbench.onosUninstall( main.onosIPs[i] ) |
| 103 | utilities.assert_equals( expect=main.TRUE, actual=u_result, |
| 104 | onpass="Test step PASS", |
| 105 | onfail="Test step FAIL" ) |
| 106 | uninstallResult = ( uninstallResult and u_result ) |
| 107 | |
| 108 | main.step( "Install ONOS package on all Nodes" ) |
| 109 | installResult = main.TRUE |
| 110 | for i in range( int( main.numCtrls ) ): |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 111 | main.log.info( "Installing package on ONOS Node IP: " + main.onosIPs[i] ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 112 | i_result = main.ONOSbench.onosInstall( node=main.onosIPs[i] ) |
| 113 | utilities.assert_equals( expect=main.TRUE, actual=i_result, |
| 114 | onpass="Test step PASS", |
| 115 | onfail="Test step FAIL" ) |
| 116 | installResult = ( installResult and i_result ) |
| 117 | |
| 118 | main.step( "Verify ONOS nodes UP status" ) |
| 119 | statusResult = main.TRUE |
| 120 | for i in range( int( main.numCtrls ) ): |
| 121 | main.log.info( "ONOS Node " + main.onosIPs[i] + " status:" ) |
| 122 | onos_status = main.ONOSbench.onosStatus( node=main.onosIPs[i] ) |
| 123 | utilities.assert_equals( expect=main.TRUE, actual=onos_status, |
| 124 | onpass="Test step PASS", |
| 125 | onfail="Test step FAIL" ) |
| 126 | statusResult = ( statusResult and onos_status ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 127 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 128 | main.step( "Start ONOS CLI on all nodes" ) |
| 129 | cliResult = main.TRUE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 130 | main.log.step(" Start ONOS cli using thread ") |
| 131 | startCliResult = main.TRUE |
| 132 | pool = [] |
| 133 | time1 = time.time() |
| 134 | for i in range( int( main.numCtrls) ): |
| 135 | t = main.Thread( target=main.CLIs[i].startOnosCli, |
| 136 | threadID=main.threadID, |
| 137 | name="startOnosCli", |
| 138 | args=[ main.onosIPs[i], karafTimeout ] ) |
| 139 | pool.append(t) |
| 140 | t.start() |
| 141 | main.threadID = main.threadID + 1 |
| 142 | for t in pool: |
| 143 | t.join() |
| 144 | startCliResult = startCliResult and t.result |
| 145 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 146 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 147 | if not startCliResult: |
| 148 | main.log.info("ONOS CLI did not start up properly") |
| 149 | main.cleanup() |
| 150 | main.exit() |
| 151 | else: |
| 152 | main.log.info("Successful CLI startup") |
| 153 | startCliResult = main.TRUE |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 154 | |
| 155 | main.step( "Set IPv6 cfg parameters for Neighbor Discovery" ) |
| 156 | cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.proxyarp.ProxyArp", "ipv6NeighborDiscovery", "true" ) |
| 157 | cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.provider.host.impl.HostLocationProvider", "ipv6NeighborDiscovery", "true" ) |
| 158 | cfgResult = cfgResult1 and cfgResult2 |
| 159 | utilities.assert_equals( expect=main.TRUE, actual=cfgResult, |
| 160 | onpass="ipv6NeighborDiscovery cfg is set to true", |
| 161 | onfail="Failed to cfg set ipv6NeighborDiscovery" ) |
| 162 | |
| 163 | case1Result = installResult and uninstallResult and statusResult and startCliResult and cfgResult |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 164 | main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1)) |
| 165 | utilities.assert_equals( expect=main.TRUE, actual=case1Result, |
| 166 | onpass="Set up test environment PASS", |
| 167 | onfail="Set up test environment FAIL" ) |
| 168 | |
| 169 | def CASE20( self, main ): |
| 170 | """ |
| 171 | This test script Loads a new Topology (Att) on CHO setup and balances all switches |
| 172 | """ |
| 173 | import re |
| 174 | import time |
| 175 | import copy |
| 176 | |
| 177 | main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] ) |
| 178 | main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] ) |
| 179 | main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] ) |
| 180 | main.pingTimeout = 300 |
| 181 | main.log.report( |
| 182 | "Load Att topology and Balance all Mininet switches across controllers" ) |
| 183 | main.log.report( |
| 184 | "________________________________________________________________________" ) |
| 185 | main.case( |
| 186 | "Assign and Balance all Mininet switches across controllers" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 187 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 188 | main.step( "Stop any previous Mininet network topology" ) |
| 189 | cliResult = main.TRUE |
| 190 | if main.newTopo == main.params['TOPO3']['topo']: |
| 191 | stopStatus = main.Mininet1.stopNet( fileName = "topoSpine" ) |
| 192 | |
| 193 | main.step( "Start Mininet with Att topology" ) |
| 194 | main.newTopo = main.params['TOPO1']['topo'] |
GlennRC | c6cd2a6 | 2015-08-10 16:08:22 -0700 | [diff] [blame] | 195 | mininetDir = main.Mininet1.home + "/custom/" |
| 196 | topoPath = main.testDir + "/" + main.TEST + "/Dependencies/" + main.newTopo |
| 197 | main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to") |
| 198 | topoPath = mininetDir + main.newTopo |
| 199 | startStatus = main.Mininet1.startNet(topoFile = topoPath) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 200 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 201 | main.step( "Assign switches to controllers" ) |
| 202 | for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 ) |
| 203 | main.Mininet1.assignSwController( |
| 204 | sw="s" + str( i ), |
Hari Krishna | 1006577 | 2015-07-10 15:55:53 -0700 | [diff] [blame] | 205 | ip=main.onosIPs ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 206 | |
| 207 | switch_mastership = main.TRUE |
| 208 | for i in range( 1, ( main.numMNswitches + 1 ) ): |
| 209 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
| 210 | print( "Response is " + str( response ) ) |
| 211 | if re.search( "tcp:" + main.onosIPs[0], response ): |
| 212 | switch_mastership = switch_mastership and main.TRUE |
| 213 | else: |
| 214 | switch_mastership = main.FALSE |
| 215 | |
| 216 | if switch_mastership == main.TRUE: |
| 217 | main.log.report( "Controller assignment successfull" ) |
| 218 | else: |
| 219 | main.log.report( "Controller assignment failed" ) |
| 220 | |
| 221 | time.sleep(30) # waiting here to make sure topology converges across all nodes |
| 222 | |
| 223 | main.step( "Balance devices across controllers" ) |
| 224 | balanceResult = main.ONOScli1.balanceMasters() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 225 | # giving some breathing time for ONOS to complete re-balance |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 226 | time.sleep( 5 ) |
| 227 | |
| 228 | topology_output = main.ONOScli1.topology() |
| 229 | topology_result = main.ONOSbench.getTopology( topology_output ) |
| 230 | case2Result = ( switch_mastership and startStatus ) |
| 231 | utilities.assert_equals( |
| 232 | expect=main.TRUE, |
| 233 | actual=case2Result, |
| 234 | onpass="Starting new Att topology test PASS", |
| 235 | onfail="Starting new Att topology test FAIL" ) |
| 236 | |
| 237 | def CASE21( self, main ): |
| 238 | """ |
| 239 | This test script Loads a new Topology (Chordal) on CHO setup and balances all switches |
| 240 | """ |
| 241 | import re |
| 242 | import time |
| 243 | import copy |
| 244 | |
| 245 | main.newTopo = main.params['TOPO2']['topo'] |
| 246 | main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] ) |
| 247 | main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] ) |
| 248 | main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] ) |
| 249 | main.pingTimeout = 300 |
| 250 | main.log.report( |
| 251 | "Load Chordal topology and Balance all Mininet switches across controllers" ) |
| 252 | main.log.report( |
| 253 | "________________________________________________________________________" ) |
| 254 | main.case( |
| 255 | "Assign and Balance all Mininet switches across controllers" ) |
| 256 | |
| 257 | main.step( "Stop any previous Mininet network topology" ) |
| 258 | stopStatus = main.Mininet1.stopNet(fileName = "topoAtt" ) |
| 259 | |
GlennRC | c6cd2a6 | 2015-08-10 16:08:22 -0700 | [diff] [blame] | 260 | main.step("Start Mininet with Chordal topology") |
| 261 | mininetDir = main.Mininet1.home + "/custom/" |
| 262 | topoPath = main.testDir + "/" + main.TEST + "/Dependencies/" + main.newTopo |
| 263 | main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to") |
| 264 | topoPath = mininetDir + main.newTopo |
| 265 | startStatus = main.Mininet1.startNet(topoFile = topoPath) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 266 | |
| 267 | main.step( "Assign switches to controllers" ) |
| 268 | |
| 269 | for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 ) |
| 270 | main.Mininet1.assignSwController( |
| 271 | sw="s" + str( i ), |
Hari Krishna | 1006577 | 2015-07-10 15:55:53 -0700 | [diff] [blame] | 272 | ip=main.onosIPs ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 273 | |
| 274 | switch_mastership = main.TRUE |
| 275 | for i in range( 1, ( main.numMNswitches + 1 ) ): |
| 276 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
| 277 | print( "Response is " + str( response ) ) |
| 278 | if re.search( "tcp:" + main.onosIPs[0], response ): |
| 279 | switch_mastership = switch_mastership and main.TRUE |
| 280 | else: |
| 281 | switch_mastership = main.FALSE |
| 282 | |
| 283 | if switch_mastership == main.TRUE: |
| 284 | main.log.report( "Controller assignment successfull" ) |
| 285 | else: |
| 286 | main.log.report( "Controller assignment failed" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 287 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 288 | main.step( "Balance devices across controllers" ) |
| 289 | balanceResult = main.ONOScli1.balanceMasters() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 290 | # giving some breathing time for ONOS to complete re-balance |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 291 | time.sleep( 5 ) |
| 292 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 293 | caseResult = switch_mastership |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 294 | time.sleep(30) |
| 295 | utilities.assert_equals( |
| 296 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 297 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 298 | onpass="Starting new Chordal topology test PASS", |
| 299 | onfail="Starting new Chordal topology test FAIL" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 300 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 301 | def CASE22( self, main ): |
| 302 | """ |
| 303 | This test script Loads a new Topology (Spine) on CHO setup and balances all switches |
| 304 | """ |
| 305 | import re |
| 306 | import time |
| 307 | import copy |
| 308 | |
| 309 | main.newTopo = main.params['TOPO3']['topo'] |
| 310 | main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] ) |
| 311 | main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] ) |
| 312 | main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] ) |
| 313 | main.pingTimeout = 600 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 314 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 315 | main.log.report( |
| 316 | "Load Spine and Leaf topology and Balance all Mininet switches across controllers" ) |
| 317 | main.log.report( |
| 318 | "________________________________________________________________________" ) |
| 319 | main.case( |
| 320 | "Assign and Balance all Mininet switches across controllers" ) |
| 321 | main.step( "Stop any previous Mininet network topology" ) |
| 322 | stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" ) |
GlennRC | c6cd2a6 | 2015-08-10 16:08:22 -0700 | [diff] [blame] | 323 | |
| 324 | main.step("Start Mininet with Spine topology") |
| 325 | mininetDir = main.Mininet1.home + "/custom/" |
| 326 | topoPath = main.testDir + "/" + main.TEST + "/Dependencies/" + main.newTopo |
| 327 | main.ONOSbench.secureCopy(main.Mininet1.user_name, main.Mininet1.ip_address, topoPath, mininetDir, direction="to") |
| 328 | topoPath = mininetDir + main.newTopo |
| 329 | startStatus = main.Mininet1.startNet(topoFile = topoPath) |
| 330 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 331 | time.sleep(60) |
| 332 | main.step( "Assign switches to controllers" ) |
| 333 | |
| 334 | for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 ) |
| 335 | main.Mininet1.assignSwController( |
| 336 | sw="s" + str( i ), |
Hari Krishna | 1006577 | 2015-07-10 15:55:53 -0700 | [diff] [blame] | 337 | ip=main.onosIPs ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 338 | |
| 339 | switch_mastership = main.TRUE |
| 340 | for i in range( 1, ( main.numMNswitches + 1 ) ): |
| 341 | response = main.Mininet1.getSwController( "s" + str( i ) ) |
| 342 | print( "Response is " + str( response ) ) |
| 343 | if re.search( "tcp:" + main.onosIPs[0], response ): |
| 344 | switch_mastership = switch_mastership and main.TRUE |
| 345 | else: |
| 346 | switch_mastership = main.FALSE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 347 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 348 | if switch_mastership == main.TRUE: |
| 349 | main.log.report( "Controller assignment successfull" ) |
| 350 | else: |
| 351 | main.log.report( "Controller assignment failed" ) |
| 352 | time.sleep( 5 ) |
| 353 | |
| 354 | main.step( "Balance devices across controllers" ) |
| 355 | for i in range( int( main.numCtrls ) ): |
| 356 | balanceResult = main.ONOScli1.balanceMasters() |
| 357 | # giving some breathing time for ONOS to complete re-balance |
| 358 | time.sleep( 3 ) |
| 359 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 360 | caseResult = switch_mastership |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 361 | time.sleep(60) |
| 362 | utilities.assert_equals( |
| 363 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 364 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 365 | onpass="Starting new Spine topology test PASS", |
| 366 | onfail="Starting new Spine topology test FAIL" ) |
| 367 | |
| 368 | def CASE3( self, main ): |
| 369 | """ |
| 370 | This Test case will be extended to collect and store more data related |
| 371 | ONOS state. |
| 372 | """ |
| 373 | import re |
| 374 | import copy |
| 375 | main.deviceDPIDs = [] |
| 376 | main.hostMACs = [] |
| 377 | main.deviceLinks = [] |
| 378 | main.deviceActiveLinksCount = [] |
| 379 | main.devicePortsEnabledCount = [] |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 380 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 381 | main.log.report( |
| 382 | "Collect and Store topology details from ONOS before running any Tests" ) |
| 383 | main.log.report( |
| 384 | "____________________________________________________________________" ) |
| 385 | main.case( "Collect and Store Topology Details from ONOS" ) |
| 386 | main.step( "Collect and store current number of switches and links" ) |
| 387 | topology_output = main.ONOScli1.topology() |
| 388 | topology_result = main.ONOSbench.getTopology( topology_output ) |
| 389 | numOnosDevices = topology_result[ 'devices' ] |
| 390 | numOnosLinks = topology_result[ 'links' ] |
| 391 | topoResult = main.TRUE |
| 392 | |
| 393 | if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks == int(numOnosLinks) ) ): |
| 394 | main.step( "Store Device DPIDs" ) |
| 395 | for i in range( 1, (main.numMNswitches+1) ): |
| 396 | main.deviceDPIDs.append( "of:00000000000000" + format( i, '02x' ) ) |
| 397 | print "Device DPIDs in Store: \n", str( main.deviceDPIDs ) |
| 398 | |
| 399 | main.step( "Store Host MACs" ) |
| 400 | for i in range( 1, ( main.numMNhosts + 1 ) ): |
| 401 | main.hostMACs.append( "00:00:00:00:00:" + format( i, '02x' ) + "/-1" ) |
| 402 | print "Host MACs in Store: \n", str( main.hostMACs ) |
| 403 | main.MACsDict = {} |
| 404 | print "Creating dictionary of DPID and HostMacs" |
| 405 | for i in range(len(main.hostMACs)): |
| 406 | main.MACsDict[main.deviceDPIDs[i]] = main.hostMACs[i].split('/')[0] |
| 407 | print main.MACsDict |
| 408 | main.step( "Collect and store all Devices Links" ) |
| 409 | linksResult = main.ONOScli1.links( jsonFormat=False ) |
| 410 | ansi_escape = re.compile( r'\x1b[^m]*m' ) |
| 411 | linksResult = ansi_escape.sub( '', linksResult ) |
| 412 | linksResult = linksResult.replace( " links", "" ).replace( "\r\r", "" ) |
| 413 | linksResult = linksResult.splitlines() |
| 414 | main.deviceLinks = copy.copy( linksResult ) |
| 415 | print "Device Links Stored: \n", str( main.deviceLinks ) |
| 416 | # this will be asserted to check with the params provided count of |
| 417 | # links |
| 418 | print "Length of Links Store", len( main.deviceLinks ) |
| 419 | |
| 420 | main.step( "Collect and store each Device ports enabled Count" ) |
| 421 | time1 = time.time() |
| 422 | for i in xrange(1,(main.numMNswitches + 1), int( main.numCtrls ) ): |
| 423 | pool = [] |
| 424 | for cli in main.CLIs: |
| 425 | if i >= main.numMNswitches + 1: |
| 426 | break |
| 427 | dpid = "of:00000000000000" + format( i,'02x' ) |
| 428 | t = main.Thread(target = cli.getDevicePortsEnabledCount,threadID = main.threadID, name = "getDevicePortsEnabledCount",args = [dpid]) |
| 429 | t.start() |
| 430 | pool.append(t) |
| 431 | i = i + 1 |
| 432 | main.threadID = main.threadID + 1 |
| 433 | for thread in pool: |
| 434 | thread.join() |
| 435 | portResult = thread.result |
| 436 | main.devicePortsEnabledCount.append( portResult ) |
| 437 | print "Device Enabled Port Counts Stored: \n", str( main.devicePortsEnabledCount ) |
| 438 | time2 = time.time() |
| 439 | main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1)) |
| 440 | |
| 441 | main.step( "Collect and store each Device active links Count" ) |
| 442 | time1 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 443 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 444 | for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ): |
| 445 | pool = [] |
| 446 | for cli in main.CLIs: |
| 447 | if i >= main.numMNswitches + 1: |
| 448 | break |
| 449 | dpid = "of:00000000000000" + format( i,'02x' ) |
| 450 | t = main.Thread( target = cli.getDeviceLinksActiveCount, |
| 451 | threadID = main.threadID, |
| 452 | name = "getDevicePortsEnabledCount", |
| 453 | args = [dpid]) |
| 454 | t.start() |
| 455 | pool.append(t) |
| 456 | i = i + 1 |
| 457 | main.threadID = main.threadID + 1 |
| 458 | for thread in pool: |
| 459 | thread.join() |
| 460 | linkCountResult = thread.result |
| 461 | main.deviceActiveLinksCount.append( linkCountResult ) |
| 462 | print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount ) |
| 463 | time2 = time.time() |
| 464 | main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1)) |
| 465 | |
| 466 | else: |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 467 | main.log.info("Devices (expected): %s, Links (expected): %s" % |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 468 | ( str( main.numMNswitches ), str( main.numMNlinks ) ) ) |
| 469 | main.log.info("Devices (actual): %s, Links (actual): %s" % |
| 470 | ( numOnosDevices , numOnosLinks ) ) |
| 471 | main.log.info("Topology does not match, exiting CHO test...") |
| 472 | topoResult = main.FALSE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 473 | # It's better exit here from running the test |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 474 | main.cleanup() |
| 475 | main.exit() |
| 476 | |
| 477 | # just returning TRUE for now as this one just collects data |
| 478 | case3Result = topoResult |
| 479 | utilities.assert_equals( expect=main.TRUE, actual=case3Result, |
| 480 | onpass="Saving ONOS topology data test PASS", |
| 481 | onfail="Saving ONOS topology data test FAIL" ) |
| 482 | |
| 483 | def CASE40( self, main ): |
| 484 | """ |
| 485 | Verify Reactive forwarding (Att Topology) |
| 486 | """ |
| 487 | import re |
| 488 | import copy |
| 489 | import time |
| 490 | main.log.report( "Verify Reactive forwarding (Att Topology)" ) |
| 491 | main.log.report( "______________________________________________" ) |
| 492 | main.case( "Enable Reactive forwarding and Verify ping all" ) |
| 493 | main.step( "Enable Reactive forwarding" ) |
| 494 | installResult = main.TRUE |
| 495 | # Activate fwd app |
| 496 | appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" ) |
| 497 | appCheck = main.TRUE |
| 498 | pool = [] |
| 499 | for cli in main.CLIs: |
| 500 | t = main.Thread( target=cli.appToIDCheck, |
| 501 | name="appToIDCheck-" + str( i ), |
| 502 | args=[] ) |
| 503 | pool.append( t ) |
| 504 | t.start() |
| 505 | for t in pool: |
| 506 | t.join() |
| 507 | appCheck = appCheck and t.result |
| 508 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 509 | onpass="App Ids seem to be correct", |
| 510 | onfail="Something is wrong with app Ids" ) |
| 511 | if appCheck != main.TRUE: |
| 512 | main.log.warn( main.CLIs[0].apps() ) |
| 513 | main.log.warn( main.CLIs[0].appIDs() ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 514 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 515 | time.sleep( 10 ) |
| 516 | |
| 517 | main.step( "Verify Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 518 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 519 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 520 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 521 | if not pingResult: |
GlennRC | f07c44a | 2015-09-18 13:33:46 -0700 | [diff] [blame] | 522 | main.log.warn("First pingall failed. Trying again...") |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 523 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 524 | time2 = time.time() |
| 525 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 526 | main.log.report( |
| 527 | "Time taken for Ping All: " + |
| 528 | str( timeDiff ) + |
| 529 | " seconds" ) |
| 530 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 531 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 532 | main.log.report( "IPv4 Pingall Test in Reactive mode successful" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 533 | else: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 534 | main.log.report( "IPv4 Pingall Test in Reactive mode failed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 535 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 536 | caseResult = appCheck and pingResult |
| 537 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 538 | onpass="Reactive Mode IPv4 Pingall test PASS", |
| 539 | onfail="Reactive Mode IPv4 Pingall test FAIL" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 540 | |
| 541 | def CASE41( self, main ): |
| 542 | """ |
| 543 | Verify Reactive forwarding (Chordal Topology) |
| 544 | """ |
| 545 | import re |
| 546 | import copy |
| 547 | import time |
| 548 | main.log.report( "Verify Reactive forwarding (Chordal Topology)" ) |
| 549 | main.log.report( "______________________________________________" ) |
| 550 | main.case( "Enable Reactive forwarding and Verify ping all" ) |
| 551 | main.step( "Enable Reactive forwarding" ) |
| 552 | installResult = main.TRUE |
| 553 | # Activate fwd app |
| 554 | appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" ) |
| 555 | |
| 556 | appCheck = main.TRUE |
| 557 | pool = [] |
| 558 | for cli in main.CLIs: |
| 559 | t = main.Thread( target=cli.appToIDCheck, |
| 560 | name="appToIDCheck-" + str( i ), |
| 561 | args=[] ) |
| 562 | pool.append( t ) |
| 563 | t.start() |
| 564 | for t in pool: |
| 565 | t.join() |
| 566 | appCheck = appCheck and t.result |
| 567 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 568 | onpass="App Ids seem to be correct", |
| 569 | onfail="Something is wrong with app Ids" ) |
| 570 | if appCheck != main.TRUE: |
| 571 | main.log.warn( main.CLIs[0].apps() ) |
| 572 | main.log.warn( main.CLIs[0].appIDs() ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 573 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 574 | time.sleep( 10 ) |
| 575 | |
| 576 | main.step( "Verify Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 577 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 578 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 579 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 580 | if not pingResult: |
GlennRC | f07c44a | 2015-09-18 13:33:46 -0700 | [diff] [blame] | 581 | main.log.warn("First pingall failed. Trying again...") |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 582 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 583 | time2 = time.time() |
| 584 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 585 | main.log.report( |
| 586 | "Time taken for Ping All: " + |
| 587 | str( timeDiff ) + |
| 588 | " seconds" ) |
| 589 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 590 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 591 | main.log.report( "IPv4 Pingall Test in Reactive mode successful" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 592 | else: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 593 | main.log.report( "IPv4 Pingall Test in Reactive mode failed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 594 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 595 | caseResult = appCheck and pingResult |
| 596 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 597 | onpass="Reactive Mode IPv4 Pingall test PASS", |
| 598 | onfail="Reactive Mode IPv4 Pingall test FAIL" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 599 | |
| 600 | def CASE42( self, main ): |
| 601 | """ |
| 602 | Verify Reactive forwarding (Spine Topology) |
| 603 | """ |
| 604 | import re |
| 605 | import copy |
| 606 | import time |
| 607 | main.log.report( "Verify Reactive forwarding (Spine Topology)" ) |
| 608 | main.log.report( "______________________________________________" ) |
| 609 | main.case( "Enable Reactive forwarding and Verify ping all" ) |
| 610 | main.step( "Enable Reactive forwarding" ) |
| 611 | installResult = main.TRUE |
| 612 | # Activate fwd app |
| 613 | appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" ) |
| 614 | |
| 615 | appCheck = main.TRUE |
| 616 | pool = [] |
| 617 | for cli in main.CLIs: |
| 618 | t = main.Thread( target=cli.appToIDCheck, |
| 619 | name="appToIDCheck-" + str( i ), |
| 620 | args=[] ) |
| 621 | pool.append( t ) |
| 622 | t.start() |
| 623 | for t in pool: |
| 624 | t.join() |
| 625 | appCheck = appCheck and t.result |
| 626 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 627 | onpass="App Ids seem to be correct", |
| 628 | onfail="Something is wrong with app Ids" ) |
| 629 | if appCheck != main.TRUE: |
| 630 | main.log.warn( main.CLIs[0].apps() ) |
| 631 | main.log.warn( main.CLIs[0].appIDs() ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 632 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 633 | time.sleep( 10 ) |
| 634 | |
| 635 | main.step( "Verify Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 636 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 637 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 638 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 639 | if not pingResult: |
GlennRC | f07c44a | 2015-09-18 13:33:46 -0700 | [diff] [blame] | 640 | main.log.warn("First pingall failed. Trying again...") |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 641 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 642 | time2 = time.time() |
| 643 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 644 | main.log.report( |
| 645 | "Time taken for Ping All: " + |
| 646 | str( timeDiff ) + |
| 647 | " seconds" ) |
| 648 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 649 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 650 | main.log.report( "IPv4 Pingall Test in Reactive mode successful" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 651 | else: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 652 | main.log.report( "IPv4 Pingall Test in Reactive mode failed" ) |
| 653 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 654 | caseResult = appCheck and pingResult |
| 655 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 656 | onpass="Reactive Mode IPv4 Pingall test PASS", |
| 657 | onfail="Reactive Mode IPv4 Pingall test FAIL" ) |
| 658 | |
| 659 | def CASE140( self, main ): |
| 660 | """ |
| 661 | Verify IPv6 Reactive forwarding (Att Topology) |
| 662 | """ |
| 663 | import re |
| 664 | import copy |
| 665 | import time |
| 666 | main.log.report( "Verify IPv6 Reactive forwarding (Att Topology)" ) |
| 667 | main.log.report( "______________________________________________" ) |
| 668 | main.case( "Enable IPv6 Reactive forwarding and Verify ping all" ) |
| 669 | hostList = [ ('h'+ str(x + 1)) for x in range (main.numMNhosts) ] |
| 670 | |
| 671 | main.step( "Set IPv6 cfg parameters for Reactive forwarding" ) |
| 672 | cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" ) |
| 673 | cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" ) |
| 674 | cfgResult = cfgResult1 and cfgResult2 |
| 675 | utilities.assert_equals( expect=main.TRUE, actual=cfgResult, |
| 676 | onpass="Reactive mode ipv6Fowarding cfg is set to true", |
| 677 | onfail="Failed to cfg set Reactive mode ipv6Fowarding" ) |
| 678 | |
| 679 | main.step( "Verify IPv6 Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 680 | pingResult = main.FALSE |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 681 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 682 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout) |
| 683 | if not pingResult: |
GlennRC | f07c44a | 2015-09-18 13:33:46 -0700 | [diff] [blame] | 684 | main.log.warn("First pingall failed. Trying again..") |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 685 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 686 | time2 = time.time() |
| 687 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 688 | main.log.report( |
| 689 | "Time taken for IPv6 Ping All: " + |
| 690 | str( timeDiff ) + |
| 691 | " seconds" ) |
| 692 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 693 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 694 | main.log.report( "IPv6 Pingall Test in Reactive mode successful" ) |
| 695 | else: |
| 696 | main.log.report( "IPv6 Pingall Test in Reactive mode failed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 697 | |
| 698 | main.step( "Disable Reactive forwarding" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 699 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 700 | main.log.info( "Uninstall reactive forwarding app" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 701 | appCheck = main.TRUE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 702 | appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" ) |
| 703 | pool = [] |
| 704 | for cli in main.CLIs: |
| 705 | t = main.Thread( target=cli.appToIDCheck, |
| 706 | name="appToIDCheck-" + str( i ), |
| 707 | args=[] ) |
| 708 | pool.append( t ) |
| 709 | t.start() |
| 710 | |
| 711 | for t in pool: |
| 712 | t.join() |
| 713 | appCheck = appCheck and t.result |
| 714 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 715 | onpass="App Ids seem to be correct", |
| 716 | onfail="Something is wrong with app Ids" ) |
| 717 | if appCheck != main.TRUE: |
| 718 | main.log.warn( main.CLIs[0].apps() ) |
| 719 | main.log.warn( main.CLIs[0].appIDs() ) |
| 720 | |
| 721 | # Waiting for reative flows to be cleared. |
| 722 | time.sleep( 30 ) |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 723 | caseResult = appCheck and cfgResult and pingResult |
| 724 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 725 | onpass="Reactive Mode IPv6 Pingall test PASS", |
| 726 | onfail="Reactive Mode IPv6 Pingall test FAIL" ) |
| 727 | |
| 728 | def CASE141( self, main ): |
| 729 | """ |
| 730 | Verify IPv6 Reactive forwarding (Chordal Topology) |
| 731 | """ |
| 732 | import re |
| 733 | import copy |
| 734 | import time |
| 735 | main.log.report( "Verify IPv6 Reactive forwarding (Chordal Topology)" ) |
| 736 | main.log.report( "______________________________________________" ) |
| 737 | main.case( "Enable IPv6 Reactive forwarding and Verify ping all" ) |
| 738 | hostList = [ ('h'+ str(x + 1)) for x in range (main.numMNhosts) ] |
| 739 | |
| 740 | main.step( "Set IPv6 cfg parameters for Reactive forwarding" ) |
| 741 | cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" ) |
| 742 | cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" ) |
| 743 | cfgResult = cfgResult1 and cfgResult2 |
| 744 | utilities.assert_equals( expect=main.TRUE, actual=cfgResult, |
| 745 | onpass="Reactive mode ipv6Fowarding cfg is set to true", |
| 746 | onfail="Failed to cfg set Reactive mode ipv6Fowarding" ) |
| 747 | |
| 748 | main.step( "Verify IPv6 Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 749 | pingResult = main.FALSE |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 750 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 751 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout) |
| 752 | if not pingResult: |
GlennRC | f07c44a | 2015-09-18 13:33:46 -0700 | [diff] [blame] | 753 | main.log.warn("First pingall failed. Trying again..") |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 754 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 755 | time2 = time.time() |
| 756 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 757 | main.log.report( |
| 758 | "Time taken for IPv6 Ping All: " + |
| 759 | str( timeDiff ) + |
| 760 | " seconds" ) |
| 761 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 762 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 763 | main.log.report( "IPv6 Pingall Test in Reactive mode successful" ) |
| 764 | else: |
| 765 | main.log.report( "IPv6 Pingall Test in Reactive mode failed" ) |
| 766 | |
| 767 | main.step( "Disable Reactive forwarding" ) |
| 768 | |
| 769 | main.log.info( "Uninstall reactive forwarding app" ) |
| 770 | appCheck = main.TRUE |
| 771 | appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" ) |
| 772 | pool = [] |
| 773 | for cli in main.CLIs: |
| 774 | t = main.Thread( target=cli.appToIDCheck, |
| 775 | name="appToIDCheck-" + str( i ), |
| 776 | args=[] ) |
| 777 | pool.append( t ) |
| 778 | t.start() |
| 779 | |
| 780 | for t in pool: |
| 781 | t.join() |
| 782 | appCheck = appCheck and t.result |
| 783 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 784 | onpass="App Ids seem to be correct", |
| 785 | onfail="Something is wrong with app Ids" ) |
| 786 | if appCheck != main.TRUE: |
| 787 | main.log.warn( main.CLIs[0].apps() ) |
| 788 | main.log.warn( main.CLIs[0].appIDs() ) |
| 789 | |
| 790 | # Waiting for reative flows to be cleared. |
| 791 | time.sleep( 30 ) |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 792 | caseResult = appCheck and cfgResult and pingResult |
| 793 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 794 | onpass="Reactive Mode IPv6 Pingall test PASS", |
| 795 | onfail="Reactive Mode IPv6 Pingall test FAIL" ) |
| 796 | |
| 797 | def CASE142( self, main ): |
| 798 | """ |
| 799 | Verify IPv6 Reactive forwarding (Spine Topology) |
| 800 | """ |
| 801 | import re |
| 802 | import copy |
| 803 | import time |
| 804 | main.log.report( "Verify IPv6 Reactive forwarding (Spine Topology)" ) |
| 805 | main.log.report( "______________________________________________" ) |
| 806 | main.case( "Enable IPv6 Reactive forwarding and Verify ping all" ) |
| 807 | # Spine topology do not have hosts h1-h10 |
| 808 | hostList = [ ('h'+ str(x + 11)) for x in range (main.numMNhosts) ] |
| 809 | main.step( "Set IPv6 cfg parameters for Reactive forwarding" ) |
| 810 | cfgResult1 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "ipv6Forwarding", "true" ) |
| 811 | cfgResult2 = main.CLIs[0].setCfg( "org.onosproject.fwd.ReactiveForwarding", "matchIpv6Address", "true" ) |
| 812 | cfgResult = cfgResult1 and cfgResult2 |
| 813 | utilities.assert_equals( expect=main.TRUE, actual=cfgResult, |
| 814 | onpass="Reactive mode ipv6Fowarding cfg is set to true", |
| 815 | onfail="Failed to cfg set Reactive mode ipv6Fowarding" ) |
| 816 | |
| 817 | main.step( "Verify IPv6 Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 818 | pingResult = main.FALSE |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 819 | time1 = time.time() |
GlennRC | 558cd86 | 2015-10-08 09:54:04 -0700 | [diff] [blame] | 820 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout) |
| 821 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 822 | main.log.warn("First pingall failed. Trying again...") |
GlennRC | 558cd86 | 2015-10-08 09:54:04 -0700 | [diff] [blame] | 823 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 824 | time2 = time.time() |
| 825 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 826 | main.log.report( |
| 827 | "Time taken for IPv6 Ping All: " + |
| 828 | str( timeDiff ) + |
| 829 | " seconds" ) |
| 830 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 831 | if pingResult == main.TRUE: |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 832 | main.log.report( "IPv6 Pingall Test in Reactive mode successful" ) |
| 833 | else: |
| 834 | main.log.report( "IPv6 Pingall Test in Reactive mode failed" ) |
| 835 | |
| 836 | main.step( "Disable Reactive forwarding" ) |
| 837 | |
| 838 | main.log.info( "Uninstall reactive forwarding app" ) |
| 839 | appCheck = main.TRUE |
| 840 | appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" ) |
| 841 | pool = [] |
| 842 | for cli in main.CLIs: |
| 843 | t = main.Thread( target=cli.appToIDCheck, |
| 844 | name="appToIDCheck-" + str( i ), |
| 845 | args=[] ) |
| 846 | pool.append( t ) |
| 847 | t.start() |
| 848 | |
| 849 | for t in pool: |
| 850 | t.join() |
| 851 | appCheck = appCheck and t.result |
| 852 | utilities.assert_equals( expect=main.TRUE, actual=appCheck, |
| 853 | onpass="App Ids seem to be correct", |
| 854 | onfail="Something is wrong with app Ids" ) |
| 855 | if appCheck != main.TRUE: |
| 856 | main.log.warn( main.CLIs[0].apps() ) |
| 857 | main.log.warn( main.CLIs[0].appIDs() ) |
| 858 | |
| 859 | # Waiting for reative flows to be cleared. |
| 860 | time.sleep( 30 ) |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 861 | caseResult = appCheck and cfgResult and pingResult |
| 862 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 863 | onpass="Reactive Mode IPv6 Pingall test PASS", |
| 864 | onfail="Reactive Mode IPv6 Pingall test FAIL" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 865 | |
| 866 | def CASE5( self, main ): |
| 867 | """ |
| 868 | Compare current ONOS topology with reference data |
| 869 | """ |
| 870 | import re |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 871 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 872 | devicesDPIDTemp = [] |
| 873 | hostMACsTemp = [] |
| 874 | deviceLinksTemp = [] |
| 875 | deviceActiveLinksCountTemp = [] |
| 876 | devicePortsEnabledCountTemp = [] |
| 877 | |
| 878 | main.log.report( |
| 879 | "Compare ONOS topology with reference data in Stores" ) |
| 880 | main.log.report( "__________________________________________________" ) |
| 881 | main.case( "Compare ONOS topology with reference data" ) |
| 882 | |
| 883 | main.step( "Compare current Device ports enabled with reference" ) |
| 884 | time1 = time.time() |
| 885 | for i in xrange( 1,(main.numMNswitches + 1), int( main.numCtrls ) ): |
| 886 | pool = [] |
| 887 | for cli in main.CLIs: |
| 888 | if i >= main.numMNswitches + 1: |
| 889 | break |
| 890 | dpid = "of:00000000000000" + format( i,'02x' ) |
| 891 | t = main.Thread(target = cli.getDevicePortsEnabledCount, |
| 892 | threadID = main.threadID, |
| 893 | name = "getDevicePortsEnabledCount", |
| 894 | args = [dpid]) |
| 895 | t.start() |
| 896 | pool.append(t) |
| 897 | i = i + 1 |
| 898 | main.threadID = main.threadID + 1 |
| 899 | for thread in pool: |
| 900 | thread.join() |
| 901 | portResult = thread.result |
| 902 | #portTemp = re.split( r'\t+', portResult ) |
| 903 | #portCount = portTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" ) |
| 904 | devicePortsEnabledCountTemp.append( portResult ) |
| 905 | |
| 906 | time2 = time.time() |
| 907 | main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1)) |
| 908 | main.log.info ( |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 909 | "Device Enabled ports EXPECTED: %s" % |
| 910 | str( main.devicePortsEnabledCount ) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 911 | main.log.info ( |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 912 | "Device Enabled ports ACTUAL: %s" % |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 913 | str( devicePortsEnabledCountTemp ) ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 914 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 915 | if ( cmp( main.devicePortsEnabledCount, |
| 916 | devicePortsEnabledCountTemp ) == 0 ): |
| 917 | stepResult1 = main.TRUE |
| 918 | else: |
| 919 | stepResult1 = main.FALSE |
| 920 | |
| 921 | main.step( "Compare Device active links with reference" ) |
| 922 | time1 = time.time() |
| 923 | for i in xrange( 1, ( main.numMNswitches + 1) , int( main.numCtrls ) ): |
| 924 | pool = [] |
| 925 | for cli in main.CLIs: |
| 926 | if i >= main.numMNswitches + 1: |
| 927 | break |
| 928 | dpid = "of:00000000000000" + format( i,'02x' ) |
| 929 | t = main.Thread(target = cli.getDeviceLinksActiveCount, |
| 930 | threadID = main.threadID, |
| 931 | name = "getDeviceLinksActiveCount", |
| 932 | args = [dpid]) |
| 933 | t.start() |
| 934 | pool.append(t) |
| 935 | i = i + 1 |
| 936 | main.threadID = main.threadID + 1 |
| 937 | for thread in pool: |
| 938 | thread.join() |
| 939 | linkCountResult = thread.result |
| 940 | #linkCountTemp = re.split( r'\t+', linkCountResult ) |
| 941 | #linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" ) |
| 942 | deviceActiveLinksCountTemp.append( linkCountResult ) |
| 943 | |
| 944 | time2 = time.time() |
| 945 | main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1)) |
| 946 | main.log.info ( |
| 947 | "Device Active links EXPECTED: %s" % |
| 948 | str( main.deviceActiveLinksCount ) ) |
| 949 | main.log.info ( |
| 950 | "Device Active links ACTUAL: %s" % str( deviceActiveLinksCountTemp ) ) |
| 951 | if ( cmp( main.deviceActiveLinksCount, deviceActiveLinksCountTemp ) == 0 ): |
| 952 | stepResult2 = main.TRUE |
| 953 | else: |
| 954 | stepResult2 = main.FALSE |
| 955 | |
| 956 | """ |
| 957 | place holder for comparing devices, hosts, paths and intents if required. |
| 958 | Links and ports data would be incorrect with out devices anyways. |
| 959 | """ |
| 960 | case5Result = ( stepResult1 and stepResult2 ) |
| 961 | utilities.assert_equals( expect=main.TRUE, actual=case5Result, |
| 962 | onpass="Compare Topology test PASS", |
| 963 | onfail="Compare Topology test FAIL" ) |
| 964 | |
| 965 | def CASE60( self ): |
| 966 | """ |
| 967 | Install 300 host intents and verify ping all (Att Topology) |
| 968 | """ |
| 969 | main.log.report( "Add 300 host intents and verify pingall (Att Topology)" ) |
| 970 | main.log.report( "_______________________________________" ) |
| 971 | import itertools |
| 972 | import time |
| 973 | main.case( "Install 300 host intents" ) |
| 974 | main.step( "Add host Intents" ) |
| 975 | intentResult = main.TRUE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 976 | hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) |
| 977 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 978 | intentIdList = [] |
| 979 | time1 = time.time() |
| 980 | for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ): |
| 981 | pool = [] |
| 982 | for cli in main.CLIs: |
| 983 | if i >= len( hostCombos ): |
| 984 | break |
| 985 | t = main.Thread( target=cli.addHostIntent, |
| 986 | threadID=main.threadID, |
| 987 | name="addHostIntent", |
| 988 | args=[hostCombos[i][0],hostCombos[i][1]]) |
| 989 | pool.append(t) |
| 990 | t.start() |
| 991 | i = i + 1 |
| 992 | main.threadID = main.threadID + 1 |
| 993 | for thread in pool: |
| 994 | thread.join() |
| 995 | intentIdList.append(thread.result) |
| 996 | time2 = time.time() |
| 997 | main.log.info("Time for adding host intents: %2f seconds" %(time2-time1)) |
| 998 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 999 | # Saving intent ids to check intents in later cases |
| 1000 | main.intentIds = list(intentIdList) |
| 1001 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1002 | main.step("Verify intents are installed") |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1003 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1004 | # Giving onos multiple chances to install intents |
| 1005 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1006 | if i != 0: |
| 1007 | main.log.warn( "Verification failed. Retrying..." ) |
| 1008 | main.log.info("Waiting for onos to install intents...") |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1009 | time.sleep( main.checkIntentsDelay ) |
| 1010 | |
| 1011 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1012 | for e in range(int(main.numCtrls)): |
| 1013 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1014 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 1015 | intentState |
| 1016 | if not intentState: |
| 1017 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1018 | if intentState: |
| 1019 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1020 | else: |
| 1021 | #Dumping intent summary |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1022 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1023 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1024 | |
| 1025 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1026 | onpass="INTENTS INSTALLED", |
| 1027 | onfail="SOME INTENTS NOT INSTALLED" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1028 | |
| 1029 | main.step( "Verify Ping across all hosts" ) |
GlennRC | f7be663 | 2015-10-20 13:04:07 -0700 | [diff] [blame] | 1030 | for i in range(main.numPings): |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1031 | time1 = time.time() |
| 1032 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout) |
GlennRC | f7be663 | 2015-10-20 13:04:07 -0700 | [diff] [blame] | 1033 | if not pingResult: |
| 1034 | main.log.warn("First pingall failed. Retrying...") |
| 1035 | time.sleep(3) |
| 1036 | else: break |
| 1037 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1038 | time2 = time.time() |
| 1039 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1040 | main.log.report( |
| 1041 | "Time taken for Ping All: " + |
| 1042 | str( timeDiff ) + |
| 1043 | " seconds" ) |
| 1044 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1045 | onpass="PING ALL PASS", |
| 1046 | onfail="PING ALL FAIL" ) |
| 1047 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1048 | caseResult = ( intentState and pingResult ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1049 | utilities.assert_equals( |
| 1050 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1051 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1052 | onpass="Install 300 Host Intents and Ping All test PASS", |
| 1053 | onfail="Install 300 Host Intents and Ping All test FAIL" ) |
| 1054 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1055 | if not intentState: |
| 1056 | main.log.debug( "Intents failed to install completely" ) |
| 1057 | if not pingResult: |
| 1058 | main.log.debug( "Pingall failed" ) |
| 1059 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1060 | if not caseResult and main.failSwitch: |
| 1061 | main.log.report("Stopping test") |
| 1062 | main.stop( email=main.emailOnStop ) |
| 1063 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1064 | def CASE61( self ): |
| 1065 | """ |
| 1066 | Install 600 host intents and verify ping all for Chordal Topology |
| 1067 | """ |
| 1068 | main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" ) |
| 1069 | main.log.report( "_______________________________________" ) |
| 1070 | import itertools |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1071 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1072 | main.case( "Install 600 host intents" ) |
| 1073 | main.step( "Add host Intents" ) |
| 1074 | intentResult = main.TRUE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1075 | hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) |
| 1076 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1077 | intentIdList = [] |
| 1078 | time1 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1079 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1080 | for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ): |
| 1081 | pool = [] |
| 1082 | for cli in main.CLIs: |
| 1083 | if i >= len( hostCombos ): |
| 1084 | break |
| 1085 | t = main.Thread( target=cli.addHostIntent, |
| 1086 | threadID=main.threadID, |
| 1087 | name="addHostIntent", |
| 1088 | args=[hostCombos[i][0],hostCombos[i][1]]) |
| 1089 | pool.append(t) |
| 1090 | t.start() |
| 1091 | i = i + 1 |
| 1092 | main.threadID = main.threadID + 1 |
| 1093 | for thread in pool: |
| 1094 | thread.join() |
| 1095 | intentIdList.append(thread.result) |
| 1096 | time2 = time.time() |
| 1097 | main.log.info("Time for adding host intents: %2f seconds" %(time2-time1)) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1098 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1099 | # Saving intent ids to check intents in later cases |
| 1100 | main.intentIds = list(intentIdList) |
| 1101 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1102 | main.step("Verify intents are installed") |
| 1103 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1104 | # Giving onos multiple chances to install intents |
| 1105 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1106 | if i != 0: |
| 1107 | main.log.warn( "Verification failed. Retrying..." ) |
| 1108 | main.log.info("Waiting for onos to install intents...") |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1109 | time.sleep( main.checkIntentsDelay ) |
| 1110 | |
| 1111 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1112 | for e in range(int(main.numCtrls)): |
| 1113 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1114 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 1115 | intentState |
| 1116 | if not intentState: |
| 1117 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1118 | if intentState: |
| 1119 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1120 | else: |
| 1121 | #Dumping intent summary |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1122 | main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1123 | |
| 1124 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1125 | onpass="INTENTS INSTALLED", |
| 1126 | onfail="SOME INTENTS NOT INSTALLED" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1127 | |
| 1128 | main.step( "Verify Ping across all hosts" ) |
| 1129 | pingResult = main.FALSE |
| 1130 | time1 = time.time() |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1131 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout) |
| 1132 | if not pingResult: |
| 1133 | main.log.warn("First pingall failed. Retrying...") |
| 1134 | time1 = time.time() |
| 1135 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1136 | time2 = time.time() |
| 1137 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1138 | main.log.report( |
| 1139 | "Time taken for Ping All: " + |
| 1140 | str( timeDiff ) + |
| 1141 | " seconds" ) |
| 1142 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1143 | onpass="PING ALL PASS", |
| 1144 | onfail="PING ALL FAIL" ) |
| 1145 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1146 | caseResult = ( intentState and pingResult ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1147 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1148 | utilities.assert_equals( |
| 1149 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1150 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1151 | onpass="Install 300 Host Intents and Ping All test PASS", |
| 1152 | onfail="Install 300 Host Intents and Ping All test FAIL" ) |
| 1153 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1154 | if not intentState: |
| 1155 | main.log.debug( "Intents failed to install completely" ) |
| 1156 | if not pingResult: |
| 1157 | main.log.debug( "Pingall failed" ) |
| 1158 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1159 | if not caseResult and main.failSwitch: |
| 1160 | main.log.report("Stopping test") |
| 1161 | main.stop( email=main.emailOnStop ) |
| 1162 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1163 | def CASE62( self ): |
| 1164 | """ |
| 1165 | Install 2278 host intents and verify ping all for Spine Topology |
| 1166 | """ |
| 1167 | main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" ) |
| 1168 | main.log.report( "_______________________________________" ) |
| 1169 | import itertools |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1170 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1171 | main.case( "Install 2278 host intents" ) |
| 1172 | main.step( "Add host Intents" ) |
| 1173 | intentResult = main.TRUE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1174 | hostCombos = list( itertools.combinations( main.hostMACs, 2 ) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1175 | main.pingTimeout = 300 |
| 1176 | intentIdList = [] |
| 1177 | time1 = time.time() |
| 1178 | for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ): |
| 1179 | pool = [] |
| 1180 | for cli in main.CLIs: |
| 1181 | if i >= len( hostCombos ): |
| 1182 | break |
| 1183 | t = main.Thread( target=cli.addHostIntent, |
| 1184 | threadID=main.threadID, |
| 1185 | name="addHostIntent", |
| 1186 | args=[hostCombos[i][0],hostCombos[i][1]]) |
| 1187 | pool.append(t) |
| 1188 | t.start() |
| 1189 | i = i + 1 |
| 1190 | main.threadID = main.threadID + 1 |
| 1191 | for thread in pool: |
| 1192 | thread.join() |
| 1193 | intentIdList.append(thread.result) |
| 1194 | time2 = time.time() |
| 1195 | main.log.info("Time for adding host intents: %2f seconds" %(time2-time1)) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1196 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1197 | # Saving intent ids to check intents in later cases |
| 1198 | main.intentIds = list(intentIdList) |
| 1199 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1200 | main.step("Verify intents are installed") |
| 1201 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1202 | # Giving onos multiple chances to install intents |
| 1203 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1204 | if i != 0: |
| 1205 | main.log.warn( "Verification failed. Retrying..." ) |
| 1206 | main.log.info("Waiting for onos to install intents...") |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1207 | time.sleep( main.checkIntentsDelay ) |
| 1208 | |
| 1209 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1210 | for e in range(int(main.numCtrls)): |
| 1211 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1212 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 1213 | intentState |
| 1214 | if not intentState: |
| 1215 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1216 | if intentState: |
| 1217 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 1218 | else: |
| 1219 | #Dumping intent summary |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1220 | main.log.info( "**** Intents Summary ****\n" + str(main.ONOScli1.intents(jsonFormat=False, summary=True)) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1221 | |
| 1222 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1223 | onpass="INTENTS INSTALLED", |
| 1224 | onfail="SOME INTENTS NOT INSTALLED" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1225 | |
| 1226 | main.step( "Verify Ping across all hosts" ) |
| 1227 | pingResult = main.FALSE |
| 1228 | time1 = time.time() |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1229 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout) |
| 1230 | if not pingResult: |
| 1231 | main.log.warn("First pingall failed. Retrying...") |
| 1232 | time1 = time.time() |
| 1233 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1234 | time2 = time.time() |
| 1235 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1236 | main.log.report( |
| 1237 | "Time taken for Ping All: " + |
| 1238 | str( timeDiff ) + |
| 1239 | " seconds" ) |
| 1240 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1241 | onpass="PING ALL PASS", |
| 1242 | onfail="PING ALL FAIL" ) |
| 1243 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1244 | caseResult = ( intentState and pingResult ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1245 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1246 | utilities.assert_equals( |
| 1247 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1248 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1249 | onpass="Install 2278 Host Intents and Ping All test PASS", |
| 1250 | onfail="Install 2278 Host Intents and Ping All test FAIL" ) |
| 1251 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1252 | if not intentState: |
| 1253 | main.log.debug( "Intents failed to install completely" ) |
| 1254 | if not pingResult: |
| 1255 | main.log.debug( "Pingall failed" ) |
| 1256 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1257 | if not caseResult and main.failSwitch: |
| 1258 | main.log.report("Stopping test") |
| 1259 | main.stop( email=main.emailOnStop ) |
| 1260 | |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1261 | def CASE160( self ): |
| 1262 | """ |
| 1263 | Verify IPv6 ping across 300 host intents (Att Topology) |
| 1264 | """ |
| 1265 | main.log.report( "Verify IPv6 ping across 300 host intents (Att Topology)" ) |
| 1266 | main.log.report( "_________________________________________________" ) |
| 1267 | import itertools |
| 1268 | import time |
| 1269 | main.case( "IPv6 ping all 300 host intents" ) |
| 1270 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1271 | pingResult = main.FALSE |
| 1272 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1273 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 1274 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1275 | main.log.warn("First pingall failed. Retrying...") |
| 1276 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1277 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1278 | time2 = time.time() |
| 1279 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1280 | main.log.report( |
| 1281 | "Time taken for IPv6 Ping All: " + |
| 1282 | str( timeDiff ) + |
| 1283 | " seconds" ) |
| 1284 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1285 | onpass="PING ALL PASS", |
| 1286 | onfail="PING ALL FAIL" ) |
| 1287 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1288 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1289 | utilities.assert_equals( |
| 1290 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1291 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1292 | onpass="IPv6 Ping across 300 host intents test PASS", |
| 1293 | onfail="IPv6 Ping across 300 host intents test FAIL" ) |
| 1294 | |
| 1295 | def CASE161( self ): |
| 1296 | """ |
| 1297 | Verify IPv6 ping across 600 host intents (Chordal Topology) |
| 1298 | """ |
| 1299 | main.log.report( "Verify IPv6 ping across 600 host intents (Chordal Topology)" ) |
| 1300 | main.log.report( "_________________________________________________" ) |
| 1301 | import itertools |
| 1302 | import time |
| 1303 | main.case( "IPv6 ping all 600 host intents" ) |
| 1304 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1305 | pingResult = main.FALSE |
| 1306 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1307 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 1308 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1309 | main.log.warn("First pingall failed. Retrying...") |
| 1310 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1311 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1312 | time2 = time.time() |
| 1313 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1314 | main.log.report( |
| 1315 | "Time taken for IPv6 Ping All: " + |
| 1316 | str( timeDiff ) + |
| 1317 | " seconds" ) |
| 1318 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1319 | onpass="PING ALL PASS", |
| 1320 | onfail="PING ALL FAIL" ) |
| 1321 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1322 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1323 | utilities.assert_equals( |
| 1324 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1325 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1326 | onpass="IPv6 Ping across 600 host intents test PASS", |
| 1327 | onfail="IPv6 Ping across 600 host intents test FAIL" ) |
| 1328 | |
| 1329 | def CASE162( self ): |
| 1330 | """ |
| 1331 | Verify IPv6 ping across 2278 host intents (Spine Topology) |
| 1332 | """ |
| 1333 | main.log.report( "Verify IPv6 ping across 2278 host intents (Spine Topology)" ) |
| 1334 | main.log.report( "_________________________________________________" ) |
| 1335 | import itertools |
| 1336 | import time |
| 1337 | main.case( "IPv6 ping all 600 host intents" ) |
| 1338 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1339 | pingResult = main.FALSE |
| 1340 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1341 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 1342 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1343 | main.log.warn("First pingall failed. Retrying...") |
| 1344 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 1345 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1346 | time2 = time.time() |
| 1347 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1348 | main.log.report( |
| 1349 | "Time taken for IPv6 Ping All: " + |
| 1350 | str( timeDiff ) + |
| 1351 | " seconds" ) |
| 1352 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 1353 | onpass="PING ALL PASS", |
| 1354 | onfail="PING ALL FAIL" ) |
| 1355 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1356 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1357 | utilities.assert_equals( |
| 1358 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1359 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 1360 | onpass="IPv6 Ping across 600 host intents test PASS", |
| 1361 | onfail="IPv6 Ping across 600 host intents test FAIL" ) |
| 1362 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1363 | def CASE70( self, main ): |
| 1364 | """ |
| 1365 | Randomly bring some core links down and verify ping all ( Host Intents-Att Topo) |
| 1366 | """ |
| 1367 | import random |
| 1368 | main.randomLink1 = [] |
| 1369 | main.randomLink2 = [] |
| 1370 | main.randomLink3 = [] |
| 1371 | link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ] |
| 1372 | link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' ) |
| 1373 | link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ] |
| 1374 | link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' ) |
| 1375 | link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ] |
| 1376 | link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' ) |
| 1377 | switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ] |
| 1378 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 1379 | |
| 1380 | main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" ) |
| 1381 | main.log.report( "___________________________________________________________________________" ) |
| 1382 | main.case( "Host intents - Randomly bring some core links down and verify ping all" ) |
| 1383 | main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" ) |
| 1384 | if ( int( switchLinksToToggle ) == |
| 1385 | 0 or int( switchLinksToToggle ) > 5 ): |
| 1386 | main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" ) |
| 1387 | #main.cleanup() |
| 1388 | #main.exit() |
| 1389 | else: |
| 1390 | main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" ) |
| 1391 | |
| 1392 | main.step( "Cut links on Core devices using user provided range" ) |
| 1393 | main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) ) |
| 1394 | main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) ) |
| 1395 | main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) ) |
| 1396 | for i in range( int( switchLinksToToggle ) ): |
| 1397 | main.Mininet1.link( |
| 1398 | END1=link1End1, |
| 1399 | END2=main.randomLink1[ i ], |
| 1400 | OPTION="down" ) |
| 1401 | time.sleep( link_sleep ) |
| 1402 | main.Mininet1.link( |
| 1403 | END1=link2End1, |
| 1404 | END2=main.randomLink2[ i ], |
| 1405 | OPTION="down" ) |
| 1406 | time.sleep( link_sleep ) |
| 1407 | main.Mininet1.link( |
| 1408 | END1=link3End1, |
| 1409 | END2=main.randomLink3[ i ], |
| 1410 | OPTION="down" ) |
| 1411 | time.sleep( link_sleep ) |
| 1412 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1413 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1414 | linkDown = main.ONOSbench.checkStatus( |
| 1415 | topology_output, main.numMNswitches, str( |
| 1416 | int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) ) |
| 1417 | utilities.assert_equals( |
| 1418 | expect=main.TRUE, |
| 1419 | actual=linkDown, |
| 1420 | onpass="Link Down discovered properly", |
| 1421 | onfail="Link down was not discovered in " + |
| 1422 | str( link_sleep ) + |
| 1423 | " seconds" ) |
| 1424 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1425 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1426 | # Giving onos multiple chances to install intents |
| 1427 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1428 | if i != 0: |
| 1429 | main.log.warn( "Verification failed. Retrying..." ) |
| 1430 | main.log.info("Giving onos some time...") |
| 1431 | time.sleep( main.checkIntentsDelay ) |
| 1432 | |
| 1433 | intentState = main.TRUE |
| 1434 | for e in range(int(main.numCtrls)): |
| 1435 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1436 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1437 | intentState |
| 1438 | if not intentState: |
| 1439 | main.log.warn( "Not all intents installed" ) |
| 1440 | if intentState: |
| 1441 | break |
| 1442 | else: |
| 1443 | #Dumping intent summary |
| 1444 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1445 | |
| 1446 | |
| 1447 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1448 | onpass="INTENTS INSTALLED", |
| 1449 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1450 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1451 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1452 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1453 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1454 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 1455 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1456 | main.log.warn("First pingall failed. Retrying...") |
| 1457 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1458 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1459 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1460 | time2 = time.time() |
| 1461 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1462 | main.log.report( |
| 1463 | "Time taken for Ping All: " + |
| 1464 | str( timeDiff ) + |
| 1465 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1466 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1467 | onpass="PING ALL PASS", |
| 1468 | onfail="PING ALL FAIL" ) |
| 1469 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1470 | caseResult = linkDown and pingResult and intentState |
| 1471 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1472 | onpass="Random Link cut Test PASS", |
| 1473 | onfail="Random Link cut Test FAIL" ) |
| 1474 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1475 | # Printing what exactly failed |
| 1476 | if not linkDown: |
| 1477 | main.log.debug( "Link down was not discovered correctly" ) |
| 1478 | if not pingResult: |
| 1479 | main.log.debug( "Pingall failed" ) |
| 1480 | if not intentState: |
| 1481 | main.log.debug( "Intents are not all installed" ) |
| 1482 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1483 | if not caseResult and main.failSwitch: |
| 1484 | main.log.report("Stopping test") |
| 1485 | main.stop( email=main.emailOnStop ) |
| 1486 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1487 | def CASE80( self, main ): |
| 1488 | """ |
| 1489 | Bring the core links up that are down and verify ping all ( Host Intents-Att Topo ) |
| 1490 | """ |
| 1491 | import random |
| 1492 | link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ] |
| 1493 | link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ] |
| 1494 | link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ] |
| 1495 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 1496 | switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ] |
| 1497 | |
| 1498 | main.log.report( |
| 1499 | "Bring the core links up that are down and verify ping all (Host Intents-Att Topo" ) |
| 1500 | main.log.report( |
| 1501 | "__________________________________________________________________" ) |
| 1502 | main.case( |
| 1503 | "Host intents - Bring the core links up that are down and verify ping all" ) |
| 1504 | main.step( "Bring randomly cut links on Core devices up" ) |
| 1505 | for i in range( int( switchLinksToToggle ) ): |
| 1506 | main.Mininet1.link( |
| 1507 | END1=link1End1, |
| 1508 | END2=main.randomLink1[ i ], |
| 1509 | OPTION="up" ) |
| 1510 | time.sleep( link_sleep ) |
| 1511 | main.Mininet1.link( |
| 1512 | END1=link2End1, |
| 1513 | END2=main.randomLink2[ i ], |
| 1514 | OPTION="up" ) |
| 1515 | time.sleep( link_sleep ) |
| 1516 | main.Mininet1.link( |
| 1517 | END1=link3End1, |
| 1518 | END2=main.randomLink3[ i ], |
| 1519 | OPTION="up" ) |
| 1520 | time.sleep( link_sleep ) |
| 1521 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1522 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1523 | linkUp = main.ONOSbench.checkStatus( |
| 1524 | topology_output, |
| 1525 | main.numMNswitches, |
| 1526 | str( main.numMNlinks ) ) |
| 1527 | utilities.assert_equals( |
| 1528 | expect=main.TRUE, |
| 1529 | actual=linkUp, |
| 1530 | onpass="Link up discovered properly", |
| 1531 | onfail="Link up was not discovered in " + |
| 1532 | str( link_sleep ) + |
| 1533 | " seconds" ) |
| 1534 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1535 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1536 | # Giving onos multiple chances to install intents |
| 1537 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1538 | if i != 0: |
| 1539 | main.log.warn( "Verification failed. Retrying..." ) |
| 1540 | main.log.info("Giving onos some time...") |
| 1541 | time.sleep( main.checkIntentsDelay ) |
| 1542 | |
| 1543 | intentState = main.TRUE |
| 1544 | for e in range(int(main.numCtrls)): |
| 1545 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1546 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1547 | intentState |
| 1548 | if not intentState: |
| 1549 | main.log.warn( "Not all intents installed" ) |
| 1550 | if intentState: |
| 1551 | break |
| 1552 | else: |
| 1553 | #Dumping intent summary |
| 1554 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1555 | |
| 1556 | |
| 1557 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1558 | onpass="INTENTS INSTALLED", |
| 1559 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1560 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1561 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1562 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1563 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1564 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 1565 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1566 | main.log.warn("First pingall failed. Retrying...") |
| 1567 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1568 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1569 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1570 | time2 = time.time() |
| 1571 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1572 | main.log.report( |
| 1573 | "Time taken for Ping All: " + |
| 1574 | str( timeDiff ) + |
| 1575 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1576 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1577 | onpass="PING ALL PASS", |
| 1578 | onfail="PING ALL FAIL" ) |
| 1579 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1580 | caseResult = linkUp and pingResult |
| 1581 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1582 | onpass="Link Up Test PASS", |
| 1583 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1584 | # Printing what exactly failed |
| 1585 | if not linkUp: |
| 1586 | main.log.debug( "Link down was not discovered correctly" ) |
| 1587 | if not pingResult: |
| 1588 | main.log.debug( "Pingall failed" ) |
| 1589 | if not intentState: |
| 1590 | main.log.debug( "Intents are not all installed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1591 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1592 | if not caseResult and main.failSwitch: |
| 1593 | main.log.report("Stopping test") |
| 1594 | main.stop( email=main.emailOnStop ) |
| 1595 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1596 | def CASE71( self, main ): |
| 1597 | """ |
| 1598 | Randomly bring some core links down and verify ping all ( Point Intents-Att Topo) |
| 1599 | """ |
| 1600 | import random |
| 1601 | main.randomLink1 = [] |
| 1602 | main.randomLink2 = [] |
| 1603 | main.randomLink3 = [] |
| 1604 | link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ] |
| 1605 | link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' ) |
| 1606 | link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ] |
| 1607 | link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' ) |
| 1608 | link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ] |
| 1609 | link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' ) |
| 1610 | switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ] |
| 1611 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 1612 | |
| 1613 | main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" ) |
| 1614 | main.log.report( "___________________________________________________________________________" ) |
| 1615 | main.case( "Point intents - Randomly bring some core links down and verify ping all" ) |
| 1616 | main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" ) |
| 1617 | if ( int( switchLinksToToggle ) == |
| 1618 | 0 or int( switchLinksToToggle ) > 5 ): |
| 1619 | main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" ) |
| 1620 | #main.cleanup() |
| 1621 | #main.exit() |
| 1622 | else: |
| 1623 | main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" ) |
| 1624 | |
| 1625 | main.step( "Cut links on Core devices using user provided range" ) |
| 1626 | main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) ) |
| 1627 | main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) ) |
| 1628 | main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) ) |
| 1629 | for i in range( int( switchLinksToToggle ) ): |
| 1630 | main.Mininet1.link( |
| 1631 | END1=link1End1, |
| 1632 | END2=main.randomLink1[ i ], |
| 1633 | OPTION="down" ) |
| 1634 | time.sleep( link_sleep ) |
| 1635 | main.Mininet1.link( |
| 1636 | END1=link2End1, |
| 1637 | END2=main.randomLink2[ i ], |
| 1638 | OPTION="down" ) |
| 1639 | time.sleep( link_sleep ) |
| 1640 | main.Mininet1.link( |
| 1641 | END1=link3End1, |
| 1642 | END2=main.randomLink3[ i ], |
| 1643 | OPTION="down" ) |
| 1644 | time.sleep( link_sleep ) |
| 1645 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1646 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1647 | linkDown = main.ONOSbench.checkStatus( |
| 1648 | topology_output, main.numMNswitches, str( |
| 1649 | int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) ) |
| 1650 | utilities.assert_equals( |
| 1651 | expect=main.TRUE, |
| 1652 | actual=linkDown, |
| 1653 | onpass="Link Down discovered properly", |
| 1654 | onfail="Link down was not discovered in " + |
| 1655 | str( link_sleep ) + |
| 1656 | " seconds" ) |
| 1657 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1658 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1659 | # Giving onos multiple chances to install intents |
| 1660 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1661 | if i != 0: |
| 1662 | main.log.warn( "Verification failed. Retrying..." ) |
| 1663 | main.log.info("Giving onos some time...") |
| 1664 | time.sleep( main.checkIntentsDelay ) |
| 1665 | |
| 1666 | intentState = main.TRUE |
| 1667 | for e in range(int(main.numCtrls)): |
| 1668 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1669 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1670 | intentState |
| 1671 | if not intentState: |
| 1672 | main.log.warn( "Not all intents installed" ) |
| 1673 | if intentState: |
| 1674 | break |
| 1675 | else: |
| 1676 | #Dumping intent summary |
| 1677 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1678 | |
| 1679 | |
| 1680 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1681 | onpass="INTENTS INSTALLED", |
| 1682 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1683 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1684 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1685 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1686 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1687 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 1688 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1689 | main.log.warn("First pingall failed. Retrying...") |
| 1690 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1691 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1692 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1693 | time2 = time.time() |
| 1694 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1695 | main.log.report( |
| 1696 | "Time taken for Ping All: " + |
| 1697 | str( timeDiff ) + |
| 1698 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1699 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1700 | onpass="PING ALL PASS", |
| 1701 | onfail="PING ALL FAIL" ) |
| 1702 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1703 | caseResult = linkDown and pingResult and intentState |
| 1704 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1705 | onpass="Random Link cut Test PASS", |
| 1706 | onfail="Random Link cut Test FAIL" ) |
| 1707 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1708 | # Printing what exactly failed |
| 1709 | if not linkDown: |
| 1710 | main.log.debug( "Link down was not discovered correctly" ) |
| 1711 | if not pingResult: |
| 1712 | main.log.debug( "Pingall failed" ) |
| 1713 | if not intentState: |
| 1714 | main.log.debug( "Intents are not all installed" ) |
| 1715 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1716 | if not caseResult and main.failSwitch: |
| 1717 | main.log.report("Stopping test") |
| 1718 | main.stop( email=main.emailOnStop ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1719 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1720 | def CASE81( self, main ): |
| 1721 | """ |
| 1722 | Bring the core links up that are down and verify ping all ( Point Intents-Att Topo ) |
| 1723 | """ |
| 1724 | import random |
| 1725 | link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ] |
| 1726 | link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ] |
| 1727 | link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ] |
| 1728 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 1729 | switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ] |
| 1730 | |
| 1731 | main.log.report( |
| 1732 | "Bring the core links up that are down and verify ping all ( Point Intents-Att Topo" ) |
| 1733 | main.log.report( |
| 1734 | "__________________________________________________________________" ) |
| 1735 | main.case( |
| 1736 | "Point intents - Bring the core links up that are down and verify ping all" ) |
| 1737 | main.step( "Bring randomly cut links on Core devices up" ) |
| 1738 | for i in range( int( switchLinksToToggle ) ): |
| 1739 | main.Mininet1.link( |
| 1740 | END1=link1End1, |
| 1741 | END2=main.randomLink1[ i ], |
| 1742 | OPTION="up" ) |
| 1743 | time.sleep( link_sleep ) |
| 1744 | main.Mininet1.link( |
| 1745 | END1=link2End1, |
| 1746 | END2=main.randomLink2[ i ], |
| 1747 | OPTION="up" ) |
| 1748 | time.sleep( link_sleep ) |
| 1749 | main.Mininet1.link( |
| 1750 | END1=link3End1, |
| 1751 | END2=main.randomLink3[ i ], |
| 1752 | OPTION="up" ) |
| 1753 | time.sleep( link_sleep ) |
| 1754 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1755 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1756 | linkUp = main.ONOSbench.checkStatus( |
| 1757 | topology_output, |
| 1758 | main.numMNswitches, |
| 1759 | str( main.numMNlinks ) ) |
| 1760 | utilities.assert_equals( |
| 1761 | expect=main.TRUE, |
| 1762 | actual=linkUp, |
| 1763 | onpass="Link up discovered properly", |
| 1764 | onfail="Link up was not discovered in " + |
| 1765 | str( link_sleep ) + |
| 1766 | " seconds" ) |
| 1767 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1768 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1769 | # Giving onos multiple chances to install intents |
| 1770 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1771 | if i != 0: |
| 1772 | main.log.warn( "Verification failed. Retrying..." ) |
| 1773 | main.log.info("Giving onos some time...") |
| 1774 | time.sleep( main.checkIntentsDelay ) |
| 1775 | |
| 1776 | intentState = main.TRUE |
| 1777 | for e in range(int(main.numCtrls)): |
| 1778 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1779 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1780 | intentState |
| 1781 | if not intentState: |
| 1782 | main.log.warn( "Not all intents installed" ) |
| 1783 | if intentState: |
| 1784 | break |
| 1785 | else: |
| 1786 | #Dumping intent summary |
| 1787 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1788 | |
| 1789 | |
| 1790 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1791 | onpass="INTENTS INSTALLED", |
| 1792 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1793 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1794 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1795 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1796 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1797 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 1798 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1799 | main.log.warn("First pingall failed. Retrying...") |
| 1800 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1801 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1802 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1803 | time2 = time.time() |
| 1804 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1805 | main.log.report( |
| 1806 | "Time taken for Ping All: " + |
| 1807 | str( timeDiff ) + |
| 1808 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1809 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1810 | onpass="PING ALL PASS", |
| 1811 | onfail="PING ALL FAIL" ) |
| 1812 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1813 | caseResult = linkUp and pingResult |
| 1814 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1815 | onpass="Link Up Test PASS", |
| 1816 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1817 | # Printing what exactly failed |
| 1818 | if not linkUp: |
| 1819 | main.log.debug( "Link down was not discovered correctly" ) |
| 1820 | if not pingResult: |
| 1821 | main.log.debug( "Pingall failed" ) |
| 1822 | if not intentState: |
| 1823 | main.log.debug( "Intents are not all installed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1824 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1825 | if not caseResult and main.failSwitch: |
| 1826 | main.log.report("Stopping test") |
GlennRC | 884dc9e | 2015-10-09 15:53:20 -0700 | [diff] [blame] | 1827 | main.stop( email=main.emailOnStop ) |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1828 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1829 | def CASE72( self, main ): |
| 1830 | """ |
| 1831 | Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo) |
| 1832 | """ |
| 1833 | import random |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1834 | import itertools |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1835 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1836 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1837 | main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" ) |
| 1838 | main.log.report( "___________________________________________________________________________" ) |
| 1839 | main.case( "Host intents - Randomly bring some core links down and verify ping all" ) |
| 1840 | switches = [] |
| 1841 | switchesComb = [] |
| 1842 | for i in range( main.numMNswitches ): |
| 1843 | switches.append('s%d'%(i+1)) |
| 1844 | switchesLinksComb = list(itertools.combinations(switches,2)) |
| 1845 | main.randomLinks = random.sample(switchesLinksComb, 5 ) |
| 1846 | print main.randomLinks |
| 1847 | main.step( "Cut links on random devices" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1848 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1849 | for switch in main.randomLinks: |
| 1850 | main.Mininet1.link( |
| 1851 | END1=switch[0], |
| 1852 | END2=switch[1], |
| 1853 | OPTION="down") |
| 1854 | time.sleep( link_sleep ) |
| 1855 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1856 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1857 | linkDown = main.ONOSbench.checkStatus( |
| 1858 | topology_output, main.numMNswitches, str( |
| 1859 | int( main.numMNlinks ) - 5 * 2 ) ) |
| 1860 | utilities.assert_equals( |
| 1861 | expect=main.TRUE, |
| 1862 | actual=linkDown, |
| 1863 | onpass="Link Down discovered properly", |
| 1864 | onfail="Link down was not discovered in " + |
| 1865 | str( link_sleep ) + |
| 1866 | " seconds" ) |
| 1867 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1868 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1869 | # Giving onos multiple chances to install intents |
| 1870 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1871 | if i != 0: |
| 1872 | main.log.warn( "Verification failed. Retrying..." ) |
| 1873 | main.log.info("Giving onos some time...") |
| 1874 | time.sleep( main.checkIntentsDelay ) |
| 1875 | |
| 1876 | intentState = main.TRUE |
| 1877 | for e in range(int(main.numCtrls)): |
| 1878 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1879 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1880 | intentState |
| 1881 | if not intentState: |
| 1882 | main.log.warn( "Not all intents installed" ) |
| 1883 | if intentState: |
| 1884 | break |
| 1885 | else: |
| 1886 | #Dumping intent summary |
| 1887 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1888 | |
| 1889 | |
| 1890 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1891 | onpass="INTENTS INSTALLED", |
| 1892 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1893 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1894 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1895 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1896 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1897 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 1898 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1899 | main.log.warn("First pingall failed. Retrying...") |
| 1900 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1901 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1902 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1903 | time2 = time.time() |
| 1904 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 1905 | main.log.report( |
| 1906 | "Time taken for Ping All: " + |
| 1907 | str( timeDiff ) + |
| 1908 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1909 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1910 | onpass="PING ALL PASS", |
| 1911 | onfail="PING ALL FAIL" ) |
| 1912 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1913 | caseResult = linkDown and pingResult and intentState |
| 1914 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1915 | onpass="Random Link cut Test PASS", |
| 1916 | onfail="Random Link cut Test FAIL" ) |
| 1917 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1918 | # Printing what exactly failed |
| 1919 | if not linkDown: |
| 1920 | main.log.debug( "Link down was not discovered correctly" ) |
| 1921 | if not pingResult: |
| 1922 | main.log.debug( "Pingall failed" ) |
| 1923 | if not intentState: |
| 1924 | main.log.debug( "Intents are not all installed" ) |
| 1925 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 1926 | if not caseResult and main.failSwitch: |
| 1927 | main.log.report("Stopping test") |
| 1928 | main.stop( email=main.emailOnStop ) |
| 1929 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1930 | def CASE82( self, main ): |
| 1931 | """ |
| 1932 | Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo ) |
| 1933 | """ |
| 1934 | import random |
| 1935 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1936 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1937 | main.log.report( |
| 1938 | "Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" ) |
| 1939 | main.log.report( |
| 1940 | "__________________________________________________________________" ) |
| 1941 | main.case( |
| 1942 | "Host intents - Bring the core links up that are down and verify ping all" ) |
| 1943 | main.step( "Bring randomly cut links on devices up" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 1944 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1945 | for switch in main.randomLinks: |
| 1946 | main.Mininet1.link( |
| 1947 | END1=switch[0], |
| 1948 | END2=switch[1], |
| 1949 | OPTION="up") |
| 1950 | time.sleep( link_sleep ) |
| 1951 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 1952 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1953 | linkUp = main.ONOSbench.checkStatus( |
| 1954 | topology_output, |
| 1955 | main.numMNswitches, |
| 1956 | str( main.numMNlinks ) ) |
| 1957 | utilities.assert_equals( |
| 1958 | expect=main.TRUE, |
| 1959 | actual=linkUp, |
| 1960 | onpass="Link up discovered properly", |
| 1961 | onfail="Link up was not discovered in " + |
| 1962 | str( link_sleep ) + |
| 1963 | " seconds" ) |
| 1964 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1965 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 1966 | # Giving onos multiple chances to install intents |
| 1967 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1968 | if i != 0: |
| 1969 | main.log.warn( "Verification failed. Retrying..." ) |
| 1970 | main.log.info("Giving onos some time...") |
| 1971 | time.sleep( main.checkIntentsDelay ) |
| 1972 | |
| 1973 | intentState = main.TRUE |
| 1974 | for e in range(int(main.numCtrls)): |
| 1975 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 1976 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 1977 | intentState |
| 1978 | if not intentState: |
| 1979 | main.log.warn( "Not all intents installed" ) |
| 1980 | if intentState: |
| 1981 | break |
| 1982 | else: |
| 1983 | #Dumping intent summary |
| 1984 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 1985 | |
| 1986 | |
| 1987 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 1988 | onpass="INTENTS INSTALLED", |
| 1989 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 1990 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1991 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1992 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 1993 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1994 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 1995 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1996 | main.log.warn("First pingall failed. Retrying...") |
| 1997 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 1998 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 1999 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2000 | time2 = time.time() |
| 2001 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2002 | main.log.report( |
| 2003 | "Time taken for Ping All: " + |
| 2004 | str( timeDiff ) + |
| 2005 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2006 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2007 | onpass="PING ALL PASS", |
| 2008 | onfail="PING ALL FAIL" ) |
| 2009 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2010 | caseResult = linkUp and pingResult |
| 2011 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2012 | onpass="Link Up Test PASS", |
| 2013 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2014 | # Printing what exactly failed |
| 2015 | if not linkUp: |
| 2016 | main.log.debug( "Link down was not discovered correctly" ) |
| 2017 | if not pingResult: |
| 2018 | main.log.debug( "Pingall failed" ) |
| 2019 | if not intentState: |
| 2020 | main.log.debug( "Intents are not all installed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2021 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2022 | if not caseResult and main.failSwitch: |
| 2023 | main.log.report("Stopping test") |
| 2024 | main.stop( email=main.emailOnStop ) |
| 2025 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2026 | def CASE73( self, main ): |
| 2027 | """ |
| 2028 | Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo) |
| 2029 | """ |
| 2030 | import random |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2031 | import itertools |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2032 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2033 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2034 | main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" ) |
| 2035 | main.log.report( "___________________________________________________________________________" ) |
| 2036 | main.case( "Point intents - Randomly bring some core links down and verify ping all" ) |
| 2037 | switches = [] |
| 2038 | switchesComb = [] |
| 2039 | for i in range( main.numMNswitches ): |
| 2040 | switches.append('s%d'%(i+1)) |
| 2041 | switchesLinksComb = list(itertools.combinations(switches,2)) |
| 2042 | main.randomLinks = random.sample(switchesLinksComb, 5 ) |
| 2043 | print main.randomLinks |
| 2044 | main.step( "Cut links on random devices" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2045 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2046 | for switch in main.randomLinks: |
| 2047 | main.Mininet1.link( |
| 2048 | END1=switch[0], |
| 2049 | END2=switch[1], |
| 2050 | OPTION="down") |
| 2051 | time.sleep( link_sleep ) |
| 2052 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2053 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2054 | linkDown = main.ONOSbench.checkStatus( |
| 2055 | topology_output, main.numMNswitches, str( |
| 2056 | int( main.numMNlinks ) - 5 * 2 ) ) |
| 2057 | utilities.assert_equals( |
| 2058 | expect=main.TRUE, |
| 2059 | actual=linkDown, |
| 2060 | onpass="Link Down discovered properly", |
| 2061 | onfail="Link down was not discovered in " + |
| 2062 | str( link_sleep ) + |
| 2063 | " seconds" ) |
| 2064 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2065 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2066 | # Giving onos multiple chances to install intents |
| 2067 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2068 | if i != 0: |
| 2069 | main.log.warn( "Verification failed. Retrying..." ) |
| 2070 | main.log.info("Giving onos some time...") |
| 2071 | time.sleep( main.checkIntentsDelay ) |
| 2072 | |
| 2073 | intentState = main.TRUE |
| 2074 | for e in range(int(main.numCtrls)): |
| 2075 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2076 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2077 | intentState |
| 2078 | if not intentState: |
| 2079 | main.log.warn( "Not all intents installed" ) |
| 2080 | if intentState: |
| 2081 | break |
| 2082 | else: |
| 2083 | #Dumping intent summary |
| 2084 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2085 | |
| 2086 | |
| 2087 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2088 | onpass="INTENTS INSTALLED", |
| 2089 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2090 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2091 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2092 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2093 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2094 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 2095 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2096 | main.log.warn("First pingall failed. Retrying...") |
| 2097 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2098 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2099 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2100 | time2 = time.time() |
| 2101 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2102 | main.log.report( |
| 2103 | "Time taken for Ping All: " + |
| 2104 | str( timeDiff ) + |
| 2105 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2106 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2107 | onpass="PING ALL PASS", |
| 2108 | onfail="PING ALL FAIL" ) |
| 2109 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2110 | caseResult = linkDown and pingResult and intentState |
| 2111 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2112 | onpass="Random Link cut Test PASS", |
| 2113 | onfail="Random Link cut Test FAIL" ) |
| 2114 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2115 | # Printing what exactly failed |
| 2116 | if not linkDown: |
| 2117 | main.log.debug( "Link down was not discovered correctly" ) |
| 2118 | if not pingResult: |
| 2119 | main.log.debug( "Pingall failed" ) |
| 2120 | if not intentState: |
| 2121 | main.log.debug( "Intents are not all installed" ) |
| 2122 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2123 | if not caseResult and main.failSwitch: |
| 2124 | main.log.report("Stopping test") |
| 2125 | main.stop( email=main.emailOnStop ) |
| 2126 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2127 | def CASE83( self, main ): |
| 2128 | """ |
| 2129 | Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo ) |
| 2130 | """ |
| 2131 | import random |
| 2132 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2133 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2134 | main.log.report( |
| 2135 | "Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" ) |
| 2136 | main.log.report( |
| 2137 | "__________________________________________________________________" ) |
| 2138 | main.case( |
| 2139 | "Point intents - Bring the core links up that are down and verify ping all" ) |
| 2140 | main.step( "Bring randomly cut links on devices up" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2141 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2142 | for switch in main.randomLinks: |
| 2143 | main.Mininet1.link( |
| 2144 | END1=switch[0], |
| 2145 | END2=switch[1], |
| 2146 | OPTION="up") |
| 2147 | time.sleep( link_sleep ) |
| 2148 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2149 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2150 | linkUp = main.ONOSbench.checkStatus( |
| 2151 | topology_output, |
| 2152 | main.numMNswitches, |
| 2153 | str( main.numMNlinks ) ) |
| 2154 | utilities.assert_equals( |
| 2155 | expect=main.TRUE, |
| 2156 | actual=linkUp, |
| 2157 | onpass="Link up discovered properly", |
| 2158 | onfail="Link up was not discovered in " + |
| 2159 | str( link_sleep ) + |
| 2160 | " seconds" ) |
| 2161 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2162 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2163 | # Giving onos multiple chances to install intents |
| 2164 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2165 | if i != 0: |
| 2166 | main.log.warn( "Verification failed. Retrying..." ) |
| 2167 | main.log.info("Giving onos some time...") |
| 2168 | time.sleep( main.checkIntentsDelay ) |
| 2169 | |
| 2170 | intentState = main.TRUE |
| 2171 | for e in range(int(main.numCtrls)): |
| 2172 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2173 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2174 | intentState |
| 2175 | if not intentState: |
| 2176 | main.log.warn( "Not all intents installed" ) |
| 2177 | if intentState: |
| 2178 | break |
| 2179 | else: |
| 2180 | #Dumping intent summary |
| 2181 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2182 | |
| 2183 | |
| 2184 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2185 | onpass="INTENTS INSTALLED", |
| 2186 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2187 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2188 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2189 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2190 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2191 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 2192 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2193 | main.log.warn("First pingall failed. Retrying...") |
| 2194 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2195 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2196 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2197 | time2 = time.time() |
| 2198 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2199 | main.log.report( |
| 2200 | "Time taken for Ping All: " + |
| 2201 | str( timeDiff ) + |
| 2202 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2203 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2204 | onpass="PING ALL PASS", |
| 2205 | onfail="PING ALL FAIL" ) |
| 2206 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2207 | caseResult = linkUp and pingResult |
| 2208 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2209 | onpass="Link Up Test PASS", |
| 2210 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2211 | # Printing what exactly failed |
| 2212 | if not linkUp: |
| 2213 | main.log.debug( "Link down was not discovered correctly" ) |
| 2214 | if not pingResult: |
| 2215 | main.log.debug( "Pingall failed" ) |
| 2216 | if not intentState: |
| 2217 | main.log.debug( "Intents are not all installed" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2218 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2219 | if not caseResult and main.failSwitch: |
| 2220 | main.log.report("Stopping test") |
| 2221 | main.stop( email=main.emailOnStop ) |
| 2222 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2223 | def CASE74( self, main ): |
| 2224 | """ |
| 2225 | Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo) |
| 2226 | """ |
| 2227 | import random |
| 2228 | main.randomLink1 = [] |
| 2229 | main.randomLink2 = [] |
| 2230 | main.randomLink3 = [] |
| 2231 | main.randomLink4 = [] |
| 2232 | link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ] |
| 2233 | link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' ) |
| 2234 | link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' ) |
| 2235 | link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ] |
| 2236 | link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' ) |
| 2237 | link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' ) |
| 2238 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 2239 | main.pingTimeout = 400 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2240 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2241 | main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" ) |
| 2242 | main.log.report( "___________________________________________________________________________" ) |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2243 | main.log.case( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2244 | linkIndex = range(4) |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2245 | linkIndexS9 = random.sample(linkIndex,1)[0] |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2246 | linkIndex.remove(linkIndexS9) |
| 2247 | linkIndexS10 = random.sample(linkIndex,1)[0] |
| 2248 | main.randomLink1 = link1End2top[linkIndexS9] |
| 2249 | main.randomLink2 = link2End2top[linkIndexS10] |
| 2250 | main.randomLink3 = random.sample(link1End2bot,1)[0] |
| 2251 | main.randomLink4 = random.sample(link2End2bot,1)[0] |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2252 | |
| 2253 | # Work around for link state propagation delay. Added some sleep time. |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2254 | # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" ) |
| 2255 | # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" ) |
| 2256 | main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" ) |
| 2257 | time.sleep( link_sleep ) |
| 2258 | main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" ) |
| 2259 | time.sleep( link_sleep ) |
| 2260 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2261 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2262 | linkDown = main.ONOSbench.checkStatus( |
| 2263 | topology_output, main.numMNswitches, str( |
Hari Krishna | 390d470 | 2015-08-21 14:37:46 -0700 | [diff] [blame] | 2264 | int( main.numMNlinks ) - 4 )) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2265 | utilities.assert_equals( |
| 2266 | expect=main.TRUE, |
| 2267 | actual=linkDown, |
| 2268 | onpass="Link Down discovered properly", |
| 2269 | onfail="Link down was not discovered in " + |
| 2270 | str( link_sleep ) + |
| 2271 | " seconds" ) |
| 2272 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2273 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2274 | # Giving onos multiple chances to install intents |
| 2275 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2276 | if i != 0: |
| 2277 | main.log.warn( "Verification failed. Retrying..." ) |
| 2278 | main.log.info("Giving onos some time...") |
| 2279 | time.sleep( main.checkIntentsDelay ) |
| 2280 | |
| 2281 | intentState = main.TRUE |
| 2282 | for e in range(int(main.numCtrls)): |
| 2283 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2284 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2285 | intentState |
| 2286 | if not intentState: |
| 2287 | main.log.warn( "Not all intents installed" ) |
| 2288 | if intentState: |
| 2289 | break |
| 2290 | else: |
| 2291 | #Dumping intent summary |
| 2292 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2293 | |
| 2294 | |
| 2295 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2296 | onpass="INTENTS INSTALLED", |
| 2297 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2298 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2299 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2300 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2301 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2302 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 2303 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2304 | main.log.warn("First pingall failed. Retrying...") |
| 2305 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2306 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2307 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2308 | time2 = time.time() |
| 2309 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2310 | main.log.report( |
| 2311 | "Time taken for Ping All: " + |
| 2312 | str( timeDiff ) + |
| 2313 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2314 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2315 | onpass="PING ALL PASS", |
| 2316 | onfail="PING ALL FAIL" ) |
| 2317 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2318 | caseResult = linkDown and pingResult and intentState |
| 2319 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2320 | onpass="Random Link cut Test PASS", |
| 2321 | onfail="Random Link cut Test FAIL" ) |
| 2322 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2323 | # Printing what exactly failed |
| 2324 | if not linkDown: |
| 2325 | main.log.debug( "Link down was not discovered correctly" ) |
| 2326 | if not pingResult: |
| 2327 | main.log.debug( "Pingall failed" ) |
| 2328 | if not intentState: |
| 2329 | main.log.debug( "Intents are not all installed" ) |
| 2330 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2331 | if not caseResult and main.failSwitch: |
| 2332 | main.log.report("Stopping test") |
| 2333 | main.stop( email=main.emailOnStop ) |
| 2334 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2335 | def CASE84( self, main ): |
| 2336 | """ |
| 2337 | Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo ) |
| 2338 | """ |
| 2339 | import random |
| 2340 | link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ] |
| 2341 | link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ] |
| 2342 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 2343 | main.log.report( |
| 2344 | "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" ) |
| 2345 | main.log.report( |
| 2346 | "__________________________________________________________________" ) |
| 2347 | main.case( |
| 2348 | "Host intents - Bring the core links up that are down and verify ping all" ) |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2349 | |
| 2350 | # Work around for link state propagation delay. Added some sleep time. |
| 2351 | # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" ) |
| 2352 | # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2353 | main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" ) |
| 2354 | time.sleep( link_sleep ) |
| 2355 | main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" ) |
| 2356 | time.sleep( link_sleep ) |
| 2357 | |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 2358 | topology_output = main.ONOScli1.topology() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2359 | linkUp = main.ONOSbench.checkStatus( |
| 2360 | topology_output, |
| 2361 | main.numMNswitches, |
| 2362 | str( main.numMNlinks ) ) |
| 2363 | utilities.assert_equals( |
| 2364 | expect=main.TRUE, |
| 2365 | actual=linkUp, |
| 2366 | onpass="Link up discovered properly", |
| 2367 | onfail="Link up was not discovered in " + |
| 2368 | str( link_sleep ) + |
| 2369 | " seconds" ) |
| 2370 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2371 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2372 | # Giving onos multiple chances to install intents |
| 2373 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2374 | if i != 0: |
| 2375 | main.log.warn( "Verification failed. Retrying..." ) |
| 2376 | main.log.info("Giving onos some time...") |
| 2377 | time.sleep( main.checkIntentsDelay ) |
| 2378 | |
| 2379 | intentState = main.TRUE |
| 2380 | for e in range(int(main.numCtrls)): |
| 2381 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2382 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2383 | intentState |
| 2384 | if not intentState: |
| 2385 | main.log.warn( "Not all intents installed" ) |
| 2386 | if intentState: |
| 2387 | break |
| 2388 | else: |
| 2389 | #Dumping intent summary |
| 2390 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2391 | |
| 2392 | |
| 2393 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2394 | onpass="INTENTS INSTALLED", |
| 2395 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2396 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2397 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2398 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2399 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2400 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 2401 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2402 | main.log.warn("First pingall failed. Retrying...") |
| 2403 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2404 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2405 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2406 | time2 = time.time() |
| 2407 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2408 | main.log.report( |
| 2409 | "Time taken for Ping All: " + |
| 2410 | str( timeDiff ) + |
| 2411 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2412 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2413 | onpass="PING ALL PASS", |
| 2414 | onfail="PING ALL FAIL" ) |
| 2415 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2416 | caseResult = linkUp and pingResult |
| 2417 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 2418 | onpass="Link Up Test PASS", |
| 2419 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2420 | # Printing what exactly failed |
| 2421 | if not linkUp: |
| 2422 | main.log.debug( "Link down was not discovered correctly" ) |
| 2423 | if not pingResult: |
| 2424 | main.log.debug( "Pingall failed" ) |
| 2425 | if not intentState: |
| 2426 | main.log.debug( "Intents are not all installed" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 2427 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2428 | if not caseResult and main.failSwitch: |
| 2429 | main.log.report("Stopping test") |
| 2430 | main.stop( email=main.emailOnStop ) |
| 2431 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2432 | def CASE75( self, main ): |
| 2433 | """ |
| 2434 | Randomly bring some core links down and verify ping all ( Point Intents-Spine Topo) |
| 2435 | """ |
| 2436 | import random |
| 2437 | main.randomLink1 = [] |
| 2438 | main.randomLink2 = [] |
| 2439 | main.randomLink3 = [] |
| 2440 | main.randomLink4 = [] |
| 2441 | link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ] |
| 2442 | link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' ) |
| 2443 | link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' ) |
| 2444 | link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ] |
| 2445 | link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' ) |
| 2446 | link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' ) |
| 2447 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 2448 | main.pingTimeout = 400 |
| 2449 | |
| 2450 | main.log.report( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" ) |
| 2451 | main.log.report( "___________________________________________________________________________" ) |
| 2452 | main.case( "Bring some core links down and verify ping all (Point Intents-Spine Topo)" ) |
| 2453 | linkIndex = range(4) |
| 2454 | linkIndexS9 = random.sample(linkIndex,1)[0] |
| 2455 | linkIndex.remove(linkIndexS9) |
| 2456 | linkIndexS10 = random.sample(linkIndex,1)[0] |
| 2457 | main.randomLink1 = link1End2top[linkIndexS9] |
| 2458 | main.randomLink2 = link2End2top[linkIndexS10] |
| 2459 | main.randomLink3 = random.sample(link1End2bot,1)[0] |
| 2460 | main.randomLink4 = random.sample(link2End2bot,1)[0] |
| 2461 | |
| 2462 | # Work around for link state propagation delay. Added some sleep time. |
| 2463 | # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" ) |
| 2464 | # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" ) |
| 2465 | main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" ) |
| 2466 | time.sleep( link_sleep ) |
| 2467 | main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" ) |
| 2468 | time.sleep( link_sleep ) |
| 2469 | |
| 2470 | topology_output = main.ONOScli1.topology() |
| 2471 | linkDown = main.ONOSbench.checkStatus( |
| 2472 | topology_output, main.numMNswitches, str( |
Hari Krishna | 390d470 | 2015-08-21 14:37:46 -0700 | [diff] [blame] | 2473 | int( main.numMNlinks ) - 4 )) |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2474 | utilities.assert_equals( |
| 2475 | expect=main.TRUE, |
| 2476 | actual=linkDown, |
| 2477 | onpass="Link Down discovered properly", |
| 2478 | onfail="Link down was not discovered in " + |
| 2479 | str( link_sleep ) + |
| 2480 | " seconds" ) |
| 2481 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2482 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2483 | # Giving onos multiple chances to install intents |
| 2484 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2485 | if i != 0: |
| 2486 | main.log.warn( "Verification failed. Retrying..." ) |
| 2487 | main.log.info("Giving onos some time...") |
| 2488 | time.sleep( main.checkIntentsDelay ) |
| 2489 | |
| 2490 | intentState = main.TRUE |
| 2491 | for e in range(int(main.numCtrls)): |
| 2492 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2493 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2494 | intentState |
| 2495 | if not intentState: |
| 2496 | main.log.warn( "Not all intents installed" ) |
| 2497 | if intentState: |
| 2498 | break |
| 2499 | else: |
| 2500 | #Dumping intent summary |
| 2501 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2502 | |
| 2503 | |
| 2504 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2505 | onpass="INTENTS INSTALLED", |
| 2506 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2507 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2508 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2509 | pingResult = main.FALSE |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2510 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2511 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
| 2512 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2513 | main.log.warn("First pingall failed. Retrying...") |
| 2514 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2515 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2516 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2517 | time2 = time.time() |
| 2518 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2519 | main.log.report( |
| 2520 | "Time taken for Ping All: " + |
| 2521 | str( timeDiff ) + |
| 2522 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2523 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2524 | onpass="PING ALL PASS", |
| 2525 | onfail="PING ALL FAIL" ) |
| 2526 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2527 | caseResult = linkDown and pingResult and intentState |
| 2528 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2529 | onpass="Random Link cut Test PASS", |
| 2530 | onfail="Random Link cut Test FAIL" ) |
| 2531 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2532 | # Printing what exactly failed |
| 2533 | if not linkDown: |
| 2534 | main.log.debug( "Link down was not discovered correctly" ) |
| 2535 | if not pingResult: |
| 2536 | main.log.debug( "Pingall failed" ) |
| 2537 | if not intentState: |
| 2538 | main.log.debug( "Intents are not all installed" ) |
| 2539 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2540 | if not caseResult and main.failSwitch: |
| 2541 | main.log.report("Stopping test") |
| 2542 | main.stop( email=main.emailOnStop ) |
| 2543 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2544 | def CASE85( self, main ): |
| 2545 | """ |
| 2546 | Bring the core links up that are down and verify ping all ( Point Intents-Spine Topo ) |
| 2547 | """ |
| 2548 | import random |
| 2549 | link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ] |
| 2550 | link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ] |
| 2551 | link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] ) |
| 2552 | main.log.report( |
| 2553 | "Bring the core links up that are down and verify ping all (Point Intents-Spine Topo" ) |
| 2554 | main.log.report( |
| 2555 | "__________________________________________________________________" ) |
| 2556 | main.case( |
| 2557 | "Point intents - Bring the core links up that are down and verify ping all" ) |
| 2558 | |
| 2559 | # Work around for link state propagation delay. Added some sleep time. |
| 2560 | # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" ) |
| 2561 | # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" ) |
| 2562 | main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" ) |
| 2563 | time.sleep( link_sleep ) |
| 2564 | main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" ) |
| 2565 | time.sleep( link_sleep ) |
| 2566 | |
| 2567 | topology_output = main.ONOScli1.topology() |
| 2568 | linkUp = main.ONOSbench.checkStatus( |
| 2569 | topology_output, |
| 2570 | main.numMNswitches, |
| 2571 | str( main.numMNlinks ) ) |
| 2572 | utilities.assert_equals( |
| 2573 | expect=main.TRUE, |
| 2574 | actual=linkUp, |
| 2575 | onpass="Link up discovered properly", |
| 2576 | onfail="Link up was not discovered in " + |
| 2577 | str( link_sleep ) + |
| 2578 | " seconds" ) |
| 2579 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2580 | main.step("Verify intents are installed") |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 2581 | # Giving onos multiple chances to install intents |
| 2582 | for i in range( main.intentCheck ): |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2583 | if i != 0: |
| 2584 | main.log.warn( "Verification failed. Retrying..." ) |
| 2585 | main.log.info("Giving onos some time...") |
| 2586 | time.sleep( main.checkIntentsDelay ) |
| 2587 | |
| 2588 | intentState = main.TRUE |
| 2589 | for e in range(int(main.numCtrls)): |
| 2590 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 2591 | intentState = main.CLIs[e].checkIntentState( intentsId = main.intentIds ) and\ |
| 2592 | intentState |
| 2593 | if not intentState: |
| 2594 | main.log.warn( "Not all intents installed" ) |
| 2595 | if intentState: |
| 2596 | break |
| 2597 | else: |
| 2598 | #Dumping intent summary |
| 2599 | main.log.info( "**** Intent Summary ****\n" + str(main.ONOScli1.intents( jsonFormat=False, summary=True)) ) |
| 2600 | |
| 2601 | |
| 2602 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 2603 | onpass="INTENTS INSTALLED", |
| 2604 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 2605 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2606 | main.step( "Verify Ping across all hosts" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2607 | pingResult = main.FALSE |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2608 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2609 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 2610 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2611 | main.log.warn("First pingall failed. Retrying...") |
| 2612 | time1 = time.time() |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2613 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2614 | |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2615 | time2 = time.time() |
| 2616 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2617 | main.log.report( |
| 2618 | "Time taken for Ping All: " + |
| 2619 | str( timeDiff ) + |
| 2620 | " seconds" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2621 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2622 | onpass="PING ALL PASS", |
| 2623 | onfail="PING ALL FAIL" ) |
| 2624 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2625 | caseResult = linkUp and pingResult |
| 2626 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2627 | onpass="Link Up Test PASS", |
| 2628 | onfail="Link Up Test FAIL" ) |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 2629 | # Printing what exactly failed |
| 2630 | if not linkUp: |
| 2631 | main.log.debug( "Link down was not discovered correctly" ) |
| 2632 | if not pingResult: |
| 2633 | main.log.debug( "Pingall failed" ) |
| 2634 | if not intentState: |
| 2635 | main.log.debug( "Intents are not all installed" ) |
Hari Krishna | b79d082 | 2015-08-20 09:48:43 -0700 | [diff] [blame] | 2636 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2637 | if not caseResult and main.failSwitch: |
| 2638 | main.log.report("Stopping test") |
| 2639 | main.stop( email=main.emailOnStop ) |
| 2640 | |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2641 | def CASE170( self ): |
| 2642 | """ |
| 2643 | IPv6 ping all with some core links down( Host Intents-Att Topo) |
| 2644 | """ |
| 2645 | main.log.report( "IPv6 ping all with some core links down( Host Intents-Att Topo )" ) |
| 2646 | main.log.report( "_________________________________________________" ) |
| 2647 | import itertools |
| 2648 | import time |
| 2649 | main.case( "IPv6 ping all with some core links down( Host Intents-Att Topo )" ) |
| 2650 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2651 | pingResult = main.FALSE |
| 2652 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2653 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2654 | if not pingResult: |
| 2655 | main.log.warn("Failed to ping Ipv6 hosts. Retrying...") |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2656 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2657 | time2 = time.time() |
| 2658 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2659 | main.log.report( |
| 2660 | "Time taken for IPv6 Ping All: " + |
| 2661 | str( timeDiff ) + |
| 2662 | " seconds" ) |
| 2663 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2664 | onpass="PING ALL PASS", |
| 2665 | onfail="PING ALL FAIL" ) |
| 2666 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2667 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2668 | utilities.assert_equals( |
| 2669 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2670 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2671 | onpass="IPv6 Ping across 300 host intents test PASS", |
| 2672 | onfail="IPv6 Ping across 300 host intents test FAIL" ) |
| 2673 | |
| 2674 | def CASE180( self ): |
| 2675 | """ |
| 2676 | IPv6 ping all with after core links back up( Host Intents-Att Topo) |
| 2677 | """ |
| 2678 | main.log.report( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" ) |
| 2679 | main.log.report( "_________________________________________________" ) |
| 2680 | import itertools |
| 2681 | import time |
| 2682 | main.case( "IPv6 ping all with after core links back up( Host Intents-Att Topo )" ) |
| 2683 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2684 | pingResult = main.FALSE |
| 2685 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2686 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2687 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2688 | main.log.warn("First ping failed. Retrying...") |
| 2689 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2690 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2691 | time2 = time.time() |
| 2692 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2693 | main.log.report( |
| 2694 | "Time taken for IPv6 Ping All: " + |
| 2695 | str( timeDiff ) + |
| 2696 | " seconds" ) |
| 2697 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2698 | onpass="PING ALL PASS", |
| 2699 | onfail="PING ALL FAIL" ) |
| 2700 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2701 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2702 | utilities.assert_equals( |
| 2703 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2704 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2705 | onpass="IPv6 Ping across 300 host intents test PASS", |
| 2706 | onfail="IPv6 Ping across 300 host intents test FAIL" ) |
| 2707 | |
| 2708 | def CASE171( self ): |
| 2709 | """ |
| 2710 | IPv6 ping all with some core links down( Point Intents-Att Topo) |
| 2711 | """ |
| 2712 | main.log.report( "IPv6 ping all with some core links down( Point Intents-Att Topo )" ) |
| 2713 | main.log.report( "_________________________________________________" ) |
| 2714 | import itertools |
| 2715 | import time |
| 2716 | main.case( "IPv6 ping all with some core links down( Point Intents-Att Topo )" ) |
| 2717 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2718 | pingResult = main.FALSE |
| 2719 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2720 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2721 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2722 | main.log.warn("First ping failed. Retrying...") |
| 2723 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2724 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2725 | time2 = time.time() |
| 2726 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2727 | main.log.report( |
| 2728 | "Time taken for IPv6 Ping All: " + |
| 2729 | str( timeDiff ) + |
| 2730 | " seconds" ) |
| 2731 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2732 | onpass="PING ALL PASS", |
| 2733 | onfail="PING ALL FAIL" ) |
| 2734 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2735 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2736 | utilities.assert_equals( |
| 2737 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2738 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2739 | onpass="IPv6 Ping across 600 point intents test PASS", |
| 2740 | onfail="IPv6 Ping across 600 point intents test FAIL" ) |
| 2741 | |
| 2742 | def CASE181( self ): |
| 2743 | """ |
| 2744 | IPv6 ping all with after core links back up( Point Intents-Att Topo) |
| 2745 | """ |
| 2746 | main.log.report( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" ) |
| 2747 | main.log.report( "_________________________________________________" ) |
| 2748 | import itertools |
| 2749 | import time |
| 2750 | main.case( "IPv6 ping all with after core links back up( Point Intents-Att Topo )" ) |
| 2751 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2752 | pingResult = main.FALSE |
| 2753 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2754 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2755 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2756 | main.log.warn("First ping failed. Retrying...") |
| 2757 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2758 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2759 | time2 = time.time() |
| 2760 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2761 | main.log.report( |
| 2762 | "Time taken for IPv6 Ping All: " + |
| 2763 | str( timeDiff ) + |
| 2764 | " seconds" ) |
| 2765 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2766 | onpass="PING ALL PASS", |
| 2767 | onfail="PING ALL FAIL" ) |
| 2768 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2769 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2770 | utilities.assert_equals( |
| 2771 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2772 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2773 | onpass="IPv6 Ping across 600 Point intents test PASS", |
| 2774 | onfail="IPv6 Ping across 600 Point intents test FAIL" ) |
| 2775 | |
| 2776 | def CASE172( self ): |
| 2777 | """ |
| 2778 | IPv6 ping all with some core links down( Host Intents-Chordal Topo) |
| 2779 | """ |
| 2780 | main.log.report( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" ) |
| 2781 | main.log.report( "_________________________________________________" ) |
| 2782 | import itertools |
| 2783 | import time |
| 2784 | main.case( "IPv6 ping all with some core links down( Host Intents-Chordal Topo )" ) |
| 2785 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2786 | pingResult = main.FALSE |
| 2787 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2788 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2789 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2790 | main.log.warn("First ping failed. Retrying...") |
| 2791 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2792 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2793 | time2 = time.time() |
| 2794 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2795 | main.log.report( |
| 2796 | "Time taken for IPv6 Ping All: " + |
| 2797 | str( timeDiff ) + |
| 2798 | " seconds" ) |
| 2799 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2800 | onpass="PING ALL PASS", |
| 2801 | onfail="PING ALL FAIL" ) |
| 2802 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2803 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2804 | utilities.assert_equals( |
| 2805 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2806 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2807 | onpass="IPv6 Ping across 300 host intents test PASS", |
| 2808 | onfail="IPv6 Ping across 300 host intents test FAIL" ) |
| 2809 | |
| 2810 | def CASE182( self ): |
| 2811 | """ |
| 2812 | IPv6 ping all with after core links back up( Host Intents-Chordal Topo) |
| 2813 | """ |
| 2814 | main.log.report( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" ) |
| 2815 | main.log.report( "_________________________________________________" ) |
| 2816 | import itertools |
| 2817 | import time |
| 2818 | main.case( "IPv6 ping all with after core links back up( Host Intents-Chordal Topo )" ) |
| 2819 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2820 | pingResult = main.FALSE |
| 2821 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2822 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2823 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2824 | main.log.warn("First ping failed. Retrying...") |
| 2825 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2826 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2827 | time2 = time.time() |
| 2828 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2829 | main.log.report( |
| 2830 | "Time taken for IPv6 Ping All: " + |
| 2831 | str( timeDiff ) + |
| 2832 | " seconds" ) |
| 2833 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2834 | onpass="PING ALL PASS", |
| 2835 | onfail="PING ALL FAIL" ) |
| 2836 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2837 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2838 | utilities.assert_equals( |
| 2839 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2840 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2841 | onpass="IPv6 Ping across 300 host intents test PASS", |
| 2842 | onfail="IPv6 Ping across 300 host intents test FAIL" ) |
| 2843 | |
| 2844 | def CASE173( self ): |
| 2845 | """ |
| 2846 | IPv6 ping all with some core links down( Point Intents-Chordal Topo) |
| 2847 | """ |
| 2848 | main.log.report( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" ) |
| 2849 | main.log.report( "_________________________________________________" ) |
| 2850 | import itertools |
| 2851 | import time |
| 2852 | main.case( "IPv6 ping all with some core links down( Point Intents-Chordal Topo )" ) |
| 2853 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2854 | pingResult = main.FALSE |
| 2855 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2856 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2857 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2858 | main.log.warn("First ping failed. Retrying...") |
| 2859 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2860 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2861 | time2 = time.time() |
| 2862 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2863 | main.log.report( |
| 2864 | "Time taken for IPv6 Ping All: " + |
| 2865 | str( timeDiff ) + |
| 2866 | " seconds" ) |
| 2867 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2868 | onpass="PING ALL PASS", |
| 2869 | onfail="PING ALL FAIL" ) |
| 2870 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2871 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2872 | utilities.assert_equals( |
| 2873 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2874 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2875 | onpass="IPv6 Ping across 600 point intents test PASS", |
| 2876 | onfail="IPv6 Ping across 600 point intents test FAIL" ) |
| 2877 | |
| 2878 | def CASE183( self ): |
| 2879 | """ |
| 2880 | IPv6 ping all with after core links back up( Point Intents-Chordal Topo) |
| 2881 | """ |
| 2882 | main.log.report( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" ) |
| 2883 | main.log.report( "_________________________________________________" ) |
| 2884 | import itertools |
| 2885 | import time |
| 2886 | main.case( "IPv6 ping all with after core links back up( Point Intents-Chordal Topo )" ) |
| 2887 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2888 | pingResult = main.FALSE |
| 2889 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2890 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2891 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2892 | main.log.warn("First ping failed. Retrying...") |
| 2893 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2894 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2895 | time2 = time.time() |
| 2896 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2897 | main.log.report( |
| 2898 | "Time taken for IPv6 Ping All: " + |
| 2899 | str( timeDiff ) + |
| 2900 | " seconds" ) |
| 2901 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2902 | onpass="PING ALL PASS", |
| 2903 | onfail="PING ALL FAIL" ) |
| 2904 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2905 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2906 | utilities.assert_equals( |
| 2907 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2908 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2909 | onpass="IPv6 Ping across 600 Point intents test PASS", |
| 2910 | onfail="IPv6 Ping across 600 Point intents test FAIL" ) |
| 2911 | |
| 2912 | def CASE174( self ): |
| 2913 | """ |
| 2914 | IPv6 ping all with some core links down( Host Intents-Spine Topo) |
| 2915 | """ |
| 2916 | main.log.report( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" ) |
| 2917 | main.log.report( "_________________________________________________" ) |
| 2918 | import itertools |
| 2919 | import time |
| 2920 | main.case( "IPv6 ping all with some core links down( Host Intents-Spine Topo )" ) |
| 2921 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2922 | pingResult = main.FALSE |
| 2923 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2924 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2925 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2926 | main.log.warn("First ping failed. Retrying...") |
| 2927 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2928 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2929 | time2 = time.time() |
| 2930 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2931 | main.log.report( |
| 2932 | "Time taken for IPv6 Ping All: " + |
| 2933 | str( timeDiff ) + |
| 2934 | " seconds" ) |
| 2935 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2936 | onpass="PING ALL PASS", |
| 2937 | onfail="PING ALL FAIL" ) |
| 2938 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2939 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2940 | utilities.assert_equals( |
| 2941 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2942 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2943 | onpass="IPv6 Ping across 2278 host intents test PASS", |
| 2944 | onfail="IPv6 Ping across 2278 host intents test FAIL" ) |
| 2945 | |
| 2946 | def CASE184( self ): |
| 2947 | """ |
| 2948 | IPv6 ping all with after core links back up( Host Intents-Spine Topo) |
| 2949 | """ |
| 2950 | main.log.report( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" ) |
| 2951 | main.log.report( "_________________________________________________" ) |
| 2952 | import itertools |
| 2953 | import time |
| 2954 | main.case( "IPv6 ping all with after core links back up( Host Intents-Spine Topo )" ) |
| 2955 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2956 | pingResult = main.FALSE |
| 2957 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2958 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2959 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2960 | main.log.warn("First ping failed. Retrying...") |
| 2961 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2962 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2963 | time2 = time.time() |
| 2964 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2965 | main.log.report( |
| 2966 | "Time taken for IPv6 Ping All: " + |
| 2967 | str( timeDiff ) + |
| 2968 | " seconds" ) |
| 2969 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 2970 | onpass="PING ALL PASS", |
| 2971 | onfail="PING ALL FAIL" ) |
| 2972 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2973 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2974 | utilities.assert_equals( |
| 2975 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 2976 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2977 | onpass="IPv6 Ping across 2278 host intents test PASS", |
| 2978 | onfail="IPv6 Ping across 2278 host intents test FAIL" ) |
| 2979 | |
| 2980 | def CASE175( self ): |
| 2981 | """ |
| 2982 | IPv6 ping all with some core links down( Point Intents-Spine Topo) |
| 2983 | """ |
| 2984 | main.log.report( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" ) |
| 2985 | main.log.report( "_________________________________________________" ) |
| 2986 | import itertools |
| 2987 | import time |
| 2988 | main.case( "IPv6 ping all with some core links down( Point Intents-Spine Topo )" ) |
| 2989 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2990 | pingResult = main.FALSE |
| 2991 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2992 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 2993 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 2994 | main.log.warn("First ping failed. Retrying...") |
| 2995 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 2996 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 2997 | time2 = time.time() |
| 2998 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 2999 | main.log.report( |
| 3000 | "Time taken for IPv6 Ping All: " + |
| 3001 | str( timeDiff ) + |
| 3002 | " seconds" ) |
| 3003 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 3004 | onpass="PING ALL PASS", |
| 3005 | onfail="PING ALL FAIL" ) |
| 3006 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3007 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3008 | utilities.assert_equals( |
| 3009 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3010 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3011 | onpass="IPv6 Ping across 4556 point intents test PASS", |
| 3012 | onfail="IPv6 Ping across 4556 point intents test FAIL" ) |
| 3013 | |
| 3014 | def CASE185( self ): |
| 3015 | """ |
| 3016 | IPv6 ping all with after core links back up( Point Intents-Spine Topo) |
| 3017 | """ |
| 3018 | main.log.report( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" ) |
| 3019 | main.log.report( "_________________________________________________" ) |
| 3020 | import itertools |
| 3021 | import time |
| 3022 | main.case( "IPv6 ping all with after core links back up( Point Intents-Spine Topo )" ) |
| 3023 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3024 | pingResult = main.FALSE |
| 3025 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 3026 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 3027 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3028 | main.log.warn("First ping failed. Retrying...") |
| 3029 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 3030 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3031 | time2 = time.time() |
| 3032 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3033 | main.log.report( |
| 3034 | "Time taken for IPv6 Ping All: " + |
| 3035 | str( timeDiff ) + |
| 3036 | " seconds" ) |
| 3037 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 3038 | onpass="PING ALL PASS", |
| 3039 | onfail="PING ALL FAIL" ) |
| 3040 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3041 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3042 | utilities.assert_equals( |
| 3043 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3044 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3045 | onpass="IPv6 Ping across 4556 Point intents test PASS", |
| 3046 | onfail="IPv6 Ping across 4556 Point intents test FAIL" ) |
| 3047 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3048 | def CASE90( self ): |
| 3049 | """ |
| 3050 | Install 600 point intents and verify ping all (Att Topology) |
| 3051 | """ |
| 3052 | main.log.report( "Add 600 point intents and verify pingall (Att Topology)" ) |
| 3053 | main.log.report( "_______________________________________" ) |
| 3054 | import itertools |
| 3055 | import time |
| 3056 | main.case( "Install 600 point intents" ) |
| 3057 | main.step( "Add point Intents" ) |
| 3058 | intentResult = main.TRUE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3059 | deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) ) |
| 3060 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3061 | intentIdList = [] |
| 3062 | time1 = time.time() |
| 3063 | for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ): |
| 3064 | pool = [] |
| 3065 | for cli in main.CLIs: |
| 3066 | if i >= len( deviceCombos ): |
| 3067 | break |
| 3068 | t = main.Thread( target=cli.addPointIntent, |
| 3069 | threadID=main.threadID, |
| 3070 | name="addPointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3071 | args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3072 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3073 | t.start() |
| 3074 | i = i + 1 |
| 3075 | main.threadID = main.threadID + 1 |
| 3076 | for thread in pool: |
| 3077 | thread.join() |
| 3078 | intentIdList.append(thread.result) |
| 3079 | time2 = time.time() |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 3080 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3081 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 3082 | # Saving intent ids to check intents in later case |
| 3083 | main.intentIds = list(intentIdList) |
| 3084 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3085 | main.step("Verify intents are installed") |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3086 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3087 | # Giving onos multiple chances to install intents |
| 3088 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3089 | if i != 0: |
| 3090 | main.log.warn( "Verification failed. Retrying..." ) |
| 3091 | main.log.info("Waiting for onos to install intents...") |
| 3092 | time.sleep( main.checkIntentsDelay ) |
| 3093 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3094 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3095 | for e in range(int(main.numCtrls)): |
| 3096 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3097 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3098 | intentState |
| 3099 | if not intentState: |
| 3100 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3101 | if intentState: |
| 3102 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3103 | else: |
| 3104 | #Dumping intent summary |
| 3105 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3106 | |
| 3107 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3108 | onpass="INTENTS INSTALLED", |
| 3109 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3110 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3111 | main.step( "Verify Ping across all hosts" ) |
| 3112 | pingResult = main.FALSE |
| 3113 | time1 = time.time() |
| 3114 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5) |
| 3115 | time2 = time.time() |
| 3116 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3117 | main.log.report( |
| 3118 | "Time taken for Ping All: " + |
| 3119 | str( timeDiff ) + |
| 3120 | " seconds" ) |
| 3121 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 3122 | onpass="PING tALL PASS", |
| 3123 | onfail="PING ALL FAIL" ) |
| 3124 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3125 | caseResult = ( intentState and pingResult ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3126 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3127 | utilities.assert_equals( |
| 3128 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3129 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3130 | onpass="Install 600 point Intents and Ping All test PASS", |
| 3131 | onfail="Install 600 point Intents and Ping All test FAIL" ) |
| 3132 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3133 | if not intentState: |
| 3134 | main.log.debug( "Intents failed to install completely" ) |
| 3135 | if not pingResult: |
| 3136 | main.log.debug( "Pingall failed" ) |
| 3137 | |
| 3138 | if not caseResult and main.failSwitch: |
| 3139 | main.log.report("Stopping test") |
| 3140 | main.stop( email=main.emailOnStop ) |
| 3141 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3142 | def CASE91( self ): |
| 3143 | """ |
| 3144 | Install 600 point intents and verify ping all (Chordal Topology) |
| 3145 | """ |
| 3146 | main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" ) |
| 3147 | main.log.report( "_______________________________________" ) |
| 3148 | import itertools |
| 3149 | import time |
| 3150 | main.case( "Install 600 point intents" ) |
| 3151 | main.step( "Add point Intents" ) |
| 3152 | intentResult = main.TRUE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3153 | deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) ) |
| 3154 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3155 | intentIdList = [] |
| 3156 | time1 = time.time() |
| 3157 | for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ): |
| 3158 | pool = [] |
| 3159 | for cli in main.CLIs: |
| 3160 | if i >= len( deviceCombos ): |
| 3161 | break |
| 3162 | t = main.Thread( target=cli.addPointIntent, |
| 3163 | threadID=main.threadID, |
| 3164 | name="addPointIntent", |
Hari Krishna | 55b171b | 2015-09-02 09:46:03 -0700 | [diff] [blame] | 3165 | args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3166 | pool.append(t) |
| 3167 | #time.sleep(1) |
| 3168 | t.start() |
| 3169 | i = i + 1 |
| 3170 | main.threadID = main.threadID + 1 |
| 3171 | for thread in pool: |
| 3172 | thread.join() |
| 3173 | intentIdList.append(thread.result) |
| 3174 | time2 = time.time() |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 3175 | main.log.info( "Time for adding point intents: %2f seconds" %(time2-time1) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3176 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 3177 | # Saving intent ids to check intents in later case |
| 3178 | main.intentIds = list(intentIdList) |
| 3179 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3180 | main.step("Verify intents are installed") |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3181 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3182 | # Giving onos multiple chances to install intents |
| 3183 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3184 | if i != 0: |
| 3185 | main.log.warn( "Verification failed. Retrying..." ) |
| 3186 | main.log.info("Waiting for onos to install intents...") |
| 3187 | time.sleep( main.checkIntentsDelay ) |
| 3188 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3189 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3190 | for e in range(int(main.numCtrls)): |
| 3191 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3192 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3193 | intentState |
| 3194 | if not intentState: |
| 3195 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3196 | if intentState: |
| 3197 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3198 | else: |
| 3199 | #Dumping intent summary |
| 3200 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3201 | |
| 3202 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3203 | onpass="INTENTS INSTALLED", |
| 3204 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3205 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3206 | main.step( "Verify Ping across all hosts" ) |
| 3207 | pingResult = main.FALSE |
| 3208 | time1 = time.time() |
| 3209 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5) |
| 3210 | time2 = time.time() |
| 3211 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3212 | main.log.report( |
| 3213 | "Time taken for Ping All: " + |
| 3214 | str( timeDiff ) + |
| 3215 | " seconds" ) |
| 3216 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 3217 | onpass="PING ALL PASS", |
| 3218 | onfail="PING ALL FAIL" ) |
| 3219 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3220 | caseResult = ( intentState and pingResult ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3221 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3222 | utilities.assert_equals( |
| 3223 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3224 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3225 | onpass="Install 600 point Intents and Ping All test PASS", |
| 3226 | onfail="Install 600 point Intents and Ping All test FAIL" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3227 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3228 | if not intentState: |
| 3229 | main.log.debug( "Intents failed to install completely" ) |
| 3230 | if not pingResult: |
| 3231 | main.log.debug( "Pingall failed" ) |
| 3232 | |
| 3233 | if not caseResult and main.failSwitch: |
| 3234 | main.log.report("Stopping test") |
| 3235 | main.stop( email=main.emailOnStop ) |
| 3236 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3237 | def CASE92( self ): |
| 3238 | """ |
| 3239 | Install 4556 point intents and verify ping all (Spine Topology) |
| 3240 | """ |
| 3241 | main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" ) |
| 3242 | main.log.report( "_______________________________________" ) |
| 3243 | import itertools |
| 3244 | import time |
| 3245 | main.case( "Install 4556 point intents" ) |
| 3246 | main.step( "Add point Intents" ) |
| 3247 | intentResult = main.TRUE |
| 3248 | main.pingTimeout = 600 |
| 3249 | for i in range(len(main.hostMACs)): |
| 3250 | main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0] |
| 3251 | print main.MACsDict |
| 3252 | deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) ) |
| 3253 | intentIdList = [] |
| 3254 | time1 = time.time() |
| 3255 | for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ): |
| 3256 | pool = [] |
| 3257 | for cli in main.CLIs: |
| 3258 | if i >= len( deviceCombos ): |
| 3259 | break |
| 3260 | t = main.Thread( target=cli.addPointIntent, |
| 3261 | threadID=main.threadID, |
| 3262 | name="addPointIntent", |
Hari Krishna | 55b171b | 2015-09-02 09:46:03 -0700 | [diff] [blame] | 3263 | args=[deviceCombos[i][0],deviceCombos[i][1],1,1,'',main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3264 | pool.append(t) |
| 3265 | #time.sleep(1) |
| 3266 | t.start() |
| 3267 | i = i + 1 |
| 3268 | main.threadID = main.threadID + 1 |
| 3269 | for thread in pool: |
| 3270 | thread.join() |
| 3271 | intentIdList.append(thread.result) |
| 3272 | time2 = time.time() |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 3273 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3274 | |
GlennRC | fcfdc4f | 2015-09-30 16:01:57 -0700 | [diff] [blame] | 3275 | # Saving intent ids to check intents in later case |
| 3276 | main.intentIds = list(intentIdList) |
| 3277 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3278 | main.step("Verify intents are installed") |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3279 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3280 | # Giving onos multiple chances to install intents |
| 3281 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3282 | if i != 0: |
| 3283 | main.log.warn( "Verification failed. Retrying..." ) |
| 3284 | main.log.info("Waiting for onos to install intents...") |
| 3285 | time.sleep( main.checkIntentsDelay ) |
| 3286 | |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3287 | intentState = main.TRUE |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3288 | for e in range(int(main.numCtrls)): |
| 3289 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3290 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3291 | intentState |
| 3292 | if not intentState: |
| 3293 | main.log.warn( "Not all intents installed" ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3294 | if intentState: |
| 3295 | break |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3296 | else: |
| 3297 | #Dumping intent summary |
| 3298 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 3299 | |
| 3300 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3301 | onpass="INTENTS INSTALLED", |
| 3302 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3303 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3304 | main.step( "Verify Ping across all hosts" ) |
| 3305 | pingResult = main.FALSE |
| 3306 | time1 = time.time() |
| 3307 | pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5) |
| 3308 | time2 = time.time() |
| 3309 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3310 | main.log.report( |
| 3311 | "Time taken for Ping All: " + |
| 3312 | str( timeDiff ) + |
| 3313 | " seconds" ) |
| 3314 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 3315 | onpass="PING ALL PASS", |
| 3316 | onfail="PING ALL FAIL" ) |
| 3317 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3318 | caseResult = ( intentState and pingResult ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3319 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3320 | utilities.assert_equals( |
| 3321 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3322 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3323 | onpass="Install 4556 point Intents and Ping All test PASS", |
| 3324 | onfail="Install 4556 point Intents and Ping All test FAIL" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3325 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3326 | if not intentState: |
| 3327 | main.log.debug( "Intents failed to install completely" ) |
| 3328 | if not pingResult: |
| 3329 | main.log.debug( "Pingall failed" ) |
| 3330 | |
| 3331 | if not caseResult and main.failSwitch: |
| 3332 | main.log.report("Stopping test") |
| 3333 | main.stop( email=main.emailOnStop ) |
| 3334 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3335 | def CASE93( self ): |
| 3336 | """ |
| 3337 | Install multi-single point intents and verify Ping all works |
| 3338 | for att topology |
| 3339 | """ |
| 3340 | import copy |
| 3341 | import time |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3342 | from collections import Counter |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3343 | main.log.report( "Install multi-single point intents and verify Ping all" ) |
| 3344 | main.log.report( "___________________________________________" ) |
| 3345 | main.case( "Install multi-single point intents and Ping all" ) |
| 3346 | deviceDPIDsCopy = copy.copy(main.deviceDPIDs) |
| 3347 | portIngressList = ['1']*(len(deviceDPIDsCopy) - 1) |
| 3348 | intentIdList = [] |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3349 | main.log.info( "MACsDict" + str(main.MACsDict) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3350 | time1 = time.time() |
| 3351 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3352 | pool = [] |
| 3353 | for cli in main.CLIs: |
| 3354 | egressDevice = deviceDPIDsCopy[i] |
| 3355 | ingressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3356 | ingressDeviceList.remove(egressDevice) |
| 3357 | if i >= len( deviceDPIDsCopy ): |
| 3358 | break |
| 3359 | t = main.Thread( target=cli.addMultipointToSinglepointIntent, |
| 3360 | threadID=main.threadID, |
| 3361 | name="addMultipointToSinglepointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3362 | args =[ingressDeviceList,egressDevice,portIngressList,'1','','',main.MACsDict.get(egressDevice)]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3363 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3364 | t.start() |
| 3365 | i = i + 1 |
| 3366 | main.threadID = main.threadID + 1 |
| 3367 | for thread in pool: |
| 3368 | thread.join() |
| 3369 | intentIdList.append(thread.result) |
| 3370 | time2 = time.time() |
| 3371 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3372 | |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3373 | main.step("Verify intents are installed") |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3374 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3375 | # Giving onos multiple chances to install intents |
| 3376 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3377 | if i != 0: |
| 3378 | main.log.warn( "Verification failed. Retrying..." ) |
| 3379 | main.log.info("Waiting for onos to install intents...") |
| 3380 | time.sleep( main.checkIntentsDelay ) |
| 3381 | |
| 3382 | intentState = main.TRUE |
| 3383 | for e in range(int(main.numCtrls)): |
| 3384 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3385 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3386 | intentState |
| 3387 | if not intentState: |
| 3388 | main.log.warn( "Not all intents installed" ) |
| 3389 | if intentState: |
| 3390 | break |
| 3391 | else: |
| 3392 | #Dumping intent summary |
| 3393 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3394 | |
| 3395 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3396 | onpass="INTENTS INSTALLED", |
| 3397 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3398 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3399 | main.step("Verify flows are all added") |
| 3400 | |
| 3401 | for i in range( main.flowCheck ): |
| 3402 | if i != 0: |
| 3403 | main.log.warn( "verification failed. Retrying..." ) |
| 3404 | main.log.info( "Waiting for onos to add flows..." ) |
| 3405 | time.sleep( main.checkFlowsDelay ) |
| 3406 | |
| 3407 | flowState = main.TRUE |
| 3408 | for cli in main.CLIs: |
| 3409 | flowState = cli.checkFlowState() |
| 3410 | if not flowState: |
| 3411 | main.log.warn( "Not all flows added" ) |
| 3412 | if flowState: |
| 3413 | break |
| 3414 | else: |
| 3415 | #Dumping summary |
| 3416 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 3417 | |
| 3418 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 3419 | onpass="FLOWS INSTALLED", |
| 3420 | onfail="SOME FLOWS NOT ADDED" ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3421 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3422 | main.step( "Verify Ping across all hosts" ) |
| 3423 | pingResult = main.FALSE |
| 3424 | time1 = time.time() |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3425 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3426 | if not pingResult: |
| 3427 | time1 = time.time() |
| 3428 | main.log.warn("First pingall failed. Retrying") |
| 3429 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3430 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3431 | time2 = time.time() |
| 3432 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3433 | main.log.report( |
| 3434 | "Time taken for Ping All: " + |
| 3435 | str( timeDiff ) + |
| 3436 | " seconds" ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3437 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3438 | caseResult = ( checkFlowsState and pingResult and intentState ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3439 | utilities.assert_equals( |
| 3440 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3441 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3442 | onpass="Install 25 multi to single point Intents and Ping All test PASS", |
| 3443 | onfail="Install 25 multi to single point Intents and Ping All test FAIL" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3444 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3445 | if not intentState: |
| 3446 | main.log.debug( "Intents failed to install completely" ) |
| 3447 | if not pingResult: |
| 3448 | main.log.debug( "Pingall failed" ) |
| 3449 | if not checkFlowsState: |
| 3450 | main.log.debug( "Flows failed to add completely" ) |
| 3451 | |
| 3452 | if not caseResult and main.failSwitch: |
| 3453 | main.log.report("Stopping test") |
| 3454 | main.stop( email=main.emailOnStop ) |
| 3455 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3456 | def CASE94( self ): |
| 3457 | """ |
| 3458 | Install multi-single point intents and verify Ping all works |
| 3459 | for Chordal topology |
| 3460 | """ |
| 3461 | import copy |
| 3462 | import time |
| 3463 | main.log.report( "Install multi-single point intents and verify Ping all" ) |
| 3464 | main.log.report( "___________________________________________" ) |
| 3465 | main.case( "Install multi-single point intents and Ping all" ) |
| 3466 | deviceDPIDsCopy = copy.copy(main.deviceDPIDs) |
| 3467 | portIngressList = ['1']*(len(deviceDPIDsCopy) - 1) |
| 3468 | intentIdList = [] |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3469 | main.log.info( "MACsDict" + str(main.MACsDict) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3470 | time1 = time.time() |
| 3471 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3472 | pool = [] |
| 3473 | for cli in main.CLIs: |
| 3474 | egressDevice = deviceDPIDsCopy[i] |
| 3475 | ingressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3476 | ingressDeviceList.remove(egressDevice) |
| 3477 | if i >= len( deviceDPIDsCopy ): |
| 3478 | break |
| 3479 | t = main.Thread( target=cli.addMultipointToSinglepointIntent, |
| 3480 | threadID=main.threadID, |
| 3481 | name="addMultipointToSinglepointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3482 | args =[ingressDeviceList,egressDevice,portIngressList,'1','','',main.MACsDict.get(egressDevice)]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3483 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3484 | t.start() |
| 3485 | i = i + 1 |
| 3486 | main.threadID = main.threadID + 1 |
| 3487 | for thread in pool: |
| 3488 | thread.join() |
| 3489 | intentIdList.append(thread.result) |
| 3490 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3491 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3492 | |
| 3493 | main.step("Verify intents are installed") |
| 3494 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3495 | # Giving onos multiple chances to install intents |
| 3496 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3497 | if i != 0: |
| 3498 | main.log.warn( "Verification failed. Retrying..." ) |
| 3499 | main.log.info("Waiting for onos to install intents...") |
| 3500 | time.sleep( main.checkIntentsDelay ) |
| 3501 | |
| 3502 | intentState = main.TRUE |
| 3503 | for e in range(int(main.numCtrls)): |
| 3504 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3505 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3506 | intentState |
| 3507 | if not intentState: |
| 3508 | main.log.warn( "Not all intents installed" ) |
| 3509 | if intentState: |
| 3510 | break |
| 3511 | else: |
| 3512 | #Dumping intent summary |
| 3513 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3514 | |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3515 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3516 | onpass="INTENTS INSTALLED", |
| 3517 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3518 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3519 | main.step("Verify flows are all added") |
| 3520 | |
| 3521 | for i in range( main.flowCheck ): |
| 3522 | if i != 0: |
| 3523 | main.log.warn( "verification failed. Retrying..." ) |
| 3524 | main.log.info( "Waiting for onos to add flows..." ) |
| 3525 | time.sleep( main.checkFlowsDelay ) |
| 3526 | |
| 3527 | flowState = main.TRUE |
| 3528 | for cli in main.CLIs: |
| 3529 | flowState = cli.checkFlowState() |
| 3530 | if not flowState: |
| 3531 | main.log.warn( "Not all flows added" ) |
| 3532 | if flowState: |
| 3533 | break |
| 3534 | else: |
| 3535 | #Dumping summary |
| 3536 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 3537 | |
| 3538 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 3539 | onpass="FLOWS INSTALLED", |
| 3540 | onfail="SOME FLOWS NOT ADDED" ) |
| 3541 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3542 | main.step( "Verify Ping across all hosts" ) |
| 3543 | pingResult = main.FALSE |
| 3544 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3545 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3546 | if not pingResult: |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3547 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3548 | main.log.warn("First pingall failed. Retrying") |
| 3549 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3550 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3551 | time2 = time.time() |
| 3552 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3553 | main.log.report( |
| 3554 | "Time taken for Ping All: " + |
| 3555 | str( timeDiff ) + |
| 3556 | " seconds" ) |
| 3557 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3558 | caseResult = ( checkFlowsState and pingResult and intentState ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3559 | utilities.assert_equals( |
| 3560 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3561 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3562 | onpass="Install 25 multi to single point Intents and Ping All test PASS", |
| 3563 | onfail="Install 25 multi to single point Intents and Ping All test FAIL" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3564 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3565 | if not intentState: |
| 3566 | main.log.debug( "Intents failed to install completely" ) |
| 3567 | if not pingResult: |
| 3568 | main.log.debug( "Pingall failed" ) |
| 3569 | if not checkFlowsState: |
| 3570 | main.log.debug( "Flows failed to add completely" ) |
| 3571 | |
| 3572 | if not caseResult and main.failSwitch: |
| 3573 | main.log.report("Stopping test") |
| 3574 | main.stop( email=main.emailOnStop ) |
| 3575 | |
| 3576 | def CASE95( self ): |
| 3577 | """ |
| 3578 | Install multi-single point intents and verify Ping all works |
| 3579 | for Spine topology |
| 3580 | """ |
| 3581 | import copy |
| 3582 | import time |
| 3583 | main.log.report( "Install multi-single point intents and verify Ping all" ) |
| 3584 | main.log.report( "___________________________________________" ) |
| 3585 | main.case( "Install multi-single point intents and Ping all" ) |
| 3586 | deviceDPIDsCopy = copy.copy(main.deviceDPIDs) |
| 3587 | portIngressList = ['1']*(len(deviceDPIDsCopy) - 1) |
| 3588 | intentIdList = [] |
| 3589 | main.log.info( "MACsDict" + str(main.MACsDict) ) |
| 3590 | time1 = time.time() |
| 3591 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3592 | pool = [] |
| 3593 | for cli in main.CLIs: |
| 3594 | egressDevice = deviceDPIDsCopy[i] |
| 3595 | ingressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3596 | ingressDeviceList.remove(egressDevice) |
| 3597 | if i >= len( deviceDPIDsCopy ): |
| 3598 | break |
| 3599 | t = main.Thread( target=cli.addMultipointToSinglepointIntent, |
| 3600 | threadID=main.threadID, |
| 3601 | name="addMultipointToSinglepointIntent", |
| 3602 | args =[ingressDeviceList,egressDevice,portIngressList,'1','','',main.MACsDict.get(egressDevice)]) |
| 3603 | pool.append(t) |
| 3604 | t.start() |
| 3605 | i = i + 1 |
| 3606 | main.threadID = main.threadID + 1 |
| 3607 | for thread in pool: |
| 3608 | thread.join() |
| 3609 | intentIdList.append(thread.result) |
| 3610 | time2 = time.time() |
| 3611 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
| 3612 | |
| 3613 | main.step("Verify intents are installed") |
| 3614 | |
| 3615 | # Giving onos multiple chances to install intents |
| 3616 | for i in range( main.intentCheck ): |
| 3617 | if i != 0: |
| 3618 | main.log.warn( "Verification failed. Retrying..." ) |
| 3619 | main.log.info("Waiting for onos to install intents...") |
| 3620 | time.sleep( main.checkIntentsDelay ) |
| 3621 | |
| 3622 | intentState = main.TRUE |
| 3623 | for e in range(int(main.numCtrls)): |
| 3624 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3625 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3626 | intentState |
| 3627 | if not intentState: |
| 3628 | main.log.warn( "Not all intents installed" ) |
| 3629 | if intentState: |
| 3630 | break |
| 3631 | else: |
| 3632 | #Dumping intent summary |
| 3633 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3634 | |
| 3635 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3636 | onpass="INTENTS INSTALLED", |
| 3637 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3638 | |
| 3639 | main.step("Verify flows are all added") |
| 3640 | |
| 3641 | for i in range( main.flowCheck ): |
| 3642 | if i != 0: |
| 3643 | main.log.warn( "verification failed. Retrying..." ) |
| 3644 | main.log.info( "Waiting for onos to add flows..." ) |
| 3645 | time.sleep( main.checkFlowsDelay ) |
| 3646 | |
| 3647 | flowState = main.TRUE |
| 3648 | for cli in main.CLIs: |
| 3649 | flowState = cli.checkFlowState() |
| 3650 | if not flowState: |
| 3651 | main.log.warn( "Not all flows added" ) |
| 3652 | if flowState: |
| 3653 | break |
| 3654 | else: |
| 3655 | #Dumping summary |
| 3656 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 3657 | |
| 3658 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 3659 | onpass="FLOWS INSTALLED", |
| 3660 | onfail="SOME FLOWS NOT ADDED" ) |
| 3661 | |
| 3662 | main.step( "Verify Ping across all hosts" ) |
| 3663 | pingResult = main.FALSE |
| 3664 | time1 = time.time() |
| 3665 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3666 | if not pingResult: |
| 3667 | time1 = time.time() |
| 3668 | main.log.warn("First pingall failed. Retrying") |
| 3669 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3670 | |
| 3671 | time2 = time.time() |
| 3672 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3673 | main.log.report( |
| 3674 | "Time taken for Ping All: " + |
| 3675 | str( timeDiff ) + |
| 3676 | " seconds" ) |
| 3677 | |
| 3678 | caseResult = ( checkFlowsState and pingResult and intentState ) |
| 3679 | utilities.assert_equals( |
| 3680 | expect=main.TRUE, |
| 3681 | actual=caseResult, |
| 3682 | onpass="Install 25 multi to single point Intents and Ping All test PASS", |
| 3683 | onfail="Install 25 multi to single point Intents and Ping All test FAIL" ) |
| 3684 | |
| 3685 | if not intentState: |
| 3686 | main.log.debug( "Intents failed to install completely" ) |
| 3687 | if not pingResult: |
| 3688 | main.log.debug( "Pingall failed" ) |
| 3689 | if not checkFlowsState: |
| 3690 | main.log.debug( "Flows failed to add completely" ) |
| 3691 | |
| 3692 | if not caseResult and main.failSwitch: |
| 3693 | main.log.report("Stopping test") |
| 3694 | main.stop( email=main.emailOnStop ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3695 | |
| 3696 | def CASE96( self ): |
| 3697 | """ |
| 3698 | Install single-multi point intents and verify Ping all works |
| 3699 | for att topology |
| 3700 | """ |
| 3701 | import copy |
| 3702 | main.log.report( "Install single-multi point intents and verify Ping all" ) |
| 3703 | main.log.report( "___________________________________________" ) |
| 3704 | main.case( "Install single-multi point intents and Ping all" ) |
| 3705 | deviceDPIDsCopy = copy.copy(main.deviceDPIDs) |
| 3706 | portEgressList = ['1']*(len(deviceDPIDsCopy) - 1) |
| 3707 | intentIdList = [] |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3708 | main.log.info( "MACsDict" + str(main.MACsDict) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3709 | time1 = time.time() |
| 3710 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3711 | pool = [] |
| 3712 | for cli in main.CLIs: |
| 3713 | ingressDevice = deviceDPIDsCopy[i] |
| 3714 | egressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3715 | egressDeviceList.remove(ingressDevice) |
| 3716 | if i >= len( deviceDPIDsCopy ): |
| 3717 | break |
| 3718 | t = main.Thread( target=cli.addSinglepointToMultipointIntent, |
| 3719 | threadID=main.threadID, |
| 3720 | name="addSinglepointToMultipointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3721 | args =[ingressDevice,egressDeviceList,'1',portEgressList,'',main.MACsDict.get(ingressDevice)]) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3722 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3723 | t.start() |
| 3724 | i = i + 1 |
| 3725 | main.threadID = main.threadID + 1 |
| 3726 | for thread in pool: |
| 3727 | thread.join() |
| 3728 | intentIdList.append(thread.result) |
| 3729 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3730 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3731 | |
| 3732 | main.step("Verify intents are installed") |
| 3733 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3734 | # Giving onos multiple chances to install intents |
| 3735 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3736 | if i != 0: |
| 3737 | main.log.warn( "Verification failed. Retrying..." ) |
| 3738 | main.log.info("Waiting for onos to install intents...") |
| 3739 | time.sleep( main.checkIntentsDelay ) |
| 3740 | |
| 3741 | intentState = main.TRUE |
| 3742 | for e in range(int(main.numCtrls)): |
| 3743 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3744 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3745 | intentState |
| 3746 | if not intentState: |
| 3747 | main.log.warn( "Not all intents installed" ) |
| 3748 | if intentState: |
| 3749 | break |
| 3750 | else: |
| 3751 | #Dumping intent summary |
| 3752 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3753 | |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3754 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3755 | onpass="INTENTS INSTALLED", |
| 3756 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3757 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3758 | main.step("Verify flows are all added") |
| 3759 | |
| 3760 | for i in range( main.flowCheck ): |
| 3761 | if i != 0: |
| 3762 | main.log.warn( "verification failed. Retrying..." ) |
| 3763 | main.log.info( "Waiting for onos to add flows..." ) |
| 3764 | time.sleep( main.checkFlowsDelay ) |
| 3765 | |
| 3766 | flowState = main.TRUE |
| 3767 | for cli in main.CLIs: |
| 3768 | flowState = cli.checkFlowState() |
| 3769 | if not flowState: |
| 3770 | main.log.warn( "Not all flows added" ) |
| 3771 | if flowState: |
| 3772 | break |
| 3773 | else: |
| 3774 | #Dumping summary |
| 3775 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 3776 | |
| 3777 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 3778 | onpass="FLOWS INSTALLED", |
| 3779 | onfail="SOME FLOWS NOT ADDED" ) |
| 3780 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3781 | main.step( "Verify Ping across all hosts" ) |
| 3782 | pingResult = main.FALSE |
| 3783 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3784 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3785 | if not pingResult: |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3786 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3787 | main.log.warn("First pingall failed. Retrying") |
| 3788 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3789 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3790 | time2 = time.time() |
| 3791 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3792 | main.log.report( |
| 3793 | "Time taken for Ping All: " + |
| 3794 | str( timeDiff ) + |
| 3795 | " seconds" ) |
| 3796 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3797 | caseResult = ( pingResult and intentState and flowState) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3798 | utilities.assert_equals( |
| 3799 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3800 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3801 | onpass="Install 25 single to multi point Intents and Ping All test PASS", |
| 3802 | onfail="Install 25 single to multi point Intents and Ping All test FAIL" ) |
| 3803 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3804 | if not intentState: |
| 3805 | main.log.debug( "Intents failed to install completely" ) |
| 3806 | if not pingResult: |
| 3807 | main.log.debug( "Pingall failed" ) |
| 3808 | if not checkFlowsState: |
| 3809 | main.log.debug( "Flows failed to add completely" ) |
| 3810 | |
| 3811 | if not caseResult and main.failSwitch: |
| 3812 | main.log.report("Stopping test") |
| 3813 | main.stop( email=main.emailOnStop ) |
| 3814 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3815 | def CASE97( self ): |
| 3816 | """ |
| 3817 | Install single-multi point intents and verify Ping all works |
| 3818 | for Chordal topology |
| 3819 | """ |
| 3820 | import copy |
| 3821 | main.log.report( "Install single-multi point intents and verify Ping all" ) |
| 3822 | main.log.report( "___________________________________________" ) |
| 3823 | main.case( "Install single-multi point intents and Ping all" ) |
| 3824 | deviceDPIDsCopy = copy.copy(main.deviceDPIDs) |
| 3825 | portEgressList = ['1']*(len(deviceDPIDsCopy) - 1) |
| 3826 | intentIdList = [] |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3827 | main.log.info( "MACsDict" + str(main.MACsDict) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3828 | time1 = time.time() |
| 3829 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3830 | pool = [] |
| 3831 | for cli in main.CLIs: |
| 3832 | ingressDevice = deviceDPIDsCopy[i] |
| 3833 | egressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3834 | egressDeviceList.remove(ingressDevice) |
| 3835 | if i >= len( deviceDPIDsCopy ): |
| 3836 | break |
| 3837 | t = main.Thread( target=cli.addSinglepointToMultipointIntent, |
| 3838 | threadID=main.threadID, |
| 3839 | name="addSinglepointToMultipointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3840 | args =[ingressDevice,egressDeviceList,'1',portEgressList,'',main.MACsDict.get(ingressDevice),'']) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3841 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3842 | t.start() |
| 3843 | i = i + 1 |
| 3844 | main.threadID = main.threadID + 1 |
| 3845 | for thread in pool: |
| 3846 | thread.join() |
| 3847 | intentIdList.append(thread.result) |
| 3848 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3849 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3850 | |
| 3851 | main.step("Verify intents are installed") |
| 3852 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3853 | # Giving onos multiple chances to install intents |
| 3854 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3855 | if i != 0: |
| 3856 | main.log.warn( "Verification failed. Retrying..." ) |
| 3857 | main.log.info("Waiting for onos to install intents...") |
| 3858 | time.sleep( main.checkIntentsDelay ) |
| 3859 | |
| 3860 | intentState = main.TRUE |
| 3861 | for e in range(int(main.numCtrls)): |
| 3862 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3863 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3864 | intentState |
| 3865 | if not intentState: |
| 3866 | main.log.warn( "Not all intents installed" ) |
| 3867 | if intentState: |
| 3868 | break |
| 3869 | else: |
| 3870 | #Dumping intent summary |
| 3871 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3872 | |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3873 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3874 | onpass="INTENTS INSTALLED", |
| 3875 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 3876 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3877 | main.step("Verify flows are all added") |
| 3878 | |
| 3879 | for i in range( main.flowCheck ): |
| 3880 | if i != 0: |
| 3881 | main.log.warn( "verification failed. Retrying..." ) |
| 3882 | main.log.info( "Waiting for onos to add flows..." ) |
| 3883 | time.sleep( main.checkFlowsDelay ) |
| 3884 | |
| 3885 | flowState = main.TRUE |
| 3886 | for cli in main.CLIs: |
| 3887 | flowState = cli.checkFlowState() |
| 3888 | if not flowState: |
| 3889 | main.log.warn( "Not all flows added" ) |
| 3890 | if flowState: |
| 3891 | break |
| 3892 | else: |
| 3893 | #Dumping summary |
| 3894 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 3895 | |
| 3896 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 3897 | onpass="FLOWS INSTALLED", |
| 3898 | onfail="SOME FLOWS NOT ADDED" ) |
| 3899 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3900 | main.step( "Verify Ping across all hosts" ) |
| 3901 | pingResult = main.FALSE |
| 3902 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3903 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3904 | if not pingResult: |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3905 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3906 | main.log.warn("First pingall failed. Retrying") |
| 3907 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 3908 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3909 | time2 = time.time() |
| 3910 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 3911 | main.log.report( |
| 3912 | "Time taken for Ping All: " + |
| 3913 | str( timeDiff ) + |
| 3914 | " seconds" ) |
| 3915 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3916 | caseResult = ( pingResult and intentState and flowState) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3917 | utilities.assert_equals( |
| 3918 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 3919 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3920 | onpass="Install 25 single to multi point Intents and Ping All test PASS", |
| 3921 | onfail="Install 25 single to multi point Intents and Ping All test FAIL" ) |
| 3922 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3923 | if not intentState: |
| 3924 | main.log.debug( "Intents failed to install completely" ) |
| 3925 | if not pingResult: |
| 3926 | main.log.debug( "Pingall failed" ) |
| 3927 | if not checkFlowsState: |
| 3928 | main.log.debug( "Flows failed to add completely" ) |
| 3929 | |
| 3930 | if not caseResult and main.failSwitch: |
| 3931 | main.log.report("Stopping test") |
| 3932 | main.stop( email=main.emailOnStop ) |
| 3933 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3934 | def CASE98( self ): |
| 3935 | """ |
| 3936 | Install single-multi point intents and verify Ping all works |
| 3937 | for Spine topology |
| 3938 | """ |
| 3939 | import copy |
| 3940 | main.log.report( "Install single-multi point intents and verify Ping all" ) |
| 3941 | main.log.report( "___________________________________________" ) |
| 3942 | main.case( "Install single-multi point intents and Ping all" ) |
| 3943 | deviceDPIDsCopy = copy.copy( main.deviceDPIDs ) |
| 3944 | deviceDPIDsCopy = deviceDPIDsCopy[ 10: ] |
| 3945 | portEgressList = [ '1' ]*(len(deviceDPIDsCopy) - 1) |
| 3946 | intentIdList = [] |
| 3947 | MACsDictCopy = {} |
| 3948 | for i in range( len( deviceDPIDsCopy ) ): |
| 3949 | MACsDictCopy[ deviceDPIDsCopy[ i ] ] = main.hostMACs[i].split( '/' )[ 0 ] |
| 3950 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 3951 | main.log.info( "deviceDPIDsCopy" + str(deviceDPIDsCopy) ) |
| 3952 | main.log.info( "MACsDictCopy" + str(MACsDictCopy) ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3953 | time1 = time.time() |
| 3954 | for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)): |
| 3955 | pool = [] |
| 3956 | for cli in main.CLIs: |
| 3957 | if i >= len( deviceDPIDsCopy ): |
| 3958 | break |
| 3959 | ingressDevice = deviceDPIDsCopy[i] |
| 3960 | egressDeviceList = copy.copy(deviceDPIDsCopy) |
| 3961 | egressDeviceList.remove(ingressDevice) |
| 3962 | t = main.Thread( target=cli.addSinglepointToMultipointIntent, |
| 3963 | threadID=main.threadID, |
| 3964 | name="addSinglepointToMultipointIntent", |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 3965 | args =[ingressDevice,egressDeviceList,'1',portEgressList,'',MACsDictCopy.get(ingressDevice),'']) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3966 | pool.append(t) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 3967 | t.start() |
| 3968 | i = i + 1 |
| 3969 | main.threadID = main.threadID + 1 |
| 3970 | for thread in pool: |
| 3971 | thread.join() |
| 3972 | intentIdList.append(thread.result) |
| 3973 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 3974 | main.log.info("Time for adding point intents: %2f seconds" %(time2-time1)) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3975 | |
| 3976 | main.step("Verify intents are installed") |
| 3977 | |
GlennRC | 1dde171 | 2015-10-02 11:03:08 -0700 | [diff] [blame] | 3978 | # Giving onos multiple chances to install intents |
| 3979 | for i in range( main.intentCheck ): |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3980 | if i != 0: |
| 3981 | main.log.warn( "Verification failed. Retrying..." ) |
| 3982 | main.log.info("Waiting for onos to install intents...") |
| 3983 | time.sleep( main.checkIntentsDelay ) |
| 3984 | |
| 3985 | intentState = main.TRUE |
| 3986 | for e in range(int(main.numCtrls)): |
| 3987 | main.log.info( "Checking intents on CLI %s" % (e+1) ) |
| 3988 | intentState = main.CLIs[e].checkIntentState( intentsId = intentIdList ) and\ |
| 3989 | intentState |
| 3990 | if not intentState: |
| 3991 | main.log.warn( "Not all intents installed" ) |
| 3992 | if intentState: |
| 3993 | break |
| 3994 | else: |
| 3995 | #Dumping intent summary |
| 3996 | main.log.info( "Intents:\n" + str( main.ONOScli1.intents( jsonFormat=False, summary=True ) ) ) |
| 3997 | |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 3998 | utilities.assert_equals( expect=main.TRUE, actual=intentState, |
| 3999 | onpass="INTENTS INSTALLED", |
| 4000 | onfail="SOME INTENTS NOT INSTALLED" ) |
| 4001 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 4002 | main.step("Verify flows are all added") |
| 4003 | |
| 4004 | for i in range( main.flowCheck ): |
| 4005 | if i != 0: |
| 4006 | main.log.warn( "verification failed. Retrying..." ) |
| 4007 | main.log.info( "Waiting for onos to add flows..." ) |
| 4008 | time.sleep( main.checkFlowsDelay ) |
| 4009 | |
| 4010 | flowState = main.TRUE |
| 4011 | for cli in main.CLIs: |
| 4012 | flowState = cli.checkFlowState() |
| 4013 | if not flowState: |
| 4014 | main.log.warn( "Not all flows added" ) |
| 4015 | if flowState: |
| 4016 | break |
| 4017 | else: |
| 4018 | #Dumping summary |
| 4019 | main.log.info( "Summary:\n" + str( main.ONOScli1.summary(jsonFormat=False) ) ) |
| 4020 | |
| 4021 | utilities.assert_equals( expect=main.TRUE, actual=flowState, |
| 4022 | onpass="FLOWS INSTALLED", |
| 4023 | onfail="SOME FLOWS NOT ADDED" ) |
| 4024 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4025 | main.step( "Verify Ping across all hosts" ) |
| 4026 | pingResult = main.FALSE |
| 4027 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 4028 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 4029 | if not pingResult: |
GlennRC | db2c842 | 2015-09-29 12:21:59 -0700 | [diff] [blame] | 4030 | time1 = time.time() |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 4031 | main.log.warn("First pingall failed. Retrying") |
| 4032 | pingResult = main.Mininet1.pingall( timeout=main.pingTimeout ) |
| 4033 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4034 | time2 = time.time() |
| 4035 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 4036 | main.log.report( |
| 4037 | "Time taken for Ping All: " + |
| 4038 | str( timeDiff ) + |
| 4039 | " seconds" ) |
| 4040 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 4041 | caseResult = ( pingResult and intentState and flowState) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4042 | utilities.assert_equals( |
| 4043 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4044 | actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4045 | onpass="Install 25 single to multi point Intents and Ping All test PASS", |
| 4046 | onfail="Install 25 single to multi point Intents and Ping All test FAIL" ) |
| 4047 | |
GlennRC | fa69a2a | 2015-10-02 15:54:06 -0700 | [diff] [blame] | 4048 | if not intentState: |
| 4049 | main.log.debug( "Intents failed to install completely" ) |
| 4050 | if not pingResult: |
| 4051 | main.log.debug( "Pingall failed" ) |
| 4052 | if not checkFlowsState: |
| 4053 | main.log.debug( "Flows failed to add completely" ) |
| 4054 | |
| 4055 | if not caseResult and main.failSwitch: |
| 4056 | main.log.report("Stopping test") |
| 4057 | main.stop( email=main.emailOnStop ) |
| 4058 | |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4059 | def CASE190( self ): |
| 4060 | """ |
| 4061 | Verify IPv6 ping across 600 Point intents (Att Topology) |
| 4062 | """ |
| 4063 | main.log.report( "Verify IPv6 ping across 600 Point intents (Att Topology)" ) |
| 4064 | main.log.report( "_________________________________________________" ) |
| 4065 | import itertools |
| 4066 | import time |
| 4067 | main.case( "IPv6 ping all 600 Point intents" ) |
| 4068 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4069 | pingResult = main.FALSE |
| 4070 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4071 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 4072 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 4073 | main.log.warn("First pingall failed. Retrying...") |
| 4074 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4075 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4076 | time2 = time.time() |
| 4077 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 4078 | main.log.report( |
| 4079 | "Time taken for IPv6 Ping All: " + |
| 4080 | str( timeDiff ) + |
| 4081 | " seconds" ) |
| 4082 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 4083 | onpass="PING ALL PASS", |
| 4084 | onfail="PING ALL FAIL" ) |
| 4085 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4086 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4087 | utilities.assert_equals( |
| 4088 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4089 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4090 | onpass="IPv6 Ping across 600 Point intents test PASS", |
| 4091 | onfail="IPv6 Ping across 600 Point intents test FAIL" ) |
| 4092 | |
| 4093 | def CASE191( self ): |
| 4094 | """ |
| 4095 | Verify IPv6 ping across 600 Point intents (Chordal Topology) |
| 4096 | """ |
| 4097 | main.log.report( "Verify IPv6 ping across 600 Point intents (Chordal Topology)" ) |
| 4098 | main.log.report( "_________________________________________________" ) |
| 4099 | import itertools |
| 4100 | import time |
| 4101 | main.case( "IPv6 ping all 600 Point intents" ) |
| 4102 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4103 | pingResult = main.FALSE |
| 4104 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4105 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 4106 | if not pingResult: |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 4107 | main.log.warn("First pingall failed. Retrying...") |
| 4108 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4109 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4110 | time2 = time.time() |
| 4111 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 4112 | main.log.report( |
| 4113 | "Time taken for IPv6 Ping All: " + |
| 4114 | str( timeDiff ) + |
| 4115 | " seconds" ) |
| 4116 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 4117 | onpass="PING ALL PASS", |
| 4118 | onfail="PING ALL FAIL" ) |
| 4119 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4120 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4121 | utilities.assert_equals( |
| 4122 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4123 | actual=caseResult, |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4124 | onpass="IPv6 Ping across 600 Point intents test PASS", |
| 4125 | onfail="IPv6 Ping across 600 Point intents test FAIL" ) |
| 4126 | |
| 4127 | def CASE192( self ): |
| 4128 | """ |
| 4129 | Verify IPv6 ping across 4556 Point intents (Spine Topology) |
| 4130 | """ |
| 4131 | main.log.report( "Verify IPv6 ping across 4556 Point intents (Spine Topology)" ) |
| 4132 | main.log.report( "_________________________________________________" ) |
| 4133 | import itertools |
| 4134 | import time |
Hari Krishna | 310efca | 2015-09-03 09:43:16 -0700 | [diff] [blame] | 4135 | main.case( "IPv6 ping all 4556 Point intents" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4136 | main.step( "Verify IPv6 Ping across all hosts" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4137 | pingResult = main.FALSE |
| 4138 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4139 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
GlennRC | a8d786a | 2015-09-23 17:40:11 -0700 | [diff] [blame] | 4140 | if not pingResult: |
| 4141 | main.log.warn("First pingall failed. Retrying...") |
| 4142 | time1 = time.time() |
GlennRC | 4ae5a24 | 2015-10-02 11:37:56 -0700 | [diff] [blame] | 4143 | pingResult = main.Mininet1.pingall( protocol="IPv6", timeout=main.pingTimeout ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4144 | time2 = time.time() |
| 4145 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 4146 | main.log.report( |
| 4147 | "Time taken for IPv6 Ping All: " + |
| 4148 | str( timeDiff ) + |
| 4149 | " seconds" ) |
| 4150 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 4151 | onpass="PING ALL PASS", |
| 4152 | onfail="PING ALL FAIL" ) |
| 4153 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4154 | caseResult = pingResult |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4155 | utilities.assert_equals( |
| 4156 | expect=main.TRUE, |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4157 | actual=caseResult, |
Hari Krishna | 310efca | 2015-09-03 09:43:16 -0700 | [diff] [blame] | 4158 | onpass="IPv6 Ping across 4556 Point intents test PASS", |
| 4159 | onfail="IPv6 Ping across 4556 Point intents test FAIL" ) |
Hari Krishna | 4223dbd | 2015-08-13 16:29:53 -0700 | [diff] [blame] | 4160 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4161 | def CASE10( self ): |
| 4162 | import time |
GlennRC | c6cd2a6 | 2015-08-10 16:08:22 -0700 | [diff] [blame] | 4163 | import re |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4164 | """ |
| 4165 | Remove all Intents |
| 4166 | """ |
| 4167 | main.log.report( "Remove all intents that were installed previously" ) |
| 4168 | main.log.report( "______________________________________________" ) |
| 4169 | main.log.info( "Remove all intents" ) |
| 4170 | main.case( "Removing intents" ) |
Hari Krishna | ad0c520 | 2015-09-01 14:26:49 -0700 | [diff] [blame] | 4171 | purgeDelay = int( main.params[ "timers" ][ "IntentPurgeDelay" ] ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4172 | main.step( "Obtain the intent id's first" ) |
| 4173 | intentsList = main.ONOScli1.getAllIntentIds() |
| 4174 | ansi_escape = re.compile( r'\x1b[^m]*m' ) |
| 4175 | intentsList = ansi_escape.sub( '', intentsList ) |
| 4176 | intentsList = intentsList.replace( |
| 4177 | " onos:intents | grep id=", |
| 4178 | "" ).replace( |
| 4179 | "id=", |
| 4180 | "" ).replace( |
| 4181 | "\r\r", |
| 4182 | "" ) |
| 4183 | intentsList = intentsList.splitlines() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4184 | intentIdList = [] |
| 4185 | step1Result = main.TRUE |
| 4186 | moreIntents = main.TRUE |
| 4187 | removeIntentCount = 0 |
| 4188 | intentsCount = len(intentsList) |
| 4189 | main.log.info ( "Current number of intents: " + str(intentsCount) ) |
| 4190 | if ( len( intentsList ) > 1 ): |
| 4191 | results = main.TRUE |
| 4192 | main.log.info("Removing intent...") |
| 4193 | while moreIntents: |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 4194 | # This is a work around only: cycle through intents removal for up to 5 times. |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4195 | if removeIntentCount == 5: |
| 4196 | break |
| 4197 | removeIntentCount = removeIntentCount + 1 |
| 4198 | intentsList1 = main.ONOScli1.getAllIntentIds() |
| 4199 | if len( intentsList1 ) == 0: |
| 4200 | break |
| 4201 | ansi_escape = re.compile( r'\x1b[^m]*m' ) |
| 4202 | intentsList1 = ansi_escape.sub( '', intentsList1 ) |
| 4203 | intentsList1 = intentsList1.replace( |
| 4204 | " onos:intents | grep id=", |
| 4205 | "" ).replace( |
| 4206 | " state=", |
| 4207 | "" ).replace( |
| 4208 | "\r\r", |
| 4209 | "" ) |
| 4210 | intentsList1 = intentsList1.splitlines() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4211 | main.log.info ( "Round %d intents to remove: " %(removeIntentCount) ) |
| 4212 | print intentsList1 |
| 4213 | intentIdList1 = [] |
| 4214 | if ( len( intentsList1 ) > 0 ): |
| 4215 | moreIntents = main.TRUE |
| 4216 | for i in range( len( intentsList1 ) ): |
| 4217 | intentsTemp1 = intentsList1[ i ].split( ',' ) |
| 4218 | intentIdList1.append( intentsTemp1[ 0 ].split('=')[1] ) |
| 4219 | main.log.info ( "Leftover Intent IDs: " + str(intentIdList1) ) |
| 4220 | main.log.info ( "Length of Leftover Intents list: " + str(len(intentIdList1)) ) |
| 4221 | time1 = time.time() |
| 4222 | for i in xrange( 0, len( intentIdList1 ), int(main.numCtrls) ): |
| 4223 | pool = [] |
| 4224 | for cli in main.CLIs: |
| 4225 | if i >= len( intentIdList1 ): |
| 4226 | break |
| 4227 | t = main.Thread( target=cli.removeIntent, |
| 4228 | threadID=main.threadID, |
| 4229 | name="removeIntent", |
| 4230 | args=[intentIdList1[i],'org.onosproject.cli',False,False]) |
| 4231 | pool.append(t) |
| 4232 | t.start() |
| 4233 | i = i + 1 |
| 4234 | main.threadID = main.threadID + 1 |
| 4235 | for thread in pool: |
| 4236 | thread.join() |
| 4237 | intentIdList.append(thread.result) |
| 4238 | #time.sleep(2) |
| 4239 | time2 = time.time() |
| 4240 | main.log.info("Time for removing host intents: %2f seconds" %(time2-time1)) |
Hari Krishna | ad0c520 | 2015-09-01 14:26:49 -0700 | [diff] [blame] | 4241 | time.sleep( purgeDelay ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4242 | main.log.info("Purging WITHDRAWN Intents") |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 4243 | purgeResult = main.ONOScli1.purgeWithdrawnIntents() |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4244 | else: |
| 4245 | time.sleep(10) |
| 4246 | if len( main.ONOScli1.intents()): |
| 4247 | continue |
| 4248 | break |
Hari Krishna | ad0c520 | 2015-09-01 14:26:49 -0700 | [diff] [blame] | 4249 | time.sleep( purgeDelay ) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4250 | else: |
| 4251 | print "Removed %d intents" %(intentsCount) |
| 4252 | step1Result = main.TRUE |
| 4253 | else: |
| 4254 | print "No Intent IDs found in Intents list: ", intentsList |
| 4255 | step1Result = main.FALSE |
| 4256 | |
| 4257 | print main.ONOScli1.intents() |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4258 | caseResult = step1Result |
| 4259 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4260 | onpass="Intent removal test successful", |
| 4261 | onfail="Intent removal test failed" ) |
| 4262 | |
| 4263 | def CASE12( self, main ): |
| 4264 | """ |
| 4265 | Enable onos-app-ifwd, Verify Intent based Reactive forwarding through ping all and Disable it |
| 4266 | """ |
| 4267 | import re |
| 4268 | import copy |
| 4269 | import time |
| 4270 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4271 | threadID = 0 |
| 4272 | |
| 4273 | main.log.report( "Enable Intent based Reactive forwarding and Verify ping all" ) |
| 4274 | main.log.report( "_____________________________________________________" ) |
| 4275 | main.case( "Enable Intent based Reactive forwarding and Verify ping all" ) |
| 4276 | main.step( "Enable intent based Reactive forwarding" ) |
| 4277 | installResult = main.FALSE |
| 4278 | feature = "onos-app-ifwd" |
Hari Krishna | 6185fc1 | 2015-07-13 15:42:31 -0700 | [diff] [blame] | 4279 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4280 | pool = [] |
| 4281 | time1 = time.time() |
| 4282 | for cli,feature in main.CLIs: |
| 4283 | t = main.Thread(target=cli,threadID=threadID, |
| 4284 | name="featureInstall",args=[feature]) |
| 4285 | pool.append(t) |
| 4286 | t.start() |
| 4287 | threadID = threadID + 1 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4288 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4289 | results = [] |
| 4290 | for thread in pool: |
| 4291 | thread.join() |
| 4292 | results.append(thread.result) |
| 4293 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4294 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4295 | if( all(result == main.TRUE for result in results) == False): |
| 4296 | main.log.info("Did not install onos-app-ifwd feature properly") |
| 4297 | #main.cleanup() |
| 4298 | #main.exit() |
| 4299 | else: |
| 4300 | main.log.info("Successful feature:install onos-app-ifwd") |
| 4301 | installResult = main.TRUE |
| 4302 | main.log.info("Time for feature:install onos-app-ifwd: %2f seconds" %(time2-time1)) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4303 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4304 | main.step( "Verify Pingall" ) |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 4305 | pingResult = main.FALSE |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4306 | time1 = time.time() |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 4307 | pingResult = main.Mininet1.pingall(timeout=600) |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4308 | time2 = time.time() |
| 4309 | timeDiff = round( ( time2 - time1 ), 2 ) |
| 4310 | main.log.report( |
| 4311 | "Time taken for Ping All: " + |
| 4312 | str( timeDiff ) + |
| 4313 | " seconds" ) |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4314 | |
GlennRC | 626ba13 | 2015-09-18 16:16:31 -0700 | [diff] [blame] | 4315 | if pingResult == main.TRUE: |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4316 | main.log.report( "Pingall Test in Reactive mode successful" ) |
| 4317 | else: |
| 4318 | main.log.report( "Pingall Test in Reactive mode failed" ) |
| 4319 | |
| 4320 | main.step( "Disable Intent based Reactive forwarding" ) |
| 4321 | uninstallResult = main.FALSE |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4322 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4323 | pool = [] |
| 4324 | time1 = time.time() |
| 4325 | for cli,feature in main.CLIs: |
| 4326 | t = main.Thread(target=cli,threadID=threadID, |
| 4327 | name="featureUninstall",args=[feature]) |
| 4328 | pool.append(t) |
| 4329 | t.start() |
| 4330 | threadID = threadID + 1 |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4331 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4332 | results = [] |
| 4333 | for thread in pool: |
| 4334 | thread.join() |
| 4335 | results.append(thread.result) |
| 4336 | time2 = time.time() |
Jon Hall | 4ba53f0 | 2015-07-29 13:07:41 -0700 | [diff] [blame] | 4337 | |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4338 | if( all(result == main.TRUE for result in results) == False): |
| 4339 | main.log.info("Did not uninstall onos-app-ifwd feature properly") |
| 4340 | uninstallResult = main.FALSE |
| 4341 | #main.cleanup() |
| 4342 | #main.exit() |
| 4343 | else: |
| 4344 | main.log.info("Successful feature:uninstall onos-app-ifwd") |
| 4345 | uninstallResult = main.TRUE |
| 4346 | main.log.info("Time for feature:uninstall onos-app-ifwd: %2f seconds" %(time2-time1)) |
| 4347 | |
| 4348 | # Waiting for reative flows to be cleared. |
| 4349 | time.sleep( 10 ) |
| 4350 | |
GlennRC | bddd58f | 2015-10-01 15:45:25 -0700 | [diff] [blame] | 4351 | caseResult = installResult and pingResult and uninstallResult |
| 4352 | utilities.assert_equals( expect=main.TRUE, actual=caseResult, |
Hari Krishna | c195f3b | 2015-07-08 20:02:24 -0700 | [diff] [blame] | 4353 | onpass="Intent based Reactive forwarding Pingall test PASS", |
| 4354 | onfail="Intent based Reactive forwarding Pingall test FAIL" ) |