# Lint as: python3 # Copyright 2022 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from autotest_lib.server import utils AUTHOR = "klug" NAME = "power_PacWrapper" PURPOSE = "Measure power with a pacman debugger while running a client test." CRITERIA = "This test is a wrapper for a client test." TIME = "LONG" TEST_CATEGORY = "Benchmark" TEST_CLASS = "power" TEST_TYPE = "server" DEPENDENCIES = "servo_state:WORKING" PY_VERSION = 3 DOC = """ This wrapper test automates the process of power measurement with a pacman debugger while running a client test. Please check the client test's control file for any hardware requirement, e.g. no AC power, no Ethernet. This test makes the following assumptions: 1. Pacman Debugger is connected to the DUT and can be run manually. 2. The workstation (or where the autotest is kicked off from) should be in same timezone with the DUT. 3. pacman.py is in path and discoverable using shutil.which('pacman.py') Installation: wget https://bootstrap.pypa.io/pip/3.6/get-pip.py sudo python ./get-pip.py pip3 install pandas plotly pyftdi Sample usage: test_that power_PacWrapper --args \ 'test=power_LoadTest.fast config=./boards/skyrim/skyrim_r1_pacs.py \ mapping=./boards/skyrim/skyrim_r1_railmap.csv \ gpio=./boards/skyrim/skyrim_r0_gpio.csv ' What are the parameters: test: the client test to run in wrapper test; DUT power is measured during this client test; required. note: User supplied note to tag the specific test; optional. """ # Workaround to make it compatible with moblab autotest UI. global args_dict try: args_dict except NameError: args_dict = utils.args_to_dict(args) servo_args = hosts.CrosHost.get_servo_arguments(args_dict) def run(machine): host = hosts.create_host(machine, servo_args=servo_args) job.run_test("power_PacWrapper", host=host, config=args_dict) parallel_simple(run, machines)