1# Copyright (c) 2019 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 = "ChromeOS Team" 8NAME = "firmware_SetSerialNumber" 9PURPOSE = "Servo based test to set serial number in firmware." 10CRITERIA = """ 11This test will fail if after setting the serial number in firmware: 12* The device is not in normal mode 13* The serial number is not set in VPD 14* Flash write protect is not enabled 15""" 16ATTRIBUTES = "" 17DEPENDENCIES = "servo_state:WORKING" 18TIME = "SHORT" 19TEST_CATEGORY = "Functional" 20TEST_CLASS = "firmware" 21TEST_TYPE = "server" 22JOB_RETRIES = 0 23PY_VERSION = 3 24 25DOC = """ 26Test that setting the serial number in firmware during an onsite RMA works. 27Mainboards for onsite RMA will have WP# asserted, flash WP bit cleared, 28the serial_number in VPD set to all spaces, and be in dev mode. After the 29serial number is set in firmware flash write protect will be enabled and 30the device will be in normal mode. 31""" 32 33args_dict = utils.args_to_dict(args) 34servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 35 36def run_SetSerialNumber(machine): 37 host = hosts.create_host(machine, servo_args=servo_args) 38 job.run_test("firmware_SetSerialNumber", host=host, cmdline_args=args, 39 disable_sysinfo=True, tag="dev") 40 41parallel_simple(run_SetSerialNumber, machines) 42