xref: /aosp_15_r20/external/autotest/server/site_tests/power_QualTestWrapper/power_QualTestWrapper.py (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 2022 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
5from autotest_lib.server.cros.pvs import test_with_pass_criteria
6
7HOURS = 60 * 60
8
9
10class power_QualTestWrapper(test_with_pass_criteria.test_with_pass_criteria):
11    """
12    power_QualTestWrapper extends test_with_pass_criteria for the purpose of
13    power qualification testing. We use the add_prefix_test method to add the
14    two tests which must run before each power qualification test
15    """
16
17    version = 1
18
19    def initialize(self, **args_dict):
20        """
21        initialize implements the initialize call in test.test, is called before
22        execution of the test. In this wrapper, initialize also adds the test
23        prefixes necessary for the power_Qual tests
24        """
25        super(power_QualTestWrapper,
26              self).initialize(test_to_wrap=args_dict['test_to_wrap'])
27        self.add_prefix_test(
28                'power_BatteryCharge', {
29                        'percent_target_charge':
30                        args_dict['percent_target_charge'],
31                        'max_run_time': 5 * HOURS,
32                        'timeout': 6 * HOURS
33                })
34        self.add_prefix_test('power_WaitForCoolDown', {'target_temp': 48})
35