• 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
5from autotest_lib.client.common_lib import utils
6
7AUTHOR = "Chromium OS"
8NAME = "autoupdate_Rollback"
9TIME = "MEDIUM"
10TEST_CATEGORY = "Functional"
11TEST_CLASS = "platform"
12TEST_TYPE = "server"
13ATTRIBUTES = "suite:bvt-installer"
14BUG_TEMPLATE = {
15    'cc': ['chromeos-installer-alerts@google.com'],
16    'components': ['Internals>Installer'],
17}
18
19DOC = """
20This is a rollback test for Chrome OS releases. It first updates a machine and
21then invokes rollback to boot from its previously booted partition. It tests
22rollback using the update_engine_client rather than manipulating the UI.
23
24Setup for this test is exactly like platform_RebootAfterUpdate. Namely:
25
26Arg:
27  job_repo_url: repo url to use to find image to update from -- assumes caller
28                has staged image. By default if host[repo_job_url] is set, it'll
29                use that. This overrides that value. This value must follow
30                the package_url_pattern in the global config.
31
32To run locally:
33  1) Setup your devserver in your shadow config that your DUT can reach.
34  2) Start your devserver and stage the image you want for example:
35     http://localhost:8080/stage?archive_url=\
36     gs://chromeos-image-archive/parrot-release/R32-4793.0.0&\
37     artifacts=full_payload (and leave it on).
38  3) Run with test_that etc passing
39     args="job_repo_url=http://<your_hostname>:8080/static/\
40     parrot-release/R32-4793.0.0/autotest/packages"
41
42For example:
43
44test_that -b parrot --args="job_repo_url=http://<your_machine>:8080/static/\
45parrot-release/R32-4793.0.0/autotest/packages" --fast \
46<dut_ip> autoupdate_Rollback
47"""
48
49args_dict = utils.args_to_dict(args)
50job_repo_url = args_dict.get('job_repo_url')
51
52
53def run_test(machine):
54    """Execute a test configuration on a given machine."""
55    host = hosts.create_host(machine)
56    job.run_test("autoupdate_Rollback", host=host,
57                 job_repo_url=job_repo_url)
58
59
60# Invoke parallel tests.
61parallel_simple(run_test, machines)
62