• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = "wilhelmsson@google.com, kerl@google.com, chromeos-meetings@google.com"
8NAME = "enterprise_CFM_PeripheralQualification.reboot_stress"
9PURPOSE = "Stresses a peripheral device by repeatedly rebooting the CfM."
10CRITERIA = "The device is detectable as a USB device after reboot"
11TIME = "LONG"
12TEST_CATEGORY = "Stress"
13TEST_TYPE = "server"
14
15DOC = """
16Repeatedly reboots the CfM and verifies that the device can be enumerated
17after each reboot.
18
19The test requires a vid_pid argument (e.g. 18d1:8001) that determines which
20device to detect after reboot. This enables testing custom devices from
21Moblab or from a local workstation.
22"""
23
24args_dict = utils.args_to_dict(args)
25vid,pid = args_dict['vid_pid'].split(':')
26# The product is only informational, set it to whatever.
27product = args_dict.get('product', 'customProduct')
28# Interfaces are only needed when verifying them, set them to empty in this case.
29interfaces = []
30device = usb_device_spec.UsbDeviceSpec(vid, pid, product, interfaces)
31repeat = int(args_dict.get('repeat', 10))
32
33cfm_test = CfmTest(
34    configuration=Configuration(skip_enrollment=True),
35    scenario=Scenario(
36        AssertUsbDevices([device]),
37        RepeatTimes(repeat, Scenario(
38            RebootDut(),
39            AssertUsbDevices([device])
40            # TODO(crbug.com/814775): mosys-info always crashes on reboot, why
41            # we always have new crash files. Enable this check when that is
42            # fixed.
43            # AssertNoNewCrashes()
44        ))
45    ),
46)
47
48def run_test(machine):
49    job.run_test("enterprise_CFM_PeripheralQualification",
50                 cfm_test = cfm_test,
51                 tag = 'reboot_stress',
52                 host = hosts.create_host(machine))
53
54parallel_simple(run_test, machines)
55