Received: from eggs.gnu.org ([140.186.70.92]:45013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri0F0-0005IW-JZ for qemu-devel@nongnu.org; Tue, 03 Jan 2012 04:01:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ri0Ez-0005sw-GN for qemu-devel@nongnu.org; Tue, 03 Jan 2012 04:01:06 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:45227) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ri0Ez-0005sU-5V for qemu-devel@nongnu.org; Tue, 03 Jan 2012 04:01:05 -0500 Received: by mail-ee0-f45.google.com with SMTP id b45so18494122eek.4 for ; Tue, 03 Jan 2012 01:01:04 -0800 (PST) Date: Tue, 3 Jan 2012 08:19:36 +0000 From: Stefan Hajnoczi Message-ID: <20120103081936.GC28636@stefanha-thinkpad.localdomain> References: <4EFB2764.7040006@codemonkey.ws> <4EFB2F36.2090408@redhat.com> <4EFB35AB.6040003@redhat.com> <4EFB4757.4020504@codemonkey.ws> <4EFB5138.5020502@redhat.com> <4EFC916E.4070902@codemonkey.ws> <4EFC9706.4090500@redhat.com> <4EFCB274.5020102@codemonkey.ws> <4F01BA0C.2070305@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F01BA0C.2070305@redhat.com> Subject: Re: [Qemu-devel] [ANNOUNCE] qemu-test: a set of tests scripts for QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: "lmr@redhat.com" , Peter Maydell , Stefan Hajnoczi , cleber@redhat.com, dlaor@redhat.com, qemu-devel , Avi Kivity , Cleber Rosa , Gerd Hoffmann 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