1 # Copyright 2015 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 AUTHOR = "rohitbm (a] chromium.org, Chrome OS Audio" 6 NAME = "audio_PowerConsumption.mp3" 7 TIME = "MEDIUM" 8 TEST_CATEGORY = "Performance" 9 TEST_CLASS = "audio" 10 ATTRIBUTES = "suite:bvt-perbuild" 11 SUITE = "bvt-perbuild" 12 TEST_TYPE = "server" 13 DEPENDENCIES = "rpm, power:battery" 14 BUG_TEMPLATE = { 15 "labels": ["OS-Chrome", "Cr-OS-Kernel-Audio"], 16 } 17 18 DOC = """ 19 The test outputs the power consumption for various audio formats. 20 """ 21 22 import logging 23 24 from autotest_lib.client.common_lib import error 25 26 VIDEO_NAME = "polka_crowd_128kbps_44_1khz.mp3" 27 CHECKSUM = "7171529bb34c6e17dd163b03aa2b7c9c" 28 29 def _run_client_test(machine): 30 """Runs client test with battery actively discharging.""" 31 client = hosts.create_host(machine) 32 if not client.has_power(): 33 raise error.TestError("This test requires RPM support.") 34 35 client.power_off() 36 try: 37 client_at = autotest.Autotest(client) 38 client_at.run_test("audio_PlaybackPower", test_file=VIDEO_NAME, 39 checksum=CHECKSUM) 40 finally: 41 client.power_on() 42 43 44 job.parallel_on_machines(_run_client_test, machines) 45