53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			53 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
# Copyright (c) 2016 The Chromium OS Authors. All rights reserved.
 | 
						|
# 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
 | 
						|
 | 
						|
AUTHOR = "Chrome OS Team"
 | 
						|
NAME = "kernel_ExternalUsbPeripheralsDetectionTest.printer_hp"
 | 
						|
PURPOSE = "Kernel USB detection test"
 | 
						|
CRITERIA = "This test will fail if any of the actions or checks fail."
 | 
						|
TIME = "SHORT"
 | 
						|
TEST_CATEGORY = "Functional"
 | 
						|
TEST_CLASS = "platform, kernel"
 | 
						|
TEST_TYPE = "server"
 | 
						|
DEPENDENCIES = "servo_state:WORKING, usb_printer_hp"
 | 
						|
 | 
						|
DOC = """
 | 
						|
This test uses servo to connect USB devices.
 | 
						|
This test verifies if drivers are created for each USB device or not.
 | 
						|
 | 
						|
The test fails if
 | 
						|
- if USB device is not detected in lsusb command
 | 
						|
- if driver for USB device is not created
 | 
						|
- USB detected peripherals are different than expected
 | 
						|
- there is no servo board attached
 | 
						|
 | 
						|
USB peripherals plugged
 | 
						|
- USB printer
 | 
						|
"""
 | 
						|
 | 
						|
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)
 | 
						|
 | 
						|
    usb_checks = {
 | 
						|
        # Epson or HP USB printer
 | 
						|
        str("lsusb") :
 | 
						|
            ["03f0:d911 Hewlett-Packard"],
 | 
						|
        str("lsusb -v -d 03f0:d911") :
 | 
						|
            ["iProduct.*OfficeJet 4650 series",
 | 
						|
             "bInterfaceClass.*Printer"],
 | 
						|
        }
 | 
						|
 | 
						|
    vendor_id_dict_control_file = {'03f0': 'Printer'}
 | 
						|
 | 
						|
    job.run_test("kernel_ExternalUsbPeripheralsDetectionTest", host=host,
 | 
						|
                 disable_sysinfo=True, usb_checks=usb_checks, tag="printer_hp",
 | 
						|
                 vendor_id_dict_control_file=vendor_id_dict_control_file)
 | 
						|
 | 
						|
parallel_simple(run, machines)
 |