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 5from autotest_lib.server import utils 6 7AUTHOR = "mruthven" 8NAME = "firmware_Cr50BID" 9PURPOSE = "Verify cr50 response to board id" 10ATTRIBUTES = "suite:faft_cr50_experimental" 11TIME = "LONG" 12TEST_TYPE = "server" 13DEPENDENCIES = "servo_state:WORKING" 14PY_VERSION = 3 15 16DOC = """ 17Verify cr50 board id behavior on a board id locked image. 18 19Check that cr50 will not accept mismatched board ids when it is running a board 20id locked image. This test will only run if the running image has a non-zero 21board id. If the image isn't board id locked, it won't reject anything, so this 22test wouldn't be useful. 23 24Set the board id on a non board id locked image and verify cr50 will rollback 25when it is updated to a mismatched board id image. 26 27The DBG image path is optional. If it's not given, the test will download the 28image from google storage. 29 30@param iterations: Number of times to run the test 31@param cr50_dbg_image_path: local path for the dev image 32@param basic: True if the test should just use test cases to do basic 33 verification. 34""" 35 36if 'args_dict' not in locals(): 37 args_dict = {} 38 39args_dict.update(utils.args_to_dict(args)) 40servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 41 42def run(machine): 43 host = hosts.create_host(machine, servo_args=servo_args) 44 45 iterations = int(args_dict.get("iterations", 1)) 46 basic = args_dict.get("basic", "").lower() == 'true' 47 48 job.run_test("firmware_Cr50BID", host=host, cmdline_args=args, 49 iterations=iterations, basic=basic, full_args=args_dict) 50 51parallel_simple(run, machines) 52