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