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,cr50-ro-keyid:prod" 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 'image_rw_ver/image_bid'. 20value is completely ignored if a valid release_path is given. 21 22@param value: the release image information. Ignored if release_path is given 23@param release_path: local path to release image 24@param cr50_dbg_image_path: local path to DBG image 25""" 26 27from autotest_lib.client.common_lib import error, utils 28 29if 'args_dict' not in locals(): 30 args_dict = {} 31 32args_dict.update(utils.args_to_dict(args)) 33servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 34 35release_path = '' 36chip_bid = '' 37if not locals().get('value'): 38 value = args_dict.get('value', '') 39 release_path = args_dict.get('release_path', '') 40 41 42force = args_dict.get("force", "").lower() == "true" 43 44def run(machine): 45 host = hosts.create_host(machine, servo_args=servo_args) 46 job.run_test('provision_Cr50Update', host=host, cmdline_args=args, 47 full_args=args_dict, value=value, release_path=release_path, 48 force=force) 49 50job.parallel_simple(run, machines) 51