Home | History | Annotate | Download | only in provision_AutoUpdate
      1 # Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 
      6 AUTHOR = "milleral, chromeos-lab-infrastructure"
      7 NAME = "provision_AutoUpdate"
      8 PURPOSE = "Provision a system to the correct OS version."
      9 TIME = "MEDIUM"
     10 TEST_CATEGORY = "System"
     11 TEST_CLASS = "provision"
     12 TEST_TYPE = "Server"
     13 
     14 DOC = """
     15 This is a test used by the provision control segment in autoserv to set the
     16 cros-version label of a host to the desired setting.
     17 """
     18 
     19 
     20 from autotest_lib.client.common_lib import error, utils
     21 from autotest_lib.client.cros import constants
     22 
     23 
     24 # Uncomment the below line, and change it to the correct value if you are
     25 # running this from the AFE.
     26 # value = 'lumpy-release/R28-3993.0.0'
     27 
     28 
     29 if not locals().get('value'):
     30     args = utils.args_to_dict(args)
     31     if not args.get('value'):
     32         raise error.TestError("No provision value!")
     33     value = args['value']
     34 
     35 
     36 def run(machine):
     37     # Save preserved log after autoupdate is completed.
     38     job.sysinfo.add_logdir(constants.AUTOUPDATE_PRESERVE_LOG)
     39 
     40     host = hosts.create_host(machine, initialize=False)
     41     # Only collect pre-test sysinfo to save time.
     42     job.run_test('provision_AutoUpdate', host=host, value=value,
     43                  disable_sysinfo=False,
     44                  disable_before_test_sysinfo=False,
     45                  disable_before_iteration_sysinfo=True,
     46                  disable_after_test_sysinfo=True,
     47                  disable_after_iteration_sysinfo=True)
     48 
     49 
     50 job.parallel_simple(run, machines)
     51