xref: /aosp_15_r20/external/autotest/server/site_tests/power_BatteryChargeControl/control.charge70 (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright 2018 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 import utils
6
7AUTHOR = "ChromeOS Team"
8NAME = "power_BatteryChargeControl.charge70"
9PURPOSE = "Use Servo v4 to charge the DUT"
10CRITERIA = ""
11TIME = "LONG"
12TEST_CATEGORY = "Functional"
13TEST_CLASS = "power"
14TEST_TYPE = "server"
15DEPENDENCIES = "servo_state:WORKING"
16PY_VERSION = 3
17
18DOC = """
19Use Servo v4 to charge the DUT to 70% battery capacity.
20DUT is connected to Servo v4 via USB type-C, and Servo v4 is connected to AC
21power.
22
23Sample usage:
24test_that <ip address of DUT> power_BatteryChargeControl.charge70 \
25--args 'servo_host=localhost servo_port=9999'
26"""
27
28args_dict = utils.args_to_dict(args)
29servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
30
31def run(machine):
32    host = hosts.create_host(machine, servo_args=servo_args)
33    job.run_test("power_BatteryChargeControl",
34                 tag=NAME.split('.')[1],
35                 host=host,
36                 percent_charge_to_add=None,
37                 percent_target_charge=70)
38
39parallel_simple(run, machines)
40