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" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 41 | main.cleanAndExit() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 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..." ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 63 | if not stepResult: main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 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 ..." ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 71 | if not stepResult: main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 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" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 92 | main.cleanAndExit() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 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 ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 110 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 111 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 112 | def evnSetupConclusion( self, stepResult ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 113 | """ |
| 114 | Description: |
| 115 | compare the result of the envSetup of the test. |
| 116 | Required: |
| 117 | * stepResult - Result of the envSetup. |
| 118 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 119 | utilities.assert_equals( expect=main.TRUE, |
| 120 | actual=stepResult, |
| 121 | onpass="Successfully construct " + |
| 122 | "test variables ", |
| 123 | onfail="Failed to construct test variables" ) |
| 124 | |
| 125 | main.commit = main.ONOSbench.getVersion( report=True ) |
| 126 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 127 | def setNumCtrls( self, hasMultiNodeRounds ): |
| 128 | """ |
| 129 | Description: |
| 130 | Set new number of controls if it uses different number of nodes. |
| 131 | different number of nodes should be pre-defined in main.scale. |
| 132 | Required: |
| 133 | * hasMultiNodeRouds - if the test is testing different number of nodes. |
| 134 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 135 | if hasMultiNodeRounds: |
| 136 | try: |
| 137 | main.cycle |
| 138 | except Exception: |
| 139 | main.cycle = 0 |
| 140 | main.cycle += 1 |
| 141 | # main.scale[ 0 ] determines the current number of ONOS controller |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 142 | main.Cluster.setRunningNode( int( main.scale.pop( 0 ) ) ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 143 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 144 | def killingAllOnos( self, cluster, killRemoveMax, stopOnos ): |
| 145 | """ |
| 146 | Description: |
| 147 | killing the onos. It will either kill the current runningnodes or |
| 148 | max number of the nodes. |
| 149 | Required: |
| 150 | * cluster - the cluster driver that will be used. |
| 151 | * killRemoveMax - The boolean that will decide either to kill |
| 152 | only running nodes (False) or max number of nodes (True). |
| 153 | * stopOnos - If wish to stop onos before killing it. True for |
| 154 | enable stop , False for disable stop. |
| 155 | Returns: |
| 156 | Returns main.TRUE if successfully killing it. |
| 157 | """ |
| 158 | main.log.info( "Safety check, killing all ONOS processes" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 159 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 160 | return cluster.kill( killRemoveMax, stopOnos ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 161 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 162 | def createApplyCell( self, cluster, newCell, cellName, Mininet, useSSH, ips ): |
| 163 | """ |
| 164 | Description: |
| 165 | create new cell ( optional ) and apply it. It will also verify the |
| 166 | cell. |
| 167 | Required: |
| 168 | * cluster - the cluster driver that will be used. |
| 169 | * newCell - True for making a new cell and False for not making it. |
| 170 | * cellName - The name of the cell. |
| 171 | * Mininet - a mininet driver that will be used. |
| 172 | * useSSH - True for using ssh when creating a cell |
| 173 | * ips - ip(s) of the node(s). |
| 174 | Returns: |
| 175 | Returns main.TRUE if it successfully executed. |
| 176 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 177 | if newCell: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 178 | cluster.createCell( cellName, Mininet, useSSH, ips ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 179 | main.step( "Apply cell to environment" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 180 | stepResult = cluster.applyCell( cellName ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 181 | utilities.assert_equals( expect=main.TRUE, |
| 182 | actual=stepResult, |
| 183 | onpass="Successfully applied cell to " + |
| 184 | "environment", |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 185 | onfail="Failed to apply cell to environment" ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 186 | return stepResult |
| 187 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 188 | def uninstallOnos( self, cluster, uninstallMax ): |
| 189 | """ |
| 190 | Description: |
| 191 | uninstalling onos and verify the result. |
| 192 | Required: |
| 193 | * cluster - a cluster driver that will be used. |
| 194 | * uninstallMax - True for uninstalling max number of nodes |
| 195 | False for uninstalling the current running nodes. |
| 196 | Returns: |
| 197 | Returns main.TRUE if it successfully uninstalled. |
| 198 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 199 | main.step( "Uninstalling ONOS package" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 200 | onosUninstallResult = cluster.uninstall( uninstallMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 201 | utilities.assert_equals( expect=main.TRUE, |
| 202 | actual=onosUninstallResult, |
| 203 | onpass="Successfully uninstalled ONOS package", |
| 204 | onfail="Failed to uninstall ONOS package" ) |
| 205 | return onosUninstallResult |
| 206 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 207 | def buildOnos( self, cluster ): |
| 208 | """ |
| 209 | Description: |
| 210 | build the onos using buck build onos and verify the result |
| 211 | Required: |
| 212 | * cluster - the cluster driver that will be used. |
| 213 | Returns: |
| 214 | Returns main.TRUE if it successfully built. |
| 215 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 216 | main.step( "Creating ONOS package" ) |
| 217 | packageResult = main.ONOSbench.buckBuild() |
| 218 | utilities.assert_equals( expect=main.TRUE, |
| 219 | actual=packageResult, |
| 220 | onpass="Successfully created ONOS package", |
| 221 | onfail="Failed to create ONOS package" ) |
| 222 | return packageResult |
| 223 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 224 | def installOnos( self, cluster, installMax ): |
| 225 | """ |
| 226 | Description: |
| 227 | Installing onos and verify the result |
| 228 | Required: |
| 229 | * cluster - the cluster driver that will be used. |
| 230 | * installMax - True for installing max number of nodes |
| 231 | False for installing current running nodes only. |
| 232 | Returns: |
| 233 | Returns main.TRUE if it successfully installed |
| 234 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 235 | main.step( "Installing ONOS package" ) |
| 236 | onosInstallResult = main.TRUE |
| 237 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 238 | cluster.install( installMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 239 | utilities.assert_equals( expect=main.TRUE, |
| 240 | actual=onosInstallResult, |
| 241 | onpass="Successfully installed ONOS package", |
| 242 | onfail="Failed to install ONOS package" ) |
| 243 | if not onosInstallResult: |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 244 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 245 | return onosInstallResult |
| 246 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 247 | def setupSsh( self, cluster ): |
| 248 | """ |
| 249 | Description: |
| 250 | set up ssh to the onos and verify the result |
| 251 | Required: |
| 252 | * cluster - the cluster driver that will be used. |
| 253 | Returns: |
| 254 | Returns main.TRUE if it successfully setup the ssh to |
| 255 | the onos. |
| 256 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 257 | main.step( "Set up ONOS secure SSH" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 258 | secureSshResult = cluster.ssh() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 259 | utilities.assert_equals( expect=main.TRUE, |
| 260 | actual=secureSshResult, |
| 261 | onpass="Test step PASS", |
| 262 | onfail="Test step FAIL" ) |
| 263 | return secureSshResult |
| 264 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 265 | def checkOnosService( self, cluster ): |
| 266 | """ |
| 267 | Description: |
| 268 | Checking if the onos service is up and verify the result |
| 269 | Required: |
| 270 | * cluster - the cluster driver that will be used. |
| 271 | Returns: |
| 272 | Returns main.TRUE if it successfully checked |
| 273 | """ |
| 274 | main.step( "Checking ONOS service" ) |
| 275 | stepResult = cluster.checkService() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 276 | utilities.assert_equals( expect=main.TRUE, |
| 277 | actual=stepResult, |
| 278 | onpass="ONOS service is ready on all nodes", |
| 279 | onfail="ONOS service did not start properly on all nodes" ) |
| 280 | return stepResult |
| 281 | |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 282 | def startOnosClis( self, cluster ): |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 283 | """ |
| 284 | Description: |
| 285 | starting Onos using onosCli driver and verify the result |
| 286 | Required: |
| 287 | * cluster - the cluster driver that will be used. |
| 288 | Returns: |
| 289 | Returns main.TRUE if it successfully started. It will exit |
| 290 | the test if not started properly. |
| 291 | """ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 292 | main.step( "Starting ONOS CLI sessions" ) |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 293 | startCliResult = cluster.startCLIs() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 294 | if not startCliResult: |
| 295 | main.log.info( "ONOS CLI did not start up properly" ) |
Devin Lim | 4407596 | 2017-08-11 10:56:37 -0700 | [diff] [blame] | 296 | main.cleanAndExit() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 297 | else: |
| 298 | main.log.info( "Successful CLI startup" ) |
| 299 | utilities.assert_equals( expect=main.TRUE, |
| 300 | actual=startCliResult, |
| 301 | onpass="Successfully start ONOS cli", |
| 302 | onfail="Failed to start ONOS cli" ) |
| 303 | return startCliResult |
| 304 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 305 | def ONOSSetUp( self, Mininet, cluster, hasMultiNodeRounds=False, startOnos=True, newCell=True, |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 306 | cellName="temp", removeLog=False, extraApply=None, arg=None, extraClean=None, |
| 307 | skipPack=False, installMax=False, useSSH=True, killRemoveMax=True, |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 308 | stopOnos=False ): |
| 309 | """ |
| 310 | Description: |
| 311 | Initial ONOS setting up of the tests. It will also verify the result of each steps. |
| 312 | The procedures will be: |
| 313 | killing onos |
| 314 | creating (optional) /applying cell |
| 315 | removing raft logs (optional) |
| 316 | uninstalling onos |
| 317 | extra procedure to be applied( optional ) |
| 318 | building onos |
| 319 | installing onos |
| 320 | extra cleanup to be applied ( optional ) |
| 321 | setting up ssh to the onos |
| 322 | checking the onos service |
| 323 | starting onos |
| 324 | Required: |
| 325 | * Mininet - the mininet driver that will be used |
| 326 | * cluster - the cluster driver that will be used. |
| 327 | * hasMultiNodeRouds - True if the test is testing different set of nodes |
| 328 | * startOnos - True if wish to start onos. |
| 329 | * newCell - True for making a new cell and False for not making it. |
| 330 | * cellName - Name of the cell that will be used. |
| 331 | * removeLog - True if wish to remove raft logs |
| 332 | * extraApply - Function(s) that will be applied. Default to None. |
| 333 | * arg - argument of the functon(s) of the extraApply. Should be in list. |
| 334 | * extraClean - extra Clean up process. Function(s) will be passed. |
| 335 | * skipPack - True if wish to skip some packing. |
| 336 | * installMax - True if wish to install onos max number of nodes |
| 337 | False if wish to install onos of running nodes only |
| 338 | * useSSH - True for using ssh when creating a cell |
| 339 | * killRemoveMax - True for removing/killing max number of nodes. False for |
| 340 | removing/killing running nodes only. |
| 341 | * stopOnos - True if wish to stop onos before killing it. |
| 342 | Returns: |
| 343 | Returns main.TRUE if it everything successfully proceeded. |
| 344 | """ |
| 345 | self.setNumCtrls( hasMultiNodeRounds ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 346 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 347 | main.case( "Starting up " + str( cluster.numCtrls ) + |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 348 | " node(s) ONOS cluster" ) |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 349 | main.caseExplanation = "Set up ONOS with " + str( cluster.numCtrls ) + \ |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 350 | " node(s) ONOS cluster" |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 351 | killResult = self.killingAllOnos( cluster, killRemoveMax, stopOnos ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 352 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 353 | main.log.info( "NODE COUNT = " + str( cluster.numCtrls ) ) |
| 354 | cellResult = main.TRUE |
| 355 | packageResult = main.TRUE |
| 356 | onosUninstallResult = main.TRUE |
| 357 | onosCliResult = main.TRUE |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 358 | if not skipPack: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 359 | tempOnosIp = [] |
| 360 | for ctrl in cluster.runningNodes: |
| 361 | tempOnosIp.append( ctrl.ipAddress ) |
| 362 | cellResult = self.createApplyCell( cluster, newCell, |
| 363 | cellName, Mininet, |
| 364 | useSSH, tempOnosIp ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 365 | if removeLog: |
| 366 | main.log.info("Removing raft logs") |
| 367 | main.ONOSbench.onosRemoveRaftLogs() |
| 368 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 369 | onosUninstallResult = self.uninstallOnos( cluster, killRemoveMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 370 | |
| 371 | if extraApply is not None: |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 372 | if isinstance( extraApply, list ): |
| 373 | i = 0 |
| 374 | for apply in extraApply: |
| 375 | apply( *(arg[ i ]) ) if arg is not None \ |
| 376 | and arg[ i ] is not None else apply() |
| 377 | i += 1 |
| 378 | else: |
| 379 | extraApply( *arg ) if arg is not None else extraApply() |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 380 | |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 381 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 382 | packageResult = self.buildOnos( cluster ) |
| 383 | |
| 384 | onosInstallResult = self.installOnos( cluster, installMax ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 385 | |
| 386 | if extraClean is not None: |
| 387 | extraClean() |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 388 | secureSshResult = self.setupSsh( cluster ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 389 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 390 | onosServiceResult = self.checkOnosService( cluster ) |
Devin Lim | 58046fa | 2017-07-05 16:55:00 -0700 | [diff] [blame] | 391 | |
Devin Lim | 142b534 | 2017-07-20 15:22:39 -0700 | [diff] [blame] | 392 | if startOnos: |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 393 | onosCliResult = self.startOnosClis( 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 | return killResult and cellResult and packageResult and onosUninstallResult and \ |
Jon Hall | ca31989 | 2017-06-15 15:25:22 -0700 | [diff] [blame] | 396 | onosInstallResult and secureSshResult and onosServiceResult and onosCliResult |