Following a recent Ceph USB gateway project, I was looking at ways to test a Linux USB device without the need to fiddle with cables, or deal with slow embedded board boot times.
Ideally USB gadget testing could be performed by running the USB device code within a virtual machine, and attaching the VM's virtual USB device port to an emulated USB host controller on the hypervisor system.
The dummy_hcd Linux kernel module is an excellent utility for USB device testing from within a standalone system or VM.
dummy_hcd.ko offers the following features:
- Re-route USB device traffic back to the local system
- Effectively providing device loopback functionality
- USB high-speed and super-speed connection simulation