Pino Toscano
2018-Jan-31 15:24 UTC
[Libguestfs] [nbdkit PATCH] tests: test-single: create the fake disk
Make sure the fake disk exist, otherwise nbdkit fails. Also, give the fake disk a less generic file name. --- tests/test-single.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test-single.sh b/tests/test-single.sh index d60538d..9dc462b 100755 --- a/tests/test-single.sh +++ b/tests/test-single.sh @@ -45,11 +45,13 @@ if ! qemu-img --help >/dev/null; then exit 77 fi -files="single.sock" +files="single.sock single.disk" rm -f $files +truncate -s 1G single.disk + socat unix-listen:single.sock,reuseaddr,fork \ - exec:'nbdkit -r -s file file=disk' & + exec:'nbdkit -r -s file file=single.disk' & pid=$! cleanup () -- 2.14.3
Richard W.M. Jones
2018-Jan-31 15:35 UTC
Re: [Libguestfs] [nbdkit PATCH] tests: test-single: create the fake disk
On Wed, Jan 31, 2018 at 04:24:05PM +0100, Pino Toscano wrote:> Make sure the fake disk exist, otherwise nbdkit fails. Also, give the > fake disk a less generic file name.The fix is fine but this description is wrong. The actual problem is you don't have guestfish installed, which is required to build ‘disk’. However ‘test-single.sh’ is outside the automake conditional for HAVE_GUESTFISH, so the test can run without ‘disk’ having been created. ACK, but with the description fixed to reflect what's really going on. There may be other tests which are similarly broken, I didn't check. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Pino Toscano
2018-Jan-31 15:43 UTC
Re: [Libguestfs] [nbdkit PATCH] tests: test-single: create the fake disk
On Wednesday, 31 January 2018 16:35:34 CET Richard W.M. Jones wrote:> On Wed, Jan 31, 2018 at 04:24:05PM +0100, Pino Toscano wrote: > > Make sure the fake disk exist, otherwise nbdkit fails. Also, give the > > fake disk a less generic file name. > > The fix is fine but this description is wrong. > > The actual problem is you don't have guestfish installed, which is > required to build ‘disk’. However ‘test-single.sh’ is outside the > automake conditional for HAVE_GUESTFISH, so the test can run without > ‘disk’ having been created.Yes, I discovered that right after sending the patch.> ACK, but with the description fixed to reflect what's really going on.What about the following commit message: "tests: test-single: use an own fake disk Instead of rely on the disk created as test data in the Makefile, use a simple fake disk created inside the test itself. This fixes test-single.sh when at least one between gzip and guestfish was not found." Thanks, -- Pino Toscano
Reasonably Related Threads
- Re: [nbdkit PATCH] tests: test-single: create the fake disk
- [nbdkit PATCH v2] tests: Skip guestfs code on CentOS 6
- Re: [nbdkit PATCH] tests: test-single: create the fake disk
- [PATCH nbdkit] tests: xz: Use 16M block size when preparing disk for xz plugin test.
- [PATCH nbdkit 0/4] plugins: Add new "ext2" plugin, for accessing ext2, ext3 or ext4 filesystems.