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