blob: ed791f3b42b10afab1dfc1994923c8c99d294efd [file] [log] [blame]
# Copyright 2012 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from autotest_lib.server import utils
NAME = "platform_ExternalUsbPeripherals"
METADATA = {
"contacts": ["chromeos-usb@google.com"],
"bug_component": "b:958036",
"criteria": "Test fails if USB enumeration check fails.",
"hw_agnostic": False,
"doc" : "Control file for running in USB HTL lab.",
}
TEST_TYPE = "server"
DEPENDENCIES = "servo_state:WORKING"
DOC = """
This test uses servo to connect/disconnect servo USB hub before and
after events like reboot, login, suspend, resume etc.
The test fails if
- crash files are generated
- device is pingable when suspended
- wrong action passed through action_sequence flag
- USB detected peripherals are different than expected
- there is no servo board attached
"""
args_dict = utils.args_to_dict(args)
servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
def run(machine):
host = hosts.create_host(machine, servo_args=servo_args)
repeat = int(args_dict.get("repeat", 10))
default_actions = str("reboot,unplug,plug,login,unplug,plug,"
"suspend,resume,unplug,suspend,plug,resume,"
"suspend,unplug,resume,plug")
action_sequence = str(args_dict.get("action_sequence", default_actions))
job.run_test("platform_ExternalUsbPeripherals", host=host,
disable_sysinfo=True, client_autotest="desktopui_SimpleLogin",
action_sequence=action_sequence, repeat=repeat)
parallel_simple(run, machines)