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 5AUTHOR = "rohitbm@chromium.org, Chrome OS Audio" 6NAME = "audio_PowerConsumption.mp3" 7TIME = "MEDIUM" 8TEST_CATEGORY = "Performance" 9TEST_CLASS = "audio" 10ATTRIBUTES = "suite:bvt-perbuild" 11SUITE = "bvt-perbuild" 12TEST_TYPE = "server" 13DEPENDENCIES = "rpm, power:battery" 14BUG_TEMPLATE = { 15 "labels": ["OS-Chrome", "Cr-OS-Kernel-Audio"], 16} 17 18DOC = """ 19The test outputs the power consumption for various audio formats. 20""" 21 22import logging 23 24from autotest_lib.client.common_lib import error 25 26VIDEO_NAME = "polka_crowd_128kbps_44_1khz.mp3" 27CHECKSUM = "7171529bb34c6e17dd163b03aa2b7c9c" 28 29def _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 44job.parallel_on_machines(_run_client_test, machines) 45