xref: /aosp_15_r20/external/autotest/server/site_tests/firmware_Cr50DeepSleepStress/control.reboot (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 2017 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 = "mruthven"
8NAME = "firmware_Cr50DeepSleepStress.reboot"
9PURPOSE = "Verify deep sleep"
10ATTRIBUTES = "suite:faft_cr50_pvt, suite:faft_cr50_prepvt"
11TIME = "LONG"
12TEST_TYPE = "server"
13DEPENDENCIES = "servo_state:WORKING"
14PY_VERSION = 3
15
16DOC = """
17Cr50 should enter deep sleep every time the system goes into S5. Run
18power_SuspendStress and verify the deep sleep count matches the number of
19suspend iterations.
20"""
21
22args_dict = utils.args_to_dict(args)
23servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
24
25def run(machine):
26    host = hosts.create_host(machine, servo_args=servo_args)
27
28    basic = args_dict.get("basic", "").lower() == "true"
29    default_count = 10 if basic else 100
30    suspend_count = int(args_dict.get("suspend_count", default_count))
31    reset_type = args_dict.get("reset_type", "reboot")
32
33    job.run_test("firmware_Cr50DeepSleepStress", host=host, cmdline_args=args,
34                 suspend_count=suspend_count, reset_type=reset_type)
35
36parallel_simple(run, machines)
37