commit | 19b5094106e79e4a15bce3b41de0affcb339d6cc | [log] [tgz] |
---|---|---|
author | Grace Cham <hscham@google.com> | Thu Oct 31 06:01:08 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jan 22 09:29:02 2020 |
tree | 3b36588d21e718744701af61818a7af85433d6c6 | |
parent | 3005fddc52d5e2db563f7f0ff7a77be0a693eb44 [diff] |
virtual-usb-printer: remove version suffix in libbrillo build rules The libbrillo library is installed without version suffix. BUG=chromium:920513 TEST=emerge Cq-Depend: chromium:1892317, chromium:1892377 Change-Id: I0e3f6dba184ab5e6389707aa6052a0c3d2950ad7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/virtual-usb-printer/+/1890577 Tested-by: Grace Cham <hscham@chromium.org> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org> Reviewed-by: Sean Kau <skau@chromium.org> Commit-Queue: Grace Cham <hscham@chromium.org>
Virtual USB Printer provides a server which can be used with USBIP in order to emulate a USB printing device and bind it to the system as if it were physically connected to a USB port.
Virtual USB Printer supports both regular USB printers as well as IPP-over-USB devices.
This project was created in order to make on-device tests which check for any regressions in the native USB printing system.
In order to actually “connect” the virtual printer to the system the USBIP program is used.
USBIP is typically used to export real USB devices over a network so that other systems on the network can bind them and treat them as connected devices.
For the purposes of the virtual printer, only the client portion of USBIP is required so that the virtual device can be bound to the system.
Currently the USBIP program is only installed by default for the elm and betty boards.
In order to install it on your test image, you need to build an image with the usbip
USE flag enabled. To do this, all you need to to is run build_packages
with the USE flag enabled.
USE="usbip" ./build_packages --board=$BOARD
Run the virtual-usb-printer program:
virtual-usb-printer --descriptors_path=<path>
(Optional) Check the list of exported printers with USBIP:
usbip list -r localhost
Should return something like this:
Exportable USB devices ====================== - localhost 1-1: Canon, Inc. : unknown product (04a9:27e8) : /sys/devices/pci0000:00/0000:00:01.2/usb1/1-1 : (Defined at Interface level) (00/00/00) : 0 - Printer / Printer Bidirectional (07/01/02)
Bind the virtual printer to the system:
usbip attach -r localhost -b 1-1
Once the device has been attached it should appear in the list of connected USB devices (lsusb
), and can be used with the native printing system in Chrome OS.
The printer's USB descriptors and defined IPP attributes can be configured using a JSON file and are loaded at run-time using command line flags. Example configurations can be found in the config/
directory.
The configuration files can be loaded with the following flags:
--descriptors_path
- full path to the JSON file which defines the USB descriptors--attributes_path
- full path to the JSON file which defines the supported IPP attributes--record_doc_path
- full path to the file used to record documents received from print jobsThere are currently existing tast tests which leverage virtual-usb-printer in order to test native printing. The following can be used as examples in order to write new tests: