• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = "mqg"
8NAME = "power_ChargeControlWrapper"
9PURPOSE = "Use Servo v4 to control charging / discharging the DUT"
10TIME = "LONG"
11TEST_CATEGORY = "Functional"
12TEST_CLASS = "power"
13TEST_TYPE = "server"
14DEPENDENCIES = "servo_state:WORKING"
15
16DOC = """
17DUT is connected to Servo v4 via USB type-C, and Servo v4 is connected to AC
18power.
19
20Sample usage:
21test_that <ip address of DUT> power_ChargeControlWrapper \
22--args 'servo_host=localhost servo_port=9999 test=power_Dummy'
23
24What are the parameters:
25test: the client test to run in wrapper test; required.
26servo_host: host of servod instance; required.
27servo_port: port that the servod instance is on; required.
28"""
29
30# Workaround to make it compatible with moblab autotest UI.
31global args_dict
32try:
33    args_dict
34except NameError:
35    args_dict = utils.args_to_dict(args)
36
37servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
38
39def run(machine):
40    host = hosts.create_host(machine, servo_args=servo_args)
41    job.run_test("power_ChargeControlWrapper", host=host, config=args_dict)
42
43parallel_simple(run, machines)
44