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 6AUTHOR = "chromeos-lab-infrastructure" 7NAME = "provision_Cr50Update" 8PURPOSE = "Provision a system to the correct firmware version." 9TIME = "MEDIUM" 10TEST_CATEGORY = "System" 11TEST_CLASS = "provision" 12TEST_TYPE = "Server" 13DEPENDENCIES = "servo" 14 15DOC = """ 16This is a test used by the provision control segment in autoserv to set the 17cr50-version label of a host to the desired setting. This test attempts to 18reprogram the cr50 firmware and set the cr50 chip board id using the given 19params in value. value should a string with the 20'prodsigned-rw_ver/image_bid/chip_bid' or 'selfsigned-build_info/chip_bid'. 21build_info is something like 'reef-release/R61-9704.0.0'. For a prodsigned image 22only the rw_ver is manditory. On selfsigned images only the build_info is 23necessary. 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 31from autotest_lib.client.common_lib import error, utils 32 33 34args_dict = utils.args_to_dict(args) 35servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 36 37 38release_path = '' 39chip_bid = '' 40if 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 47def 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 54job.parallel_simple(run, machines) 55