Home | History | Annotate | Download | only in autoupdate_Rollback
      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:bvt-installer"
     14 BUG_TEMPLATE = {
     15     'cc': ['chromeos-installer-alerts (a] google.com'],
     16     'components': ['Internals>Installer'],
     17 }
     18 
     19 DOC = """
     20 This is a rollback test for Chrome OS releases. It first updates a machine and
     21 then invokes rollback to boot from its previously booted partition. It tests
     22 rollback using the update_engine_client rather than manipulating the UI.
     23 
     24 Setup for this test is exactly like platform_RebootAfterUpdate. Namely:
     25 
     26 Arg:
     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 
     32 To 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 
     42 For example:
     43 
     44 test_that -b parrot --args="job_repo_url=http://<your_machine>:8080/static/\
     45 parrot-release/R32-4793.0.0/autotest/packages" --fast \
     46 <dut_ip> autoupdate_Rollback
     47 """
     48 
     49 args_dict = utils.args_to_dict(args)
     50 job_repo_url = args_dict.get('job_repo_url')
     51 
     52 
     53 def 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.
     61 parallel_simple(run_test, machines)
     62