xref: /aosp_15_r20/external/autotest/server/site_tests/sequences/control.thermal_qual_fast (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.fast"
7ATTRIBUTES = "suite:thermal_qual_fast"
8TIME = "SHORT"
9TEST_CATEGORY = "Stress"
10TEST_CLASS = "suite"
11TEST_TYPE = "server"
12PY_VERSION = 3
13
14DOC = """
15Make sure that ThermalQual.full works.
16"""
17
18import datetime
19from autotest_lib.client.common_lib import utils
20
21# Need separate list for client and server test due to how these test work.
22CLIENT_TESTS = [
23    ('power_Speedometer2', {
24        'tag' : 'thermal_qual_fast_before'
25    }),
26    ('power_BatteryCharge', {
27        'percent_target_charge' : 10, 'max_run_time': 600
28    }),
29    ('power_ThermalLoad', {
30        'tag' : 'fast', 'force_discharge' : True, 'duration': 180,
31        'second_period' : 1
32    }),
33    ('power_BatteryDrain', {
34        'force_discharge' : True, 'drain_to_percent' : 99, 'drain_timeout': 600
35    }),
36    ('power_WaitForCoolDown', {}),
37    ('power_VideoCall', {
38        'tag' : 'fast', 'duration': 180, 'second_period' : 5
39    }),
40    ('power_Speedometer2', {
41        'tag' : 'thermal_qual_fast_after'
42    }),
43]
44
45# Workaround to make it compatible with moblab autotest UI.
46global args_dict
47try:
48    args_dict
49except NameError:
50    args_dict = utils.args_to_dict(args)
51
52# Use time as pdash_note if not supplied to track all tests in same suite.
53pdash_note = args_dict.get('pdash_note',
54                           NAME + '_' + datetime.datetime.utcnow().isoformat())
55
56def run_client_test(machine):
57    client = hosts.create_host(machine)
58    client_at = autotest.Autotest(client)
59
60    for test, argv in CLIENT_TESTS:
61        argv['pdash_note'] = pdash_note
62        client_at.run_test(test, **argv)
63
64job.parallel_on_machines(run_client_test, machines)
65