xref: /aosp_15_r20/external/autotest/server/site_tests/firmware_UpdateKernelDataKeyVersion/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_UpdateKernelDataKeyVersion"
9PURPOSE = """
10Servo based kernel update test which checks the kernel data key version.
11"""
12CRITERIA = """
13This test will fail if one of the following conditions is met:
141. In Normal Mode.
152. After update, device restart with KERNEL A.
163. Kernel datakey version does not increase after update.
174. After recovery, device can't successfully restart.
185. Kernel datakey version does not recover to original version after recovery.
19"""
20ATTRIBUTES = "suite:faft_bios, suite:faft_bios_ro_qual, suite:faft_bios_rw_qual, suite:faft_dev, suite:faft_lv5, suite:faft_bios_tot"
21DEPENDENCIES = "servo_state:WORKING"
22TIME = "SHORT"
23TEST_CATEGORY = "Functional"
24TEST_CLASS = "firmware"
25TEST_TYPE = "server"
26JOB_RETRIES = 0
27PY_VERSION = 3
28
29DOC = """
30This test should run in developer mode. On runtime, this test modifies the
31kernel data key version of kernel b and modifies cgpt to reboot with kernel b.
32Check kernel data key version after reboot, and then recover kernel b's data
33key version to original version. Here also tries to reboot with kernel b after
34recovery. If sccuess, reboot with kernel a.
35"""
36
37args_dict = utils.args_to_dict(args)
38servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
39
40def run_updatekerneldatakeyversion(machine):
41    host = hosts.create_host(machine, servo_args=servo_args)
42    job.run_test("firmware_UpdateKernelDataKeyVersion", host=host,
43                 cmdline_args=args, disable_sysinfo=True, dev_mode=True,
44                 tag="dev")
45
46parallel_simple(run_updatekerneldatakeyversion, machines)
47