1 # Copyright (c) 2015 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 = "Chrome OS Team" 8 NAME = "ExternalUsbPeripherals.CRASHES" 9 PURPOSE = "Servo based USB boot stress test" 10 CRITERIA = "This test will fail if any of the actions or checks fail." 11 TIME = "LONG" 12 TEST_CATEGORY = "Functional" 13 TEST_CLASS = "platform" 14 TEST_TYPE = "server" 15 ATTRIBUTES = "suite:kernel_usb" 16 SUITE = "kernel_usb" 17 DEPENDENCIES = "servo" 18 19 DOC = """ 20 This test uses servo to connect/disconnect servo USB hub before and 21 after events like reboot, login, suspend, resume etc. 22 23 The test fails if 24 - crash files are generated 25 - device is pingable when suspended 26 - wrong action passed through action_sequence flag 27 - USB detected peripherals are different than expected 28 """ 29 30 args_dict = utils.args_to_dict(args) 31 servo_args = hosts.CrosHost.get_servo_arguments(args_dict) 32 33 def run(machine): 34 host = hosts.create_host(machine, servo_args=servo_args) 35 36 repeat = int(args_dict.get("repeat", 1)) 37 default_actions = str("reboot,unplug,plug,login,unplug,plug," 38 "suspend,resume,unplug,suspend,plug,resume," 39 "suspend,unplug,resume,plug,reboot") 40 41 action_sequence = str(args_dict.get("action_sequence", default_actions)) 42 43 job.run_test("platform_ExternalUsbPeripherals", host=host, 44 disable_sysinfo=True, client_autotest="desktopui_SimpleLogin", 45 action_sequence=action_sequence, repeat=repeat, 46 crash_check=True, tag="CRASHES") 47 48 parallel_simple(run, machines) 49