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