Home | History | Annotate | Download | only in enterprise_CFM_USBPeripheralRebootStress
      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 
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "mzhuo (a] chromium.org"
      8 NAME = "enterprise_CFM_USBPeripheralRebootStress"
      9 TIME = "LONG"
     10 TEST_CATEGORY = "Functional"
     11 TEST_CLASS = "enterprise"
     12 TEST_TYPE = "server"
     13 ATTRIBUTES = "suite:hotrod"
     14 JOB_RETRIES = 1
     15 
     16 DOC = """
     17 This test initially checks the number of USB devices connected to CFM.
     18 Verify Hotrod can detect speaker, mic and camera. If not, test is aborted.
     19 After that the test will run number of loops where it does:
     20 1. Join a hangout session
     21 2. leave hangout session
     22 3. Check number of USBPeripheral devices and compare it to the initial ones. If
     23    difference is detected test will report failure.
     24 4. Repeat 1, 2 and 3 for random times
     25 4. Reboot CfM
     26 4. Check number of USBPeripheral devices and compare it to the initial ones. If
     27    difference is detected test will report failure.
     28 5. Verify Hotrod can detect speaker, mic and camera. If any of these missing
     29    test will report failure.
     30 """
     31 
     32 args_dict = utils.args_to_dict(args)
     33 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     34 
     35 def run_test(machine):
     36     repeat = int(args_dict.get('repeat', 30))
     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,
     41                  hangout=hangout,
     42                  reboot_cycles=repeat)
     43 
     44 parallel_simple(run_test, machines)
     45