• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"
12DOC = """
13Sequence for qualification for thermal.
14"""
15
16import datetime
17from autotest_lib.client.common_lib import utils
18
19HOURS=60*60
20
21# Need separate list for client and server test due to how these test work.
22CLIENT_TESTS = [
23    ('power_WaitForCoolDown', {}),
24    ('power_Speedometer2', {'tag' : 'thermal_qual_full_before'}),
25
26    ('power_BatteryCharge', {
27        'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}),
28    ('power_WaitForCoolDown', {}),
29    ('power_ThermalLoad', {
30        'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}),
31    ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_discharge'}),
32
33    ('power_BatteryCharge', {
34        'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}),
35    ('power_WaitForCoolDown', {}),
36    ('power_VideoCall', {
37        'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}),
38    ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_discharge'}),
39
40    ('power_BatteryDrain', {
41        'force_discharge' : True, 'drain_to_percent' : 30,
42        'drain_timeout': 5 * HOURS}),
43    ('power_WaitForCoolDown', {}),
44    ('power_ThermalLoad', {'tag' : 'thermal_qual_full_charge'}),
45    ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_charge'}),
46
47    ('power_BatteryDrain', {
48        'force_discharge' : True, 'drain_to_percent' : 30,
49        'drain_timeout': 5 * HOURS}),
50    ('power_WaitForCoolDown', {}),
51    ('power_VideoCall', {'tag' : 'thermal_qual_full_charge'}),
52    ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_charge'})
53]
54
55# Workaround to make it compatible with moblab autotest UI.
56global args_dict
57try:
58    args_dict
59except NameError:
60    args_dict = utils.args_to_dict(args)
61
62# Use time as pdash_note if not supplied to track all tests in same suite.
63pdash_note = args_dict.get('pdash_note',
64                           NAME + '_' + datetime.datetime.utcnow().isoformat())
65
66def run_client_test(machine):
67    client = hosts.create_host(machine)
68    client_at = autotest.Autotest(client)
69
70    for test, argv in CLIENT_TESTS:
71        argv['pdash_note'] = pdash_note
72        client_at.run_test(test, **argv)
73
74job.parallel_on_machines(run_client_test, machines)
75