| # Copyright 2020 The ChromiumOS Authors |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| NAME = "ThermalQual.full" |
| METADATA = { |
| "contacts": ["chromeos-platform-power@google.com"], |
| "author": "puthik", |
| "bug_component": "b:1361410", |
| "criteria": "This test is a benchmark test", |
| "hw_agnostic": False, |
| } |
| ATTRIBUTES = "suite:thermal_qual_full" |
| TIME = "LENGTHY" |
| TEST_CATEGORY = "Stress" |
| TEST_CLASS = "suite" |
| TEST_TYPE = "server" |
| EXTENDED_TIMEOUT = 18900 # 5 Hours + 900 second guard. |
| PY_VERSION = 3 |
| |
| DOC = """ |
| Sequence for qualification for thermal. |
| """ |
| |
| import datetime |
| import os |
| from autotest_lib.client.common_lib import utils |
| from autotest_lib.client.cros.power import power_dashboard |
| |
| HOURS=60*60 |
| |
| # Need separate list for client and server test due to how these test work. |
| CLIENT_TESTS = [ |
| ('power_BatteryDrain', { |
| 'force_discharge' : True, 'drain_to_percent' : 70, |
| 'drain_timeout': 3 * HOURS}), |
| ('power_BatteryCharge', { |
| 'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}), |
| ('power_WaitForCoolDown', {}), |
| ('power_Speedometer2', {'tag' : 'thermal_qual_full_before'}), |
| |
| ('power_ThermalLoad', { |
| 'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}), |
| ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_discharge'}), |
| |
| ('power_BatteryCharge', { |
| 'percent_target_charge' : 70, 'max_run_time': 5 * HOURS}), |
| ('power_WaitForCoolDown', {}), |
| ('power_VideoCall', { |
| 'tag' : 'thermal_qual_full_discharge', 'force_discharge' : True}), |
| ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_discharge'}), |
| |
| ('power_BatteryDrain', { |
| 'force_discharge' : True, 'drain_to_percent' : 30, |
| 'drain_timeout': 7 * HOURS}), |
| ('power_WaitForCoolDown', {}), |
| ('power_ThermalLoad', {'tag' : 'thermal_qual_full_charge'}), |
| ('power_Speedometer2', {'tag' : 'thermal_qual_full_ThermalLoad_charge'}), |
| |
| ('power_BatteryDrain', { |
| 'force_discharge' : True, 'drain_to_percent' : 30, |
| 'drain_timeout': 7 * HOURS}), |
| ('power_WaitForCoolDown', {}), |
| ('power_VideoCall', {'tag' : 'thermal_qual_full_charge'}), |
| ('power_Speedometer2', {'tag' : 'thermal_qual_full_VideoCall_charge'}) |
| ] |
| |
| # Workaround to make it compatible with moblab autotest UI. |
| global args_dict |
| try: |
| args_dict |
| except NameError: |
| args_dict = utils.args_to_dict(args) |
| |
| # Use time as pdash_note if not supplied to track all tests in same suite. |
| pdash_note = args_dict.get('pdash_note', |
| NAME + '_' + datetime.datetime.utcnow().isoformat()) |
| |
| def run_client_test(machine): |
| client = hosts.create_host(machine) |
| client_at = autotest.Autotest(client) |
| |
| for test, argv in CLIENT_TESTS: |
| argv['pdash_note'] = pdash_note |
| client_at.run_test(test, timeout=EXTENDED_TIMEOUT, **argv) |
| |
| power_dashboard.generate_parallax_report(output_dir=os.getcwd(), |
| local_dir=os.getcwd(), testname='ThermalQual') |
| |
| job.parallel_on_machines(run_client_test, machines) |