xref: /aosp_15_r20/external/autotest/server/site_tests/sequences/control.thermal_qual_full (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 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 = "puthik"
6NAME = "ThermalQual.full"
7ATTRIBUTES = "suite:thermal_qual_full"
8TIME = "LENGTHY"
9TEST_CATEGORY = "Stress"
10TEST_CLASS = "suite"
11TEST_TYPE = "server"
12EXTENDED_TIMEOUT = 18900  # 5 Hours + 900 second guard.
13PY_VERSION = 3
14
15DOC = """
16Sequence for qualification for thermal.
17"""
18
19import datetime
20from autotest_lib.client.common_lib import utils
21
22HOURS=60*60
23
24# Need separate list for client and server test due to how these test work.
25CLIENT_TESTS = [
26    ('power_WaitForCoolDown', {}),
27    ('power_Speedometer2', {'tag' : 'thermal_qual_full_before'}),
28
29    ('power_BatteryCharge', {
30        'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}),
31    ('power_WaitForCoolDown', {}),
32    ('power_ThermalLoad', {
33        'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}),
34    ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_discharge'}),
35
36    ('power_BatteryCharge', {
37        'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}),
38    ('power_WaitForCoolDown', {}),
39    ('power_VideoCall', {
40        'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}),
41    ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_discharge'}),
42
43    ('power_BatteryDrain', {
44        'force_discharge' : True, 'drain_to_percent' : 30,
45        'drain_timeout': 5 * HOURS}),
46    ('power_WaitForCoolDown', {}),
47    ('power_ThermalLoad', {'tag' : 'thermal_qual_full_charge'}),
48    ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_charge'}),
49
50    ('power_BatteryDrain', {
51        'force_discharge' : True, 'drain_to_percent' : 30,
52        'drain_timeout': 5 * HOURS}),
53    ('power_WaitForCoolDown', {}),
54    ('power_VideoCall', {'tag' : 'thermal_qual_full_charge'}),
55    ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_charge'})
56]
57
58# Workaround to make it compatible with moblab autotest UI.
59global args_dict
60try:
61    args_dict
62except NameError:
63    args_dict = utils.args_to_dict(args)
64
65# Use time as pdash_note if not supplied to track all tests in same suite.
66pdash_note = args_dict.get('pdash_note',
67                           NAME + '_' + datetime.datetime.utcnow().isoformat())
68
69def run_client_test(machine):
70    client = hosts.create_host(machine)
71    client_at = autotest.Autotest(client)
72
73    for test, argv in CLIENT_TESTS:
74        argv['pdash_note'] = pdash_note
75        client_at.run_test(test, timeout=EXTENDED_TIMEOUT, **argv)
76
77job.parallel_on_machines(run_client_test, machines)
78