xref: /aosp_15_r20/external/autotest/server/site_tests/firmware_FWupdateThenSleep/control.batteryonly (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright (c) 2020 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
5AUTHOR = "ChromeOS Team"
6NAME = "firmware_FWupdateThenSleep.batteryonly"
7ATTRIBUTES = "suite:faft_bios_ro_qual, suite:faft_bios_rw_qual"
8DEPENDENCIES = "servo_state:WORKING"
9TIME = "MEDIUM"
10TEST_CATEGORY = "Functional"
11TEST_CLASS = "firmware"
12TEST_TYPE = "server"
13PY_VERSION = 3
14
15DOC = """
16Run RW firmware update using chromeos-firmwareupdate --mode=recovery --wp=1
17while on battery, then sleep and wake, then make sure the host responds and the
18flash contents don't change.
19
20If running on Servo V4 Type-C with power passthrough, the test can
21change the power supply state.  Otherwise, it will require manually
22removing AC power before starting the test.
23
24Example:
25test_that --board=BOARD --args 'servo_host=SERVO_IP' DUT_IP firmware_FWupdateThenSleep.batteryonly
26"""
27
28from autotest_lib.client.common_lib import utils
29
30args_dict = utils.args_to_dict(args)
31servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
32pdtester_args = hosts.CrosHost.get_pdtester_arguments(args_dict)
33
34def run_firmwareupdate(machine):
35    # Setup the client machine.
36    host = hosts.create_host(machine, servo_args=servo_args,
37                             pdtester_args=pdtester_args)
38    job.run_test('firmware_FWupdateThenSleep', host=host, cmdline_args=args,
39                 battery_only=True, wp=1)
40
41parallel_simple(run_firmwareupdate, machines)
42