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"
14
15DOC = """
16This is a rollback test for Chrome OS releases. It first updates a machine and
17then invokes rollback to boot from its previously booted partition. It tests
18rollback using the update_engine_client rather than manipulating the UI.
19
20To run locally:
21  1) Lease a DUT in the lab
22  2) Edit your shadow_config.ini to point to a devserver that the leased DUT can reach.
23  3) Run with test_that passing job_repo_url
24
25For example:
26
27test_that <dut_ip> autoupdate_Rollback --args="job_repo_url='http://<IP>:<port>/static/<board>-release/RXX-XXXX.X.X/autotest/packages'"
28
29"""
30
31args_dict = utils.args_to_dict(args)
32job_repo_url = args_dict.get('job_repo_url')
33
34
35def run_test(machine):
36    """Execute a test configuration on a given machine."""
37    host = hosts.create_host(machine)
38    job.run_test("autoupdate_Rollback", host=host,
39                 job_repo_url=job_repo_url)
40
41
42# Invoke parallel tests.
43parallel_simple(run_test, machines)
44