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