Re: [Libguestfs] [nbdkit PATCH 2/1] RFC: tests: Run tests that don't require libguestfs

2018-05-01 Thread Richard W.M. Jones
Sorry I missed this one.  It looks to me like straightforward
refactoring, therefore ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

___
Libguestfs mailing list
Libguestfs@redhat.com
https://www.redhat.com/mailman/listinfo/libguestfs


Re: [Libguestfs] [nbdkit PATCH 2/1] RFC: tests: Run tests that don't require libguestfs

2018-05-01 Thread Eric Blake

On 04/09/2018 03:44 PM, Eric Blake wrote:

A bit of refactoring to the HAVE_LIBGUESTFS conditional,
coupled with the addition of a LIBGUESTFS_TESTS intermediate
list, allows us to run a few more tests on CentOS 6 (adding
some tests of command-line behavior and filters that was
previously completely skipped).

For the two tests that we can't run, using check_PROGRAMS
still causes those programs to try to compile (which leads to
compile errors); but using EXTRA_PROGRAMS keeps automake
silent without getting those sources in the way, while still
distributing the sources for someone motivated to fix the
tests.

Compared to the previous patch (14/14 pass and 5 skip), I now
have 15/18 pass and 9 skip.

Signed-off-by: Eric Blake 
---


Ping



This one was more invasive than the previous, but may still be
worth having on top of the configure change that disables
HAVE_LIBGUESTFS on CentOS 7.  The three test failures are now:

./test-dump-plugin-example4.sh: unexpected output from nbdkit example4 
--dump-plugin
path=/home/dummy/nbdkit/plugins/perl/.libs/nbdkit-perl-plugin.so
name=perl
version=1.3.0
...
has__zero_old=1
FAIL: test-dump-plugin-example4.sh


nbd://?socket=cache.sock: No such file or directory
./test-cache.sh: line 64: kill: (32161) - No such process
FAIL: test-cache.sh
guestfish: -N parameter 'cow-base.img=fs': no such prepared disk image known.
Use 'guestfish -N help' to list possible values for the -N parameter.
FAIL: test-cow.sh

(hmm, so my attempt to guard test-cache.sh and test-cow.sh by
HAVE_GUESTFISH didn't really help)

  tests/Makefile.am | 71 +--
  1 file changed, 32 insertions(+), 39 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2cc2344..4582120 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -190,7 +190,11 @@ TESTS += \

  # Most in-depth tests need libguestfs, since that is a convenient way to
  # drive qemu.
+LIBGUESTFS_TESTS =
+EXTRA_PROGRAMS =
  if HAVE_LIBGUESTFS
+check_PROGRAMS += $(LIBGUESTFS_TESTS)
+TESTS += $(LIBGUESTFS_TESTS)

  # Use the 'direct' backend, and ensure maximum libguestfs debugging is
  # written to the *.log files in case there is a problem.
@@ -206,32 +210,30 @@ libtest_la_SOURCES = test.c test.h
  libtest_la_CFLAGS = $(WARNINGS_CFLAGS)

  # Basic connection test.
-check_PROGRAMS += test-connect
-TESTS += test-connect
+LIBGUESTFS_TESTS += test-connect

  test_connect_SOURCES = test-connect.c test.h
  test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)

  # newstyle protocol test.
-check_PROGRAMS += test-newstyle
-TESTS += test-newstyle
+LIBGUESTFS_TESTS += test-newstyle

  test_newstyle_SOURCES = test-newstyle.c test.h
  test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)

  # oldstyle protocol test.
-check_PROGRAMS += test-oldstyle
-TESTS += test-oldstyle
+LIBGUESTFS_TESTS += test-oldstyle

  test_oldstyle_SOURCES = test-oldstyle.c test.h
  test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)

+endif HAVE_LIBGUESTFS
+
  # file plugin test.
-check_PROGRAMS += test-file
-TESTS += test-file
+LIBGUESTFS_TESTS += test-file

  test_file_SOURCES = test-file.c test.h
  test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
@@ -241,8 +243,7 @@ test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
  if HAVE_ZLIB
  if HAVE_GUESTFISH

-check_PROGRAMS += test-gzip
-TESTS += test-gzip
+LIBGUESTFS_TESTS += test-gzip
  check_DATA += disk disk.gz
  MAINTAINERCLEANFILES += disk disk.gz

@@ -263,24 +264,21 @@ endif HAVE_GUESTFISH
  endif HAVE_ZLIB

  # memory plugin test.
-check_PROGRAMS += test-memory
-TESTS += test-memory
+LIBGUESTFS_TESTS += test-memory

  test_memory_SOURCES = test-memory.c test.h
  test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)

  # nbd plugin test.
-check_PROGRAMS += test-nbd
-TESTS += test-nbd
+LIBGUESTFS_TESTS += test-nbd

  test_nbd_SOURCES = test-nbd.c test.h
  test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)

  # null plugin test.
-check_PROGRAMS += test-null
-TESTS += test-null
+LIBGUESTFS_TESTS += test-null

  test_null_SOURCES = test-null.c test.h
  test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
@@ -301,17 +299,16 @@ split3: file-data
rm -f $@ $@-t
dd if=$< of=$@-t bs=1 skip=200
mv $@-t $@
-check_PROGRAMS += test-split
-TESTS += test-split
+LIBGUESTFS_TESTS += test-split

  test_split_SOURCES = test-split.c test.h
  test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
  test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)

  # streaming plugin test.
-check_PROGRAMS += test-streaming
  # Doesn't work:
-#TESTS += test-streaming
+#LIBGUESTFS_TESTS += test-streaming
+EXTRA_PROGRAMS += test-streaming

  

[Libguestfs] [nbdkit PATCH 2/1] RFC: tests: Run tests that don't require libguestfs

2018-04-09 Thread Eric Blake
A bit of refactoring to the HAVE_LIBGUESTFS conditional,
coupled with the addition of a LIBGUESTFS_TESTS intermediate
list, allows us to run a few more tests on CentOS 6 (adding
some tests of command-line behavior and filters that was
previously completely skipped).

For the two tests that we can't run, using check_PROGRAMS
still causes those programs to try to compile (which leads to
compile errors); but using EXTRA_PROGRAMS keeps automake
silent without getting those sources in the way, while still
distributing the sources for someone motivated to fix the
tests.

Compared to the previous patch (14/14 pass and 5 skip), I now
have 15/18 pass and 9 skip.

Signed-off-by: Eric Blake 
---

This one was more invasive than the previous, but may still be
worth having on top of the configure change that disables
HAVE_LIBGUESTFS on CentOS 7.  The three test failures are now:

./test-dump-plugin-example4.sh: unexpected output from nbdkit example4 
--dump-plugin
path=/home/dummy/nbdkit/plugins/perl/.libs/nbdkit-perl-plugin.so
name=perl
version=1.3.0
...
has__zero_old=1
FAIL: test-dump-plugin-example4.sh


nbd://?socket=cache.sock: No such file or directory
./test-cache.sh: line 64: kill: (32161) - No such process
FAIL: test-cache.sh
guestfish: -N parameter 'cow-base.img=fs': no such prepared disk image known.
Use 'guestfish -N help' to list possible values for the -N parameter.
FAIL: test-cow.sh

(hmm, so my attempt to guard test-cache.sh and test-cow.sh by
HAVE_GUESTFISH didn't really help)

 tests/Makefile.am | 71 +--
 1 file changed, 32 insertions(+), 39 deletions(-)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2cc2344..4582120 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -190,7 +190,11 @@ TESTS += \

 # Most in-depth tests need libguestfs, since that is a convenient way to
 # drive qemu.
+LIBGUESTFS_TESTS =
+EXTRA_PROGRAMS =
 if HAVE_LIBGUESTFS
+check_PROGRAMS += $(LIBGUESTFS_TESTS)
+TESTS += $(LIBGUESTFS_TESTS)

 # Use the 'direct' backend, and ensure maximum libguestfs debugging is
 # written to the *.log files in case there is a problem.
@@ -206,32 +210,30 @@ libtest_la_SOURCES = test.c test.h
 libtest_la_CFLAGS = $(WARNINGS_CFLAGS)

 # Basic connection test.
-check_PROGRAMS += test-connect
-TESTS += test-connect
+LIBGUESTFS_TESTS += test-connect

 test_connect_SOURCES = test-connect.c test.h
 test_connect_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_connect_LDADD = libtest.la $(LIBGUESTFS_LIBS)

 # newstyle protocol test.
-check_PROGRAMS += test-newstyle
-TESTS += test-newstyle
+LIBGUESTFS_TESTS += test-newstyle

 test_newstyle_SOURCES = test-newstyle.c test.h
 test_newstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_newstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)

 # oldstyle protocol test.
-check_PROGRAMS += test-oldstyle
-TESTS += test-oldstyle
+LIBGUESTFS_TESTS += test-oldstyle

 test_oldstyle_SOURCES = test-oldstyle.c test.h
 test_oldstyle_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_oldstyle_LDADD = libtest.la $(LIBGUESTFS_LIBS)

+endif HAVE_LIBGUESTFS
+
 # file plugin test.
-check_PROGRAMS += test-file
-TESTS += test-file
+LIBGUESTFS_TESTS += test-file

 test_file_SOURCES = test-file.c test.h
 test_file_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
@@ -241,8 +243,7 @@ test_file_LDADD = libtest.la $(LIBGUESTFS_LIBS)
 if HAVE_ZLIB
 if HAVE_GUESTFISH

-check_PROGRAMS += test-gzip
-TESTS += test-gzip
+LIBGUESTFS_TESTS += test-gzip
 check_DATA += disk disk.gz
 MAINTAINERCLEANFILES += disk disk.gz

@@ -263,24 +264,21 @@ endif HAVE_GUESTFISH
 endif HAVE_ZLIB

 # memory plugin test.
-check_PROGRAMS += test-memory
-TESTS += test-memory
+LIBGUESTFS_TESTS += test-memory

 test_memory_SOURCES = test-memory.c test.h
 test_memory_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_memory_LDADD = libtest.la $(LIBGUESTFS_LIBS)

 # nbd plugin test.
-check_PROGRAMS += test-nbd
-TESTS += test-nbd
+LIBGUESTFS_TESTS += test-nbd

 test_nbd_SOURCES = test-nbd.c test.h
 test_nbd_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_nbd_LDADD = libtest.la $(LIBGUESTFS_LIBS)

 # null plugin test.
-check_PROGRAMS += test-null
-TESTS += test-null
+LIBGUESTFS_TESTS += test-null

 test_null_SOURCES = test-null.c test.h
 test_null_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
@@ -301,17 +299,16 @@ split3: file-data
rm -f $@ $@-t
dd if=$< of=$@-t bs=1 skip=200
mv $@-t $@
-check_PROGRAMS += test-split
-TESTS += test-split
+LIBGUESTFS_TESTS += test-split

 test_split_SOURCES = test-split.c test.h
 test_split_CFLAGS = $(WARNINGS_CFLAGS) $(LIBGUESTFS_CFLAGS)
 test_split_LDADD = libtest.la $(LIBGUESTFS_LIBS)

 # streaming plugin test.
-check_PROGRAMS += test-streaming
 # Doesn't work:
-#TESTS += test-streaming
+#LIBGUESTFS_TESTS += test-streaming
+EXTRA_PROGRAMS += test-streaming

 test_streaming_SOURCES = test-streaming.c test.h
 test_streaming_CFLAGS = $(WARNINGS_CFLAGS)