Home | History | Annotate | Download | only in kernel_ExternalUsbPeripheralsDetectionTest
      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 
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "Chrome OS Team"
      8 NAME = "kernel_ExternalUsbPeripheralsDetectionTest.printer_hp"
      9 PURPOSE = "Kernel USB detection test"
     10 CRITERIA = "This test will fail if any of the actions or checks fail."
     11 TIME = "SHORT"
     12 TEST_CATEGORY = "Functional"
     13 TEST_CLASS = "platform, kernel"
     14 TEST_TYPE = "server"
     15 DEPENDENCIES = "servo, usb_printer_hp"
     16 
     17 DOC = """
     18 This test uses servo to connect USB devices.
     19 This test verifies if drivers are created for each USB device or not.
     20 
     21 The 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 
     27 USB peripherals plugged
     28 - USB printer
     29 """
     30 
     31 args_dict = utils.args_to_dict(args)
     32 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     33 
     34 def run(machine):
     35     host = hosts.create_host(machine, servo_args=servo_args)
     36 
     37     usb_checks = {
     38         # Epson or HP USB printer
     39         str("lsusb") :
     40             ["03f0:d911 Hewlett-Packard"],
     41         str("lsusb -v -d 03f0:d911") :
     42             ["iProduct.*OfficeJet 4650 series",
     43              "bInterfaceClass.*Printer"],
     44         }
     45 
     46     vendor_id_dict_control_file = {'03f0': 'Printer'}
     47 
     48     job.run_test("kernel_ExternalUsbPeripheralsDetectionTest", host=host,
     49                  disable_sysinfo=True, usb_checks=usb_checks, tag="printer_hp",
     50                  vendor_id_dict_control_file=vendor_id_dict_control_file)
     51 
     52 parallel_simple(run, machines)
     53