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_PowerlogWrapper.moblab" 9PURPOSE = "Measure power with powerlog tool while running a client test." 10CRITERIA = "This test is a wrapper for a client test." 11ATTRIBUTES = "suite:power_measurement_wrapper" 12TIME = "LONG" 13TEST_CATEGORY = "Benchmark" 14TEST_CLASS = "power" 15TEST_TYPE = "server" 16REQUIRE_SSP = False 17 18DOC = """ 19This wrapper test automates the process of power measurement with powerlog tool 20while running a client test. Please check the client test's control file for any 21hardware requirement, e.g. no AC power, no Ethernet. 22 23This test makes the following assumptions: 241. Sweetberry config files are in directory 25/usr/lib64/python2.7/site-packages/servo/data/ 26For example, 27/usr/lib64/python2.7/site-packages/servo/data/eve_rev7.board 28/usr/lib64/python2.7/site-packages/servo/data/eve_rev7.scenario 29 302. The workstation (or where the autotest is kicked off from) should be in same 31timezone with the DUT. 32 33Sample usage: 34test_that <ip address of DUT> power_PowerlogWrapper --args \ 35'test=power_LoadTest.fast sweetberry_interval=1 sweetberry_config=eve_rev7' 36 37What are the parameters: 38test: the client test to run in wrapper test; DUT power is measured during this 39 client test; required. 40sweetberry_interval: number of seconds between each Sweetberry measurement; 41 optional. 42sweetberry_config: use [].board and [].scenario as configuration file for 43 Sweetberry measurement; optional. 44sweetberry_serial: serial number of sweetberry to use; If not supplied use 45 the first sweetberry found; optional. 46pdash_note: User supplied note to tag the specific test; optional. 47""" 48 49# Intended for use with Moblab UI. 50args_dict = utils.args_to_dict(args) 51 52def run(machine): 53 job.run_test('power_PowerlogWrapper', host=hosts.create_host(machine), 54 config=args_dict) 55 56parallel_simple(run, machines) 57