1# Copyright 2018 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.
4from autotest_lib.server.cros.cfm.configurable_test.dsl import *
5from autotest_lib.server import utils
6
7AUTHOR = "kerl@google.com, chromeos-meetings@google.com"
8NAME = "enterprise_CFM_LowLevelPeripheralTest.reboot_stress"
9PURPOSE = "Stresses peripheral devices by repeatedly rebooting the DUT."
10CRITERIA = ("Atrus,Mimo, and Huddly detectable as USB devices after reboot "
11            "and no crash files appear")
12ATTRIBUTES = "suite:bluestreak"
13TIME = "MEDIUM"
14TEST_CATEGORY = "Stress"
15TEST_TYPE = "server"
16DEPENDENCIES="atrus,mimo,huddly"
17
18DOC = """
19Repeatedly reboots the DUT and verifies that the Atrus device can be enumerated
20after each reboot.
21"""
22
23cfm_test = CfmTest(
24    configuration=Configuration(skip_enrollment=True),
25    scenario=Scenario(
26        AssertUsbDevices([ATRUS]),
27        AssertUsbDevices(ALL_MIMO_DISPLAYS),
28        AssertUsbDevices([HUDDLY_GO]),
29        RepeatTimes(10, Scenario(
30            RebootDut(),
31            AssertUsbDevices([ATRUS]),
32            AssertUsbDevices(ALL_MIMO_DISPLAYS),
33            AssertUsbDevices([HUDDLY_GO]),
34            # TODO(crbug.com/814775): mosys-info always crashes on reboot, why
35            # we always have new crash files. Enable this check when that is
36            # fixed.
37            # AssertNoNewCrashes()
38        ))
39    ),
40)
41
42args_dict = utils.args_to_dict(args)
43servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
44def run_test(machine):
45    job.run_test("enterprise_CFM_LowLevelPeripheralTest",
46                 cfm_test = cfm_test,
47                 tag = 'reboot_stress',
48                 host = hosts.create_host(machine, servo_args=servo_args))
49
50parallel_simple(run_test, machines)
51