• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 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 = "mzhuo@chromium.org"
8NAME = "enterprise_CFM_USBPeripheralRebootStress"
9TIME = "LONG"
10TEST_CATEGORY = "Functional"
11TEST_CLASS = "enterprise"
12TEST_TYPE = "server"
13ATTRIBUTES = "suite:hotrod"
14JOB_RETRIES = 1
15
16DOC = """
17This test initially checks the number of USB devices connected to CFM.
18Verify Hotrod can detect speaker, mic and camera. If not, test is aborted.
19After that the test will run number of loops where it does:
201. Join a hangout session
212. leave hangout session
223. Check number of USBPeripheral devices and compare it to the initial ones. If
23   difference is detected test will report failure.
244. Repeat 1, 2 and 3 for random times
254. Reboot CfM
264. Check number of USBPeripheral devices and compare it to the initial ones. If
27   difference is detected test will report failure.
285. Verify Hotrod can detect speaker, mic and camera. If any of these missing
29   test will report failure.
30"""
31
32args_dict = utils.args_to_dict(args)
33servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
34
35def run_test(machine):
36    repeat = int(args_dict.get('repeat', 100))
37    hangout = args_dict.get('hangout', 'cfm-usb-test')
38    host = hosts.create_host(machine, servo_args=servo_args)
39    job.run_test('enterprise_CFM_USBPeripheralRebootStress',
40                 host=host, hangout=hangout, repeat=repeat)
41
42parallel_simple(run_test, machines)