• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2016 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
5from autotest_lib.server import utils
6
7AUTHOR = "Chrome OS Team"
8NAME = "kernel_ExternalUsbPeripheralsDetectionTest.printer_epson"
9PURPOSE = "Kernel USB detection test"
10CRITERIA = "This test will fail if any of the actions or checks fail."
11TIME = "SHORT"
12TEST_CATEGORY = "Functional"
13TEST_CLASS = "platform, kernel"
14TEST_TYPE = "server"
15DEPENDENCIES = "servo, usb_printer_epson"
16
17DOC = """
18This test uses servo to connect USB devices.
19This test verifies if drivers are created for each USB device or not.
20
21The test fails if
22- if USB device is not detected in lsusb command
23- if driver for USB device is not created
24- USB detected peripherals are different than expected
25- there is no servo board attached
26
27USB peripherals plugged
28- USB Epson XP-610 Series printer
29"""
30
31args_dict = utils.args_to_dict(args)
32servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
33
34def run(machine):
35    host = hosts.create_host(machine, servo_args=servo_args)
36
37    usb_checks = {
38        # Epson printer
39        str("lsusb") :
40            ["04b8:089e Seiko Epson Corp."],
41        str("lsusb -v -d 04b8:089e") :
42            ["iProduct.*EPSON XP-610 Series",
43             "bInterfaceClass.*Printer"],
44        }
45
46    vendor_id_dict_control_file = {'04b8': 'Printer'}
47
48    job.run_test("kernel_ExternalUsbPeripheralsDetectionTest", host=host,
49                 disable_sysinfo=True, usb_checks=usb_checks, tag="printer_epson",
50                 vendor_id_dict_control_file=vendor_id_dict_control_file)
51
52parallel_simple(run, machines)
53