xref: /aosp_15_r20/external/autotest/server/site_tests/power_QualTestWrapper/control.FastLoadTest (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
5AUTHOR = "ChromeOS PVS Team"
6NAME = "power_FastLoadTest"
7PURPOSE = "power_Dummy orchestrated with wrappers for qualification"
8CRITERIA = "This test is a benchmark."
9TIME = "SHORT"
10TEST_CATEGORY = "Benchmark"
11TEST_CLASS = "power"
12TEST_TYPE = "server"
13ATTRIBUTES = ""
14PY_VERSION = 3
15DOC = """
16This is a power_QualTestWrapped example, which uses the QualTestWrapper
17implementation to call a power test, after first calling the standard
18prefix tests for the power_qual sequence. QualTestWrapper inherits from
19pvs.test_with_pass_criteria, which uses either pass criteria passed
20on the command line or the default pass criteria below to pass/fail tests
21based on their key value results written to the results directory.
22
23To create new wrapped Qual Tests, please copy this example file, and
24fill out the TEST_NAME you intend to call, as well as the TEST_ARGS
25dict to be passed to that test.
26"""
27
28from autotest_lib.server import utils
29from autotest_lib.server.cros.pvs import wrapper_job_with_name
30
31args_dict = utils.args_to_dict(args)
32servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
33
34TEST_NAME = "power_LoadTest"
35TEST_ARGS = {"loop_time":120,"loop_count":1,"check_network":False,"ac_ok":True,
36            "gaia_login":False}
37
38DEFAULT_PASS_CRITERIA = {"wh_energy_used":(0,None)}
39
40def run(machine):
41    args_dict["percent_target_charge"] = 65
42
43    # Setup the client machine.
44    host = hosts.create_host(machine, servo_args=servo_args)
45    wrapper_job = wrapper_job_with_name.wrapper_job_with_name(job=job,
46                                    job_name=NAME,
47                                    wrapper_url="power_QualTestWrapper",
48                                    args_dict=args_dict,
49                                    default_pass_criteria=DEFAULT_PASS_CRITERIA)
50    wrapper_job.run(host=host, test_to_wrap=TEST_NAME, wrap_args=TEST_ARGS)
51
52parallel_simple(run, machines)