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