• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6AUTHOR = "milleral, chromeos-lab-infrastructure"
7NAME = "provision_AutoUpdate"
8PURPOSE = "Provision a system to the correct OS version."
9TIME = "MEDIUM"
10TEST_CATEGORY = "System"
11TEST_CLASS = "provision"
12TEST_TYPE = "Server"
13
14DOC = """
15This is a test used by the provision control segment in autoserv to set the
16cros-version label of a host to the desired setting.
17
18To run locally:
19
201. Start a devserver outside of a chroot like this:
21src/platform/dev/devserver.py --port=8082
22
232. You will need to add a few lines to
24src/third_party/autotest/files/shadow_config.ini
25
26[CROS]
27dev_server: http://127.0.0.1:8082
28enable_devserver_trigger_auto_update: True
29
303. Use a command like this replacing the |value| arg with the device and build
31version you want to run the test against:
32
33test_that --args="value='samus-release/R60-9495.0.0'" <DUT-IPADDR>
34provision_AutoUpdate
35
36"""
37
38
39from autotest_lib.client.common_lib import error, utils
40from autotest_lib.client.cros import constants
41
42
43# Uncomment the below line, and change it to the correct value if you are
44# running this from the AFE.
45# value = 'lumpy-release/R28-3993.0.0'
46
47
48if not locals().get('value'):
49    args = utils.args_to_dict(args)
50    if not args.get('value'):
51        raise error.TestError("No provision value!")
52    value = args['value']
53
54
55def run(machine):
56    # Save preserved log after autoupdate is completed.
57    job.sysinfo.add_logdir(constants.AUTOUPDATE_PRESERVE_LOG)
58
59    host = hosts.create_host(machine)
60    # Only collect pre-test sysinfo to save time.
61    job.run_test('provision_AutoUpdate', host=host, value=value,
62                 disable_sysinfo=False,
63                 disable_before_test_sysinfo=False,
64                 disable_before_iteration_sysinfo=True,
65                 disable_after_test_sysinfo=True,
66                 disable_after_iteration_sysinfo=True)
67
68
69job.parallel_simple(run, machines)
70