Home | History | Annotate | Download | only in enterprise_CFM_VolumeChange
      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 
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "harpreet (a] chromium.org"
      8 NAME = "enterprise_CFM_VolumeChange.internal_speaker"
      9 TIME = "SHORT"
     10 TEST_CATEGORY = "Functional"
     11 TEST_CLASS = "enterprise"
     12 TEST_TYPE = "server"
     13 ATTRIBUTES = "suite:hotrod"
     14 DEPENDENCIES = "internal_speaker"
     15 JOB_RETRIES = 3
     16 
     17 DOC = """
     18 This test clears the TPM and enables the appropriate usb port on the servo
     19 before kicking off a client side test that enrolls the device into CFM. Once
     20 the device in enrolled, a different client test is kicked off to change the
     21 hangouts volume using hotrod kiosk app JS hooks. These changes are then
     22 validated against the cras_test_client output to make sure the volume matches.
     23 """
     24 
     25 args_dict = utils.args_to_dict(args)
     26 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     27 
     28 def 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 
     38 parallel_simple(run_test, machines)
     39