On Mon, Jan 02, 2012 at 03:07:08PM +0100, Paolo Bonzini wrote: > On 12/29/2011 07:33 PM, Anthony Liguori wrote: > > > >FWIW, I expect virtio-scsi to be the first guinea pig here... I believe > >Stefan has already started looking at writing some qtest based tests for > >virtio-scsi. > > I'm curious, because a SCSI HBA makes it as hard as it can be to > write unit tests. Pretty much everything you do will test the > interactions between the SCSI devices and the block layer, more than > the HBA itself. This is especially for such a simple HBA; unit > testing is much more "interesting" for something like the LSI > device. > > So, to test the HBA you need write either a mock SCSI device, or a > mock block device. (I hate mocks). Now that the client is > asynchronous, NBD is a pretty effective way to write a mock block > device, though not the simplest.
I haven't started yet but I am planning to write qtest virtio PCI tests and will definitely be taking a look at virtio-scsi. We don't necessarily need mock devices, just really simply temporary raw files or similar. On the other hand mock devices can be a good solution for programmatically verifying that our intended action was performed on the host device. Stefan