xref: /aosp_15_r20/external/autotest/server/site_tests/firmware_UpdateFirmwareDataKeyVersion/control (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright (c) 2012 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_UpdateFirmwareDataKeyVersion"
9PURPOSE = """
10Servo based firmware update test which check firmware datakey version.
11"""
12CRITERIA = """
13Prerequirement is as follow:
141.The fwid should matches shellball's (/usr/sbin/chromeos-firmwareupdate) fwid,
15  unless this test use a given shellball.
162. A USB disk should be plugged-in, which contains a ChromeOS test image.
17
18This test will fail if following requrements are met:
191. fwid does not match shellball's (/usr/sbin/chromeos-firmwareupdate) fwid
202. Firmware datakey version does not match original datakey version.
21"""
22ATTRIBUTES = "suite:faft_bios, suite:faft_bios_ro_qual, suite:faft_bios_rw_qual, suite:faft_normal, suite:faft_lv5, suite:faft_bios_tot"
23DEPENDENCIES = "servo_state:WORKING, servo_usb_state:NORMAL"
24TIME = "SHORT"
25TEST_CATEGORY = "Functional"
26TEST_CLASS = "firmware"
27TEST_TYPE = "server"
28JOB_RETRIES = 0
29PY_VERSION = 3
30
31DOC = """
32This test requires a USB test image plugged in. The firmware id
33should matches fwid of shellball chromeos-firmwareupdate, or user can
34provide a shellball to do this test. In this way, the client will be update
35with the given shellball first. On runtime, this test modifies shellball
36and runs autoupdate. Check firmware datakey version after boot with
37firmware B, and then recover firmware A and B to original shellball.
38"""
39
40args_dict = utils.args_to_dict(args)
41servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
42
43def run_updatefirmwaredatakeyversion(machine):
44    host = hosts.create_host(machine, servo_args=servo_args)
45    job.run_test("firmware_UpdateFirmwareDataKeyVersion",
46                 host=host, cmdline_args=args,
47                 disable_sysinfo=True)
48
49parallel_simple(run_updatefirmwaredatakeyversion, machines)
50