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