1# Copyright 2016 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 = "harpreet@chromium.org" 8NAME = "enterprise_CFM_VolumeChange.internal_speaker" 9TIME = "SHORT" 10TEST_CATEGORY = "Functional" 11TEST_CLASS = "enterprise" 12TEST_TYPE = "server" 13ATTRIBUTES = "suite:hotrod" 14DEPENDENCIES = "internal_speaker" 15JOB_RETRIES = 3 16 17DOC = """ 18This test clears the TPM and enables the appropriate usb port on the servo 19before kicking off a client side test that enrolls the device into CFM. Once 20the device in enrolled, a different client test is kicked off to change the 21hangouts volume using hotrod kiosk app JS hooks. These changes are then 22validated against the cras_test_client output to make sure the volume matches. 23""" 24 25args_dict = utils.args_to_dict(args) 26servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 27 28def run_test(machine): 29 host = hosts.create_host(machine, servo_args=servo_args) 30 repeat = int(args_dict.get('repeat', 10)) 31 cmd = "cras_test_client --dump_server_info | awk '/Output Nodes:/," \ 32 "/Input Devices:/' | grep -E 'INTERNAL_*' | awk -v N=3 '{print $N}'" 33 34 job.run_test('enterprise_CFM_VolumeChange', host=host, repeat=repeat, 35 cmd=cmd, tag="internal_speaker") 36 37 38parallel_simple(run_test, machines) 39