Re: [Tails-dev] automated tests

Nachricht löschen

Nachricht beantworten
Autor: bertagaz
Datum:  
To: The Tails public development discussion list
Betreff: Re: [Tails-dev] automated tests
On Tue, Jun 19, 2012 at 01:39:17PM +0200, bertagaz@??? wrote:
> On Tue, Jun 19, 2012 at 01:53:38AM +0200, intrigeri wrote:
> >
> > Have you by chance found a way to *emulate* a USB 2.0 device in
> > software? (qemu-kvm from current Debian testing/sid supports USB 2.0
> > passthrough, but this is quite different as far as automated tests
> > are concerned.)
>
> Not really investigated in this area yet sorry. Apart from the
> pass-through method I haven't seen anything else.


Actually I just found http://www.linux-usb.org/gadget/ after a quick
search. I haven't yet really understood all of this project, but it seems
it has the feature to emulate USB at the kernel level without any
hardware. At least if you look at [1], it says:

/*
17 * This exposes a device side "USB gadget" API, driven by requests to a
18 * Linux-USB host controller driver. USB traffic is simulated; there's
19 * no need for USB hardware. Use this with two other drivers:
20 *
21 * - Gadget driver, responding to requests (slave);
22 * - Host-side device driver, as already familiar in Linux.
23 *
24 * Having this all in one kernel can help some stages of development,
25 * bypassing some hardware (and driver) issues. UML could help too.
26 */

It requires USB_DUMMY_HCD to be configured in the kernel config, which
isn't in Debian kernel AFAIK.

Maybe I misunderstood the features, but might deserve some more digging
still.

bert.

[1] https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=drivers/usb/gadget/dummy_hcd.c;h=170cbe89d9f8ad47b9bb6ee54596521012c8de7f;hb=HEAD