1# Lint as: python2, python3 2# Copyright 2018 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6"""Wrapper test measures DUT power via servod with Servo devices.""" 7 8from autotest_lib.server.cros.power import power_base_wrapper 9from autotest_lib.server.cros.power import power_telemetry_logger 10 11 12class power_ServodWrapper(power_base_wrapper.PowerBaseWrapper): 13 """Wrapper test around a client test. 14 15 This wrapper test runs 1 client test given by user, and measures DUT power 16 via servod with Servo devices. 17 """ 18 version = 1 19 20 def _get_power_telemetry_logger(self, host, config, resultsdir): 21 """Return powerlog telemetry logger. 22 23 @param host: CrosHost object representing the DUT. 24 @param config: the args argument from test_that in a dict. Settings for 25 power telemetry devices. 26 required data: 27 {'test': 'test_TestName.tag', 28 'servo_host': host of servod instance, 29 'servo_port: port that the servod instance is on} 30 @param resultsdir: path to directory where current autotest results are 31 stored, e.g. /tmp/test_that_results/ 32 results-1-test_TestName.tag/test_TestName.tag/ 33 results/ 34 """ 35 return power_telemetry_logger.ServodTelemetryLogger(config, 36 resultsdir, 37 host) 38