Home | History | Annotate | Download | only in provision_Cr50Update
      1 # Copyright 2017 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 
      6 AUTHOR = "chromeos-lab-infrastructure"
      7 NAME = "provision_Cr50Update"
      8 PURPOSE = "Provision a system to the correct firmware version."
      9 TIME = "MEDIUM"
     10 TEST_CATEGORY = "System"
     11 TEST_CLASS = "provision"
     12 TEST_TYPE = "Server"
     13 DEPENDENCIES = "servo"
     14 
     15 DOC = """
     16 This is a test used by the provision control segment in autoserv to set the
     17 cr50-version label of a host to the desired setting. This test attempts to
     18 reprogram the cr50 firmware and set the cr50 chip board id using the given
     19 params in value. value should a string with the
     20 'prodsigned-rw_ver/image_bid/chip_bid' or 'selfsigned-build_info/chip_bid'.
     21 build_info is something like 'reef-release/R61-9704.0.0'. For a prodsigned image
     22 only the rw_ver is manditory. On selfsigned images only the build_info is
     23 necessary. value is completely ignored if a valid release_path is given.
     24 
     25 @param value: the release image information. Ignored if release_path is given
     26 @param release_path: local path to release image
     27 @param dev_path: local path to dev image
     28 @param chip_bid: the desired cr50 chip board id string
     29 """
     30 
     31 from autotest_lib.client.common_lib import error, utils
     32 
     33 
     34 args_dict = utils.args_to_dict(args)
     35 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     36 
     37 
     38 release_path = ''
     39 chip_bid = ''
     40 if not locals().get('value'):
     41     value = args_dict.get('value', '')
     42     release_path = args_dict.get('release_path', '')
     43     dev_path = args_dict.get('dev_path', '')
     44     chip_bid_str = args_dict.get('chip_bid', '')
     45 
     46 
     47 def run(machine):
     48     host = hosts.create_host(machine, servo_args=servo_args)
     49     job.run_test('provision_Cr50Update', host=host, cmdline_args=args,
     50                  value=value, release_path=release_path,
     51                  chip_bid_str=chip_bid_str)
     52 
     53 
     54 job.parallel_simple(run, machines)
     55