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