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