Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2016 Open Networking Foundation (ONF) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 3 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 4 | Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>, |
| 5 | the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>, |
| 6 | or the System Testing Guide page at <https://wiki.onosproject.org/x/WYQg> |
| 7 | |
| 8 | TestON is free software: you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by |
| 10 | the Free Software Foundation, either version 2 of the License, or |
| 11 | (at your option) any later version. |
| 12 | |
| 13 | TestON is distributed in the hope that it will be useful, |
| 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with TestON. If not, see <http://www.gnu.org/licenses/>. |
| 20 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 21 | import time |
| 22 | import re |
| 23 | import imp |
| 24 | |
| 25 | class ONOSSetup: |
| 26 | main = None |
| 27 | def __init__( self ): |
| 28 | self.default = '' |
| 29 | def envSetupDescription ( self ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 30 | """ |
| 31 | Introduction part of the test. It will initialize some basic vairables. |
| 32 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 33 | main.case( "Constructing test variables and building ONOS package" ) |
| 34 | main.step( "Constructing test variables" ) |
| 35 | main.caseExplanation = "For loading from params file, and pull" + \ |
| 36 | " and build the latest ONOS package" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 37 | try: |
| 38 | from tests.dependencies.Cluster import Cluster |
| 39 | except ImportError: |
| 40 | main.log.error( "Cluster not found. exiting the test" ) |
| 41 | main.exit() |
| 42 | try: |
| 43 | main.Cluster |
| 44 | except ( NameError, AttributeError ): |
| 45 | main.Cluster = Cluster( main.ONOScell.nodes ) |
| 46 | main.ONOSbench = main.Cluster.controllers[ 0 ].Bench |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 47 | main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir ) |
| 48 | |
| 49 | def gitPulling( self ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 50 | """ |
| 51 | it will do git checkout or pull if they are enabled from the params file. |
| 52 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 53 | main.case( "Pull onos branch and build onos on Teststation." ) |
| 54 | gitPull = main.params[ 'GIT' ][ 'pull' ] |
| 55 | gitBranch = main.params[ 'GIT' ][ 'branch' ] |
| 56 | if gitPull == 'True': |
| 57 | main.step( "Git Checkout ONOS branch: " + gitBranch ) |
| 58 | stepResult = main.ONOSbench.gitCheckout( branch=gitBranch ) |
| 59 | utilities.assert_equals( expect=main.TRUE, |
| 60 | actual=stepResult, |
| 61 | onpass="Successfully checkout onos branch.", |
| 62 | onfail="Failed to checkout onos branch. Exiting test..." ) |
| 63 | if not stepResult: main.exit() |
| 64 | |
| 65 | main.step( "Git Pull on ONOS branch:" + gitBranch ) |
| 66 | stepResult = main.ONOSbench.gitPull() |
| 67 | utilities.assert_equals( expect=main.TRUE, |
| 68 | actual=stepResult, |
| 69 | onpass="Successfully pull onos. ", |
| 70 | onfail="Failed to pull onos. Exiting test ..." ) |
| 71 | if not stepResult: main.exit() |
| 72 | |
| 73 | else: |
| 74 | main.log.info( "Skipped git checkout and pull as they are disabled in params file" ) |
| 75 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 76 | def envSetup( self, includeGitPull=True ): |
| 77 | """ |
| 78 | Description: |
| 79 | some environment setup for the test. |
| 80 | Required: |
| 81 | * includeGitPull - if wish to git pulling function to be executed. |
| 82 | Returns: |
| 83 | Returns main.TRUE |
| 84 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 85 | if includeGitPull : |
| 86 | self.gitPulling() |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 87 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 88 | try: |
| 89 | from tests.dependencies.Cluster import Cluster |
| 90 | except ImportError: |
| 91 | main.log.error( "Cluster not found. exiting the test" ) |
| 92 | main.exit() |
| 93 | try: |
| 94 | main.Cluster |
| 95 | except ( NameError, AttributeError ): |
| 96 | main.Cluster = Cluster( main.ONOScell.nodes ) |
| 97 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 98 | main.cellData = {} # For creating cell file |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 99 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 100 | return main.TRUE |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 101 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 102 | def envSetupException( self, e ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 103 | """ |
| 104 | Description: |
| 105 | handles the exception that might occur from the environment setup. |
| 106 | Required: |
| 107 | * includeGitPull - exceeption code e. |
| 108 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 109 | main.log.exception( e ) |
| 110 | main.cleanup() |
| 111 | main.exit() |
| 112 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 113 | def evnSetupConclusion( self, stepResult ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 114 | """ |
| 115 | Description: |
| 116 | compare the result of the envSetup of the test. |
| 117 | Required: |
| 118 | * stepResult - Result of the envSetup. |
| 119 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 120 | utilities.assert_equals( expect=main.TRUE, |
| 121 | actual=stepResult, |
| 122 | onpass="Successfully construct " + |
| 123 | "test variables ", |
| 124 | onfail="Failed to construct test variables" ) |
| 125 | |
| 126 | main.commit = main.ONOSbench.getVersion( report=True ) |
| 127 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 128 | def setNumCtrls( self, hasMultiNodeRounds ): |
| 129 | """ |
| 130 | Description: |
| 131 | Set new number of controls if it uses different number of nodes. |
| 132 | different number of nodes should be pre-defined in main.scale. |
| 133 | Required: |
| 134 | * hasMultiNodeRouds - if the test is testing different number of nodes. |
| 135 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 136 | if hasMultiNodeRounds: |
| 137 | try: |
| 138 | main.cycle |
| 139 | except Exception: |
| 140 | main.cycle = 0 |
| 141 | main.cycle += 1 |
| 142 | # main.scale[ 0 ] determines the current number of ONOS controller |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 143 | main.Cluster.setRunningNode( int( main.scale.pop( 0 ) ) ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 144 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 145 | def killingAllOnos( self, cluster, killRemoveMax, stopOnos ): |
| 146 | """ |
| 147 | Description: |
| 148 | killing the onos. It will either kill the current runningnodes or |
| 149 | max number of the nodes. |
| 150 | Required: |
| 151 | * cluster - the cluster driver that will be used. |
| 152 | * killRemoveMax - The boolean that will decide either to kill |
| 153 | only running nodes (False) or max number of nodes (True). |
| 154 | * stopOnos - If wish to stop onos before killing it. True for |
| 155 | enable stop , False for disable stop. |
| 156 | Returns: |
| 157 | Returns main.TRUE if successfully killing it. |
| 158 | """ |
| 159 | main.log.info( "Safety check, killing all ONOS processes" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 160 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 161 | return cluster.kill( killRemoveMax, stopOnos ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 162 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 163 | def createApplyCell( self, cluster, newCell, cellName, Mininet, useSSH, ips ): |
| 164 | """ |
| 165 | Description: |
| 166 | create new cell ( optional ) and apply it. It will also verify the |
| 167 | cell. |
| 168 | Required: |
| 169 | * cluster - the cluster driver that will be used. |
| 170 | * newCell - True for making a new cell and False for not making it. |
| 171 | * cellName - The name of the cell. |
| 172 | * Mininet - a mininet driver that will be used. |
| 173 | * useSSH - True for using ssh when creating a cell |
| 174 | * ips - ip(s) of the node(s). |
| 175 | Returns: |
| 176 | Returns main.TRUE if it successfully executed. |
| 177 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 178 | if newCell: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 179 | cluster.createCell( cellName, Mininet, useSSH, ips ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 180 | main.step( "Apply cell to environment" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 181 | stepResult = cluster.applyCell( cellName ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 182 | utilities.assert_equals( expect=main.TRUE, |
| 183 | actual=stepResult, |
| 184 | onpass="Successfully applied cell to " + |
| 185 | "environment", |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 186 | onfail="Failed to apply cell to environment" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 187 | return stepResult |
| 188 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 189 | def uninstallOnos( self, cluster, uninstallMax ): |
| 190 | """ |
| 191 | Description: |
| 192 | uninstalling onos and verify the result. |
| 193 | Required: |
| 194 | * cluster - a cluster driver that will be used. |
| 195 | * uninstallMax - True for uninstalling max number of nodes |
| 196 | False for uninstalling the current running nodes. |
| 197 | Returns: |
| 198 | Returns main.TRUE if it successfully uninstalled. |
| 199 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 200 | main.step( "Uninstalling ONOS package" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 201 | onosUninstallResult = cluster.uninstall( uninstallMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 202 | utilities.assert_equals( expect=main.TRUE, |
| 203 | actual=onosUninstallResult, |
| 204 | onpass="Successfully uninstalled ONOS package", |
| 205 | onfail="Failed to uninstall ONOS package" ) |
| 206 | return onosUninstallResult |
| 207 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 208 | def buildOnos( self, cluster ): |
| 209 | """ |
| 210 | Description: |
| 211 | build the onos using buck build onos and verify the result |
| 212 | Required: |
| 213 | * cluster - the cluster driver that will be used. |
| 214 | Returns: |
| 215 | Returns main.TRUE if it successfully built. |
| 216 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 217 | main.step( "Creating ONOS package" ) |
| 218 | packageResult = main.ONOSbench.buckBuild() |
| 219 | utilities.assert_equals( expect=main.TRUE, |
| 220 | actual=packageResult, |
| 221 | onpass="Successfully created ONOS package", |
| 222 | onfail="Failed to create ONOS package" ) |
| 223 | return packageResult |
| 224 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 225 | def installOnos( self, cluster, installMax ): |
| 226 | """ |
| 227 | Description: |
| 228 | Installing onos and verify the result |
| 229 | Required: |
| 230 | * cluster - the cluster driver that will be used. |
| 231 | * installMax - True for installing max number of nodes |
| 232 | False for installing current running nodes only. |
| 233 | Returns: |
| 234 | Returns main.TRUE if it successfully installed |
| 235 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 236 | main.step( "Installing ONOS package" ) |
| 237 | onosInstallResult = main.TRUE |
| 238 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 239 | cluster.install( installMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 240 | utilities.assert_equals( expect=main.TRUE, |
| 241 | actual=onosInstallResult, |
| 242 | onpass="Successfully installed ONOS package", |
| 243 | onfail="Failed to install ONOS package" ) |
| 244 | if not onosInstallResult: |
| 245 | main.cleanup() |
| 246 | main.exit() |
| 247 | return onosInstallResult |
| 248 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 249 | def setupSsh( self, cluster ): |
| 250 | """ |
| 251 | Description: |
| 252 | set up ssh to the onos and verify the result |
| 253 | Required: |
| 254 | * cluster - the cluster driver that will be used. |
| 255 | Returns: |
| 256 | Returns main.TRUE if it successfully setup the ssh to |
| 257 | the onos. |
| 258 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 259 | main.step( "Set up ONOS secure SSH" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 260 | secureSshResult = cluster.ssh() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 261 | utilities.assert_equals( expect=main.TRUE, |
| 262 | actual=secureSshResult, |
| 263 | onpass="Test step PASS", |
| 264 | onfail="Test step FAIL" ) |
| 265 | return secureSshResult |
| 266 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 267 | def checkOnosService( self, cluster ): |
| 268 | """ |
| 269 | Description: |
| 270 | Checking if the onos service is up and verify the result |
| 271 | Required: |
| 272 | * cluster - the cluster driver that will be used. |
| 273 | Returns: |
| 274 | Returns main.TRUE if it successfully checked |
| 275 | """ |
| 276 | main.step( "Checking ONOS service" ) |
| 277 | stepResult = cluster.checkService() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 278 | utilities.assert_equals( expect=main.TRUE, |
| 279 | actual=stepResult, |
| 280 | onpass="ONOS service is ready on all nodes", |
| 281 | onfail="ONOS service did not start properly on all nodes" ) |
| 282 | return stepResult |
| 283 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 284 | def startOnosClis( self, cluster ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 285 | """ |
| 286 | Description: |
| 287 | starting Onos using onosCli driver and verify the result |
| 288 | Required: |
| 289 | * cluster - the cluster driver that will be used. |
| 290 | Returns: |
| 291 | Returns main.TRUE if it successfully started. It will exit |
| 292 | the test if not started properly. |
| 293 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 294 | main.step( "Starting ONOS CLI sessions" ) |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 295 | startCliResult = cluster.startCLIs() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 296 | if not startCliResult: |
| 297 | main.log.info( "ONOS CLI did not start up properly" ) |
| 298 | main.cleanup() |
| 299 | main.exit() |
| 300 | else: |
| 301 | main.log.info( "Successful CLI startup" ) |
| 302 | utilities.assert_equals( expect=main.TRUE, |
| 303 | actual=startCliResult, |
| 304 | onpass="Successfully start ONOS cli", |
| 305 | onfail="Failed to start ONOS cli" ) |
| 306 | return startCliResult |
| 307 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 308 | def ONOSSetUp( self, Mininet, cluster, hasMultiNodeRounds=False, startOnos=True, newCell=True, |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 309 | cellName="temp", removeLog=False, extraApply=None, arg=None, extraClean=None, |
| 310 | skipPack=False, installMax=False, useSSH=True, killRemoveMax=True, |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 311 | stopOnos=False ): |
| 312 | """ |
| 313 | Description: |
| 314 | Initial ONOS setting up of the tests. It will also verify the result of each steps. |
| 315 | The procedures will be: |
| 316 | killing onos |
| 317 | creating (optional) /applying cell |
| 318 | removing raft logs (optional) |
| 319 | uninstalling onos |
| 320 | extra procedure to be applied( optional ) |
| 321 | building onos |
| 322 | installing onos |
| 323 | extra cleanup to be applied ( optional ) |
| 324 | setting up ssh to the onos |
| 325 | checking the onos service |
| 326 | starting onos |
| 327 | Required: |
| 328 | * Mininet - the mininet driver that will be used |
| 329 | * cluster - the cluster driver that will be used. |
| 330 | * hasMultiNodeRouds - True if the test is testing different set of nodes |
| 331 | * startOnos - True if wish to start onos. |
| 332 | * newCell - True for making a new cell and False for not making it. |
| 333 | * cellName - Name of the cell that will be used. |
| 334 | * removeLog - True if wish to remove raft logs |
| 335 | * extraApply - Function(s) that will be applied. Default to None. |
| 336 | * arg - argument of the functon(s) of the extraApply. Should be in list. |
| 337 | * extraClean - extra Clean up process. Function(s) will be passed. |
| 338 | * skipPack - True if wish to skip some packing. |
| 339 | * installMax - True if wish to install onos max number of nodes |
| 340 | False if wish to install onos of running nodes only |
| 341 | * useSSH - True for using ssh when creating a cell |
| 342 | * killRemoveMax - True for removing/killing max number of nodes. False for |
| 343 | removing/killing running nodes only. |
| 344 | * stopOnos - True if wish to stop onos before killing it. |
| 345 | Returns: |
| 346 | Returns main.TRUE if it everything successfully proceeded. |
| 347 | """ |
| 348 | self.setNumCtrls( hasMultiNodeRounds ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 349 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 350 | main.case( "Starting up " + str( cluster.numCtrls ) + |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 351 | " node(s) ONOS cluster" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 352 | main.caseExplanation = "Set up ONOS with " + str( cluster.numCtrls ) + \ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 353 | " node(s) ONOS cluster" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 354 | killResult = self.killingAllOnos( cluster, killRemoveMax, stopOnos ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 355 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 356 | main.log.info( "NODE COUNT = " + str( cluster.numCtrls ) ) |
| 357 | cellResult = main.TRUE |
| 358 | packageResult = main.TRUE |
| 359 | onosUninstallResult = main.TRUE |
| 360 | onosCliResult = main.TRUE |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 361 | if not skipPack: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 362 | tempOnosIp = [] |
| 363 | for ctrl in cluster.runningNodes: |
| 364 | tempOnosIp.append( ctrl.ipAddress ) |
| 365 | cellResult = self.createApplyCell( cluster, newCell, |
| 366 | cellName, Mininet, |
| 367 | useSSH, tempOnosIp ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 368 | if removeLog: |
| 369 | main.log.info("Removing raft logs") |
| 370 | main.ONOSbench.onosRemoveRaftLogs() |
| 371 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 372 | onosUninstallResult = self.uninstallOnos( cluster, killRemoveMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 373 | |
| 374 | if extraApply is not None: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 375 | if isinstance( extraApply, list ): |
| 376 | i = 0 |
| 377 | for apply in extraApply: |
| 378 | apply( *(arg[ i ]) ) if arg is not None \ |
| 379 | and arg[ i ] is not None else apply() |
| 380 | i += 1 |
| 381 | else: |
| 382 | extraApply( *arg ) if arg is not None else extraApply() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 383 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 384 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 385 | packageResult = self.buildOnos( cluster ) |
| 386 | |
| 387 | onosInstallResult = self.installOnos( cluster, installMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 388 | |
| 389 | if extraClean is not None: |
| 390 | extraClean() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 391 | secureSshResult = self.setupSsh( cluster ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 392 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 393 | onosServiceResult = self.checkOnosService( cluster ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 394 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 395 | if startOnos: |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 396 | onosCliResult = self.startOnosClis( cluster ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 397 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 398 | return killResult and cellResult and packageResult and onosUninstallResult and \ |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 399 | onosInstallResult and secureSshResult and onosServiceResult and onosCliResult |