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