Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 1 | """ |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 2 | Copyright 2016 Open Networking Foundation ( ONF ) |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 3 | |
| 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
| 8 | TestON is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 2 of the License, or |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 11 | ( at your option ) any later version. |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 12 | |
| 13 | TestON is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | """ |
Jeremy Ronquillo | b27ce4c | 2017-07-17 12:41:28 -0700 | [diff] [blame] | 21 | """ |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 22 | Description: This test is to determine if ONOS can handle |
| 23 | dynamic swapping of cluster nodes. |
| 24 | |
| 25 | List of test cases: |
| 26 | CASE1: Compile ONOS and push it to the test machines |
| 27 | CASE2: Assign devices to controllers |
| 28 | CASE21: Assign mastership to controllers |
| 29 | CASE3: Assign intents |
| 30 | CASE4: Ping across added host intents |
| 31 | CASE5: Reading state of ONOS |
| 32 | CASE6: Swap nodes |
| 33 | CASE7: Check state after control plane failure |
| 34 | CASE8: Compare topo |
| 35 | CASE9: Link s3-s28 down |
| 36 | CASE10: Link s3-s28 up |
| 37 | CASE11: Switch down |
| 38 | CASE12: Switch up |
| 39 | CASE13: Clean up |
| 40 | CASE14: start election app on all onos nodes |
| 41 | CASE15: Check that Leadership Election is still functional |
| 42 | CASE16: Install Distributed Primitives app |
| 43 | CASE17: Check for basic functionality with distributed primitives |
| 44 | """ |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 45 | class HAswapNodes: |
| 46 | |
| 47 | def __init__( self ): |
| 48 | self.default = '' |
| 49 | |
| 50 | def CASE1( self, main ): |
| 51 | """ |
| 52 | CASE1 is to compile ONOS and push it to the test machines |
| 53 | |
| 54 | Startup sequence: |
| 55 | cell <name> |
| 56 | onos-verify-cell |
| 57 | NOTE: temporary - onos-remove-raft-logs |
| 58 | onos-uninstall |
| 59 | start mininet |
| 60 | git pull |
| 61 | mvn clean install |
| 62 | onos-package |
| 63 | onos-install -f |
| 64 | onos-wait-for-start |
| 65 | start cli sessions |
| 66 | start tcpdump |
| 67 | """ |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 68 | main.log.info( "ONOS HA test: Restart all ONOS nodes - " + |
| 69 | "initialization" ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 70 | # set global variables |
| 71 | # These are for csv plotting in jenkins |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 72 | main.HAlabels = [] |
| 73 | main.HAdata = [] |
| 74 | try: |
| 75 | from tests.dependencies.ONOSSetup import ONOSSetup |
| 76 | main.testSetUp = ONOSSetup() |
| 77 | except ImportError: |
| 78 | main.log.error( "ONOSSetup not found. exiting the test" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 79 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 80 | main.testSetUp.envSetupDescription() |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 81 | try: |
| 82 | from tests.HA.dependencies.HA import HA |
| 83 | main.HA = HA() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 84 | # load some variables from the params file |
| 85 | cellName = main.params[ 'ENV' ][ 'cellName' ] |
| 86 | main.apps = main.params[ 'ENV' ][ 'appString' ] |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 87 | stepResult = main.testSetUp.envSetup( includeCaseDesc=False ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 88 | except Exception as e: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 89 | main.testSetUp.envSetupException( e ) |
Jon Hall | aa1d9b8 | 2020-07-30 13:49:42 -0700 | [diff] [blame] | 90 | main.testSetUp.envSetupConclusion( stepResult ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 91 | |
Jon Hall | 5a5c843 | 2018-11-28 11:39:57 -0800 | [diff] [blame] | 92 | applyFuncs = [ main.HA.removeKarafConsoleLogging, main.HA.swapNodeMetadata ] |
| 93 | applyArgs = [ None, None ] |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 94 | try: |
| 95 | if main.params[ 'topology' ][ 'topoFile' ]: |
| 96 | main.log.info( 'Skipping start of Mininet in this case, make sure you start it elsewhere' ) |
| 97 | else: |
| 98 | applyFuncs.append( main.HA.startingMininet ) |
| 99 | applyArgs.append( None ) |
| 100 | except (KeyError, IndexError): |
| 101 | applyFuncs.append( main.HA.startingMininet ) |
| 102 | applyArgs.append( None ) |
| 103 | |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 104 | main.testSetUp.ONOSSetUp( main.Cluster, cellName=cellName, |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 105 | extraApply=applyFuncs, |
| 106 | applyArgs=applyArgs, |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 107 | installMax=True, |
| 108 | includeCaseDesc=False ) |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 109 | main.HA.initialSetUp() |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 110 | |
| 111 | main.step( 'Set logging levels' ) |
| 112 | logging = True |
| 113 | try: |
| 114 | logs = main.params.get( 'ONOS_Logging', False ) |
| 115 | if logs: |
| 116 | for namespace, level in logs.items(): |
| 117 | for ctrl in main.Cluster.active(): |
| 118 | ctrl.CLI.logSet( level, namespace ) |
| 119 | except AttributeError: |
| 120 | logging = False |
| 121 | utilities.assert_equals( expect=True, actual=logging, |
| 122 | onpass="Set log levels", |
| 123 | onfail="Failed to set log levels" ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 124 | |
| 125 | def CASE2( self, main ): |
| 126 | """ |
| 127 | Assign devices to controllers |
| 128 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 129 | main.HA.assignDevices( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 130 | |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 131 | def CASE102( self, main ): |
| 132 | """ |
| 133 | Set up Spine-Leaf fabric topology in Mininet |
| 134 | """ |
| 135 | main.HA.startTopology( main ) |
| 136 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 137 | def CASE21( self, main ): |
| 138 | """ |
| 139 | Assign mastership to controllers |
| 140 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 141 | main.HA.assignMastership( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 142 | |
| 143 | def CASE3( self, main ): |
| 144 | """ |
| 145 | Assign intents |
| 146 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 147 | main.HA.assignIntents( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 148 | |
| 149 | def CASE4( self, main ): |
| 150 | """ |
| 151 | Ping across added host intents |
| 152 | """ |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 153 | main.HA.pingAcrossHostIntent( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 154 | |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 155 | def CASE104( self, main ): |
| 156 | """ |
| 157 | Ping Hosts |
| 158 | """ |
| 159 | main.case( "Check connectivity" ) |
| 160 | main.step( "Ping between all hosts" ) |
| 161 | pingResult = main.Mininet1.pingall() |
| 162 | utilities.assert_equals( expect=main.TRUE, actual=pingResult, |
| 163 | onpass="All Pings Passed", |
| 164 | onfail="Failed to ping between all hosts" ) |
| 165 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 166 | def CASE5( self, main ): |
| 167 | """ |
| 168 | Reading state of ONOS |
| 169 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 170 | main.HA.readingState( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 171 | |
| 172 | def CASE6( self, main ): |
| 173 | """ |
| 174 | The Scaling case. |
| 175 | """ |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 176 | assert main, "main not defined" |
| 177 | assert utilities.assert_equals, "utilities.assert_equals not defined" |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 178 | try: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 179 | main.HAlabels |
| 180 | except ( NameError, AttributeError ): |
| 181 | main.log.error( "main.HAlabels not defined, setting to []" ) |
| 182 | main.HAlabels = [] |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 183 | try: |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 184 | main.HAdata |
| 185 | except ( NameError, AttributeError ): |
| 186 | main.log.error( "main.HAdata not defined, setting to []" ) |
| 187 | main.HAdata = [] |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 188 | |
| 189 | main.case( "Swap some of the ONOS nodes" ) |
| 190 | |
| 191 | main.step( "Checking ONOS Logs for errors" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 192 | for ctrl in main.Cluster.active(): |
| 193 | main.log.debug( "Checking logs for errors on " + ctrl.name + ":" ) |
| 194 | main.log.warn( main.ONOSbench.checkLogs( ctrl.ipAddress ) ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 195 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 196 | activeNodes = main.Cluster.getRunningPos() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 197 | old = [ activeNodes[ 1 ], activeNodes[ -2 ] ] |
| 198 | new = range( main.Cluster.maxCtrls )[ -2: ] |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 199 | assert len( old ) == len( new ), "Length of nodes to swap don't match" |
| 200 | handle = main.ONOSbench.handle |
| 201 | for x, y in zip( old, new ): |
| 202 | handle.sendline( "export OC{}=$OC{}".format( x + 1, y + 1 ) ) |
| 203 | handle.expect( "\$" ) # from the variable |
| 204 | ret = handle.before |
| 205 | handle.expect( "\$" ) # From the prompt |
| 206 | ret += handle.before |
| 207 | main.log.debug( ret ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 208 | activeNodes.remove( x ) |
| 209 | activeNodes.append( y ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 210 | |
Jon Hall | a1e8e51 | 2018-05-11 13:30:57 -0700 | [diff] [blame] | 211 | main.Cluster.clearActive() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 212 | # Note : done up to this point. |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 213 | main.step( "Start new nodes" ) # OR stop old nodes? |
| 214 | started = main.TRUE |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 215 | stopped = main.TRUE |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 216 | for i in new: |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 217 | started = main.ONOSbench.onosStart( main.Cluster.controllers[ i ].ipAddress ) and started |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 218 | utilities.assert_equals( expect=main.TRUE, actual=started, |
| 219 | onpass="ONOS started", |
| 220 | onfail="ONOS start NOT successful" ) |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 221 | for i in old: |
| 222 | main.log.debug( "Stopping " + str( main.Cluster.controllers[ i ].ipAddress ) ) |
| 223 | stopped = main.ONOSbench.onosStop( main.Cluster.controllers[ i ].ipAddress ) and stopped |
| 224 | utilities.assert_equals( expect=main.TRUE, actual=stopped, |
| 225 | onpass="ONOS stopped", |
| 226 | onfail="ONOS stop NOT successful" ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 227 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 228 | main.Cluster.setRunningNode( activeNodes ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 229 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 230 | main.testSetUp.setupSsh( main.Cluster ) |
| 231 | main.testSetUp.checkOnosService( main.Cluster ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 232 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 233 | main.testSetUp.startOnosClis( main.Cluster ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 234 | |
Jon Hall | 30668ff | 2019-02-27 17:43:09 -0800 | [diff] [blame] | 235 | main.testSetUp.checkOnosNodes( main.Cluster ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 236 | |
Jeremy Ronquillo | 23fb216 | 2017-09-15 14:59:57 -0700 | [diff] [blame] | 237 | ready = utilities.retry( main.Cluster.command, |
Jon Hall | 3e6edb3 | 2018-08-21 16:20:30 -0700 | [diff] [blame] | 238 | False, |
| 239 | kwargs={ "function": "summary", "contentCheck": True }, |
| 240 | sleep=30, |
| 241 | attempts=10 ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 242 | utilities.assert_equals( expect=True, actual=ready, |
| 243 | onpass="ONOS summary command succeded", |
| 244 | onfail="ONOS summary command failed" ) |
| 245 | if not ready: |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 246 | main.cleanAndExit() |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 247 | |
| 248 | # Rerun for election on new nodes |
| 249 | runResults = main.TRUE |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 250 | for ctrl in main.Cluster.active(): |
| 251 | run = ctrl.CLI.electionTestRun() |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 252 | if run != main.TRUE: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 253 | main.log.error( "Error running for election on " + ctrl.name ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 254 | runResults = runResults and run |
| 255 | utilities.assert_equals( expect=main.TRUE, actual=runResults, |
| 256 | onpass="Reran for election", |
| 257 | onfail="Failed to rerun for election" ) |
| 258 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 259 | main.HA.commonChecks() |
| 260 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 261 | def CASE7( self, main ): |
| 262 | """ |
| 263 | Check state after ONOS scaling |
| 264 | """ |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 265 | main.HA.checkStateAfterEvent( main, afterWhich=1 ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 266 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 267 | main.step( "Leadership Election is still functional" ) |
| 268 | # Test of LeadershipElection |
| 269 | leaderList = [] |
| 270 | leaderResult = main.TRUE |
| 271 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 272 | for ctrl in main.Cluster.active(): |
| 273 | leaderN = ctrl.CLI.electionTestLeader() |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 274 | leaderList.append( leaderN ) |
| 275 | if leaderN == main.FALSE: |
| 276 | # error in response |
| 277 | main.log.error( "Something is wrong with " + |
| 278 | "electionTestLeader function, check the" + |
| 279 | " error logs" ) |
| 280 | leaderResult = main.FALSE |
| 281 | elif leaderN is None: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 282 | main.log.error( ctrl.name + |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 283 | " shows no leader for the election-app." ) |
| 284 | leaderResult = main.FALSE |
| 285 | if len( set( leaderList ) ) != 1: |
| 286 | leaderResult = main.FALSE |
| 287 | main.log.error( |
| 288 | "Inconsistent view of leader for the election test app" ) |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 289 | main.log.debug( leaderList ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 290 | utilities.assert_equals( |
| 291 | expect=main.TRUE, |
| 292 | actual=leaderResult, |
| 293 | onpass="Leadership election passed", |
| 294 | onfail="Something went wrong with Leadership election" ) |
| 295 | |
| 296 | def CASE8( self, main ): |
| 297 | """ |
| 298 | Compare topo |
| 299 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 300 | main.HA.compareTopo( main ) |
Jon Hall | d2871c2 | 2016-07-26 11:01:14 -0700 | [diff] [blame] | 301 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 302 | def CASE9( self, main ): |
| 303 | """ |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 304 | Link down |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 305 | """ |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 306 | src = main.params['kill']['linkSrc'] |
| 307 | dst = main.params['kill']['linkDst'] |
| 308 | main.HA.linkDown( main, src, dst ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 309 | |
| 310 | def CASE10( self, main ): |
| 311 | """ |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 312 | Link up |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 313 | """ |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 314 | src = main.params['kill']['linkSrc'] |
| 315 | dst = main.params['kill']['linkDst'] |
| 316 | main.HA.linkUp( main, src, dst ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 317 | |
| 318 | def CASE11( self, main ): |
| 319 | """ |
| 320 | Switch Down |
| 321 | """ |
| 322 | # NOTE: You should probably run a topology check after this |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 323 | main.HA.switchDown( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 324 | |
| 325 | def CASE12( self, main ): |
| 326 | """ |
| 327 | Switch Up |
| 328 | """ |
| 329 | # NOTE: You should probably run a topology check after this |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 330 | main.HA.switchUp( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 331 | |
| 332 | def CASE13( self, main ): |
| 333 | """ |
| 334 | Clean up |
| 335 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 336 | main.HA.cleanUp( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 337 | |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 338 | def CASE14( self, main ): |
| 339 | """ |
Jon Hall | ab61137 | 2018-02-21 15:26:05 -0800 | [diff] [blame] | 340 | Start election app on all onos nodes |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 341 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 342 | main.HA.startElectionApp( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 343 | |
| 344 | def CASE15( self, main ): |
| 345 | """ |
| 346 | Check that Leadership Election is still functional |
| 347 | 15.1 Run election on each node |
| 348 | 15.2 Check that each node has the same leaders and candidates |
| 349 | 15.3 Find current leader and withdraw |
| 350 | 15.4 Check that a new node was elected leader |
| 351 | 15.5 Check that that new leader was the candidate of old leader |
| 352 | 15.6 Run for election on old leader |
| 353 | 15.7 Check that oldLeader is a candidate, and leader if only 1 node |
| 354 | 15.8 Make sure that the old leader was added to the candidate list |
| 355 | |
| 356 | old and new variable prefixes refer to data from before vs after |
| 357 | withdrawl and later before withdrawl vs after re-election |
| 358 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 359 | main.HA.isElectionFunctional( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 360 | |
| 361 | def CASE16( self, main ): |
| 362 | """ |
| 363 | Install Distributed Primitives app |
| 364 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 365 | main.HA.installDistributedPrimitiveApp( main ) |
Jon Hall | 69b2b98 | 2016-05-11 12:04:59 -0700 | [diff] [blame] | 366 | |
| 367 | def CASE17( self, main ): |
| 368 | """ |
| 369 | Check for basic functionality with distributed primitives |
| 370 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 371 | main.HA.checkDistPrimitivesFunc( main ) |