# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. AUTHOR = "milleral, chromeos-lab-infrastructure" NAME = "provision_AutoUpdate" PURPOSE = "Provision a system to the correct OS version." TIME = "MEDIUM" TEST_CATEGORY = "System" TEST_CLASS = "provision" TEST_TYPE = "Server" DOC = """ This is a test used by the provision control segment in autoserv to set the cros-version label of a host to the desired setting. To run locally: 1. Start a devserver outside of a chroot like this: src/platform/dev/devserver.py --port=8082 2. You will need to add a few lines to src/third_party/autotest/files/shadow_config.ini [CROS] dev_server: http://127.0.0.1:8082 enable_devserver_trigger_auto_update: True 3. Use a command like this replacing the |value| arg with the device and build version you want to run the test against: test_that --args="value='samus-release/R60-9495.0.0'" provision_AutoUpdate """ from autotest_lib.client.common_lib import error, utils from autotest_lib.client.cros import constants # Uncomment the below line, and change it to the correct value if you are # running this from the AFE. # value = 'lumpy-release/R28-3993.0.0' if not locals().get('value'): args = utils.args_to_dict(args) if not args.get('value'): raise error.TestError("No provision value!") value = args['value'] def run(machine): # Save preserved log after autoupdate is completed. job.sysinfo.add_logdir(constants.AUTOUPDATE_PRESERVE_LOG) host = hosts.create_host(machine) # Only collect pre-test sysinfo to save time. job.run_test('provision_AutoUpdate', host=host, value=value, disable_sysinfo=False, disable_before_test_sysinfo=False, disable_before_iteration_sysinfo=True, disable_after_test_sysinfo=True, disable_after_iteration_sysinfo=True) job.parallel_simple(run, machines)