Puthikorn Voravootivat | 3f8a569 | 2020-01-23 16:33:08 -0800 | [diff] [blame^] | 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 | |
| 5 | AUTHOR = "puthik" |
| 6 | NAME = "ThermalQual.full" |
| 7 | TIME = "LENGTHY" |
| 8 | TEST_CATEGORY = "Stress" |
| 9 | TEST_CLASS = "suite" |
| 10 | TEST_TYPE = "server" |
| 11 | DOC = """ |
| 12 | Sequence for qualification for thermal. |
| 13 | """ |
| 14 | |
| 15 | from autotest_lib.client.common_lib import utils |
| 16 | |
| 17 | HOURS=60*60 |
| 18 | |
| 19 | # Need separate list for client and server test due to how these test work. |
| 20 | CLIENT_TESTS = [ |
| 21 | ('power_WaitForCoolDown', {}), |
| 22 | ('power_Speedometer2', {'tag' : 'thermal_qual_full_before'}), |
| 23 | |
| 24 | ('power_BatteryCharge', { |
| 25 | 'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}), |
| 26 | ('power_WaitForCoolDown', {}), |
| 27 | ('power_ThermalLoad', { |
| 28 | 'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}), |
| 29 | ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_discharge'}), |
| 30 | |
| 31 | ('power_BatteryCharge', { |
| 32 | 'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}), |
| 33 | ('power_WaitForCoolDown', {}), |
| 34 | ('power_VideoCall', { |
| 35 | 'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}), |
| 36 | ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_discharge'}), |
| 37 | |
| 38 | ('power_BatteryDrain', { |
| 39 | 'force_discharge' : True, 'drain_to_percent' : 30, |
| 40 | 'drain_timeout': 5 * HOURS}), |
| 41 | ('power_WaitForCoolDown', {}), |
| 42 | ('power_ThermalLoad', {'tag' : 'thermal_qual_full_charge'}), |
| 43 | ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_charge'}), |
| 44 | |
| 45 | ('power_BatteryDrain', { |
| 46 | 'force_discharge' : True, 'drain_to_percent' : 30, |
| 47 | 'drain_timeout': 5 * HOURS}), |
| 48 | ('power_WaitForCoolDown', {}), |
| 49 | ('power_VideoCall', {'tag' : 'thermal_qual_full_charge'}), |
| 50 | ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_charge'}) |
| 51 | ] |
| 52 | |
| 53 | # Workaround to make it compatible with moblab autotest UI. |
| 54 | global args_dict |
| 55 | try: |
| 56 | args_dict |
| 57 | except NameError: |
| 58 | args_dict = utils.args_to_dict(args) |
| 59 | |
| 60 | pdash_note = args_dict.get('pdash_note', '') |
| 61 | |
| 62 | def run_client_test(machine): |
| 63 | client = hosts.create_host(machine) |
| 64 | client_at = autotest.Autotest(client) |
| 65 | |
| 66 | for test, argv in CLIENT_TESTS: |
| 67 | argv['pdash_note'] = pdash_note |
| 68 | client_at.run_test(test, **argv) |
| 69 | |
| 70 | job.parallel_on_machines(run_client_test, machines) |