1# Copyright 2014 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"
8NAME = "enterprise_CFM_USBPeripheralHotplugDetect.c930"
9TIME = "SHORT"
10TEST_CATEGORY = "Functional"
11TEST_CLASS = "enterprise"
12TEST_TYPE = "server"
13ATTRIBUTES = "suite:hotrod"
14DEPENDENCIES = "servo, c930"
15JOB_RETRIES = 3
16
17DOC = """
18This test clears the TPM if necessary, kicks off a client side test that enrolls
19a device as a hotrod device and hotplugs USB peripherals. After hotplug, it
20checks and verifies that both CrOS and Hotrod see the same set of Audio / Video
21peripherals. Clears the TPM again before test exits.
22
23Client side part of the test uses telemetry to query for peripherals detected by
24the hotrod app.
25"""
26
27args_dict = utils.args_to_dict(args)
28servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
29
30def run_test(machine):
31    host = hosts.create_host(machine, servo_args=servo_args)
32    peripheral_whitelist_dict = {'0b0e:0412': 'Jabra SPEAK 410',
33            '046d:0843': 'Logitech Webcam C930e (046d:0843)'}
34    job.run_test('enterprise_CFM_USBPeripheralHotplugDetect', host=host,
35            peripheral_whitelist_dict=peripheral_whitelist_dict, tag="c930")
36
37
38parallel_simple(run_test, machines)
39