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"""Wrapper test measures DUT power via servod with Servo devices.""" 6 7from autotest_lib.server.cros.power import power_base_wrapper 8from autotest_lib.server.cros.power import power_telemetry_logger 9 10 11class power_ServodWrapper(power_base_wrapper.PowerBaseWrapper): 12 """Wrapper test around a client test. 13 14 This wrapper test runs 1 client test given by user, and measures DUT power 15 via servod with Servo devices. 16 """ 17 version = 1 18 19 def _get_power_telemetry_logger(self, host, config, resultsdir): 20 """Return powerlog telemetry logger. 21 22 @param host: CrosHost object representing the DUT. 23 @param config: the args argument from test_that in a dict. Settings for 24 power telemetry devices. 25 required data: 26 {'test': 'test_TestName.tag', 27 'servo_host': host of servod instance, 28 'servo_port: port that the servod instance is on} 29 @param resultsdir: path to directory where current autotest results are 30 stored, e.g. /tmp/test_that_results/ 31 results-1-test_TestName.tag/test_TestName.tag/ 32 results/ 33 """ 34 return power_telemetry_logger.ServodTelemetryLogger(config, 35 resultsdir, 36 host) 37