blob: 9507cc53419122278ff0696fffcb2715394726ff [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from autotest_lib.server.cros.cfm.configurable_test.dsl import *
from autotest_lib.server import utils
AUTHOR = ",,"
NAME = "enterprise_CFM_PeripheralQualification.reboot_stress"
PURPOSE = "Stresses a peripheral device by repeatedly rebooting the CfM."
CRITERIA = "The device is detectable as a USB device after reboot"
TEST_TYPE = "server"
DOC = """
Repeatedly reboots the CfM and verifies that the device can be enumerated
after each reboot.
The test requires a vid_pid argument (e.g. 18d1:8001) that determines which
device to detect after reboot. This enables testing custom devices from
Moblab or from a local workstation.
args_dict = utils.args_to_dict(args)
vid,pid = args_dict['vid_pid'].split(':')
# The product is only informational, set it to whatever.
product = args_dict.get('product', 'customProduct')
# Interfaces are only needed when verifying them, set them to empty in this case.
interfaces = []
device = usb_device_spec.UsbDeviceSpec(vid, pid, product, interfaces)
repeat = int(args_dict.get('repeat', 10))
cfm_test = CfmTest(
RepeatTimes(repeat, Scenario(
# TODO( mosys-info always crashes on reboot, why
# we always have new crash files. Enable this check when that is
# fixed.
# AssertNoNewCrashes()
def run_test(machine):
cfm_test = cfm_test,
tag = 'reboot_stress',
host = hosts.create_host(machine))
parallel_simple(run_test, machines)