X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=extratests%2FMakefile.am;h=0b4e20eaacc5e242b7c7e69993b28eb27ce96143;hp=a3b9a2f0d19fd78de087f7056ce963b7d9b84524;hb=5d93d70b4d36b2337104b3dbca07722fa4d47ff5;hpb=6ccae55ddcf0c08cd1b1cdbc07afeed043ad410d diff --git a/extratests/Makefile.am b/extratests/Makefile.am index a3b9a2f..0b4e20e 100644 --- a/extratests/Makefile.am +++ b/extratests/Makefile.am @@ -22,8 +22,34 @@ # - the disks of these guests are accessible by the current user # (tip: add yourself to the 'disk' group) # - valgrind +# - libtool # # These tests may fail for reasons which aren't necessarily real problems. +# +# XXX Not tested: +# +# ../clone/virt-sysprep +# - hard to test because it's a shell script +# +# ../edit/virt-edit +# +# Perl bindings +# ../edit/virt-edit -e +# ../tools/virt-win-reg (Perl) +# ../tools/virt-make-fs (Perl) +# - hard because Perl doesn't cooperate by freeing memory +# +# Python bindings +# - as for Perl +# +# Ruby bindings +# - these look feasible to test using valgrind +# +# Java bindings +# +# ../fuse/guestmount +# - hard to test because guestmount forks into the background, and +# if valgrind reports errors it doesn't stop the test shell script EXTRA_DIST = suppressions @@ -32,7 +58,7 @@ VG = valgrind \ --leak-check=full \ --error-exitcode=119 \ --suppressions=$(abs_srcdir)/suppressions -RUN_VG = ../run $(VG) +RUN_VG = $(abs_top_builddir)/run $(VG) export LIBVIRT_DEFAULT_URI = \ qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro @@ -42,7 +68,27 @@ GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \ tail -n +3 | \ awk '{print $$2}') -extra-tests: test-tools-null test-tools-internal test-tools-real +extra-tests: \ + test-prerequisites \ + test-c-api \ + test-tools-null \ + test-tools-internal \ + test-df-real \ + test-filesystems-real \ + test-inspector-real \ + test-ocaml \ + test-resize \ + test-sparsify + +test-prerequisites: + @libtool --help >/dev/null 2>&1 || { \ + echo "extra-tests: libtool is not installed"; \ + exit 1; \ + } + @valgrind --help >/dev/null 2>&1 || { \ + echo "extra-tests: valgrind is not installed"; \ + exit 1; \ + } # Null invocations of the basic tools shouldn't leak memory. test-tools-null: @@ -76,29 +122,38 @@ test-tools-internal: $(RUN_VG) ../inspector/virt-inspector -a ../images/windows.img >/dev/null # Invocations of tools on real images shouldn't leak memory. -test-tools-real: +test-df-real: $(RUN_VG) virt-df >/dev/null $(RUN_VG) virt-df -h >/dev/null + +test-filesystems-real: @for g in $(GUESTS); do \ - echo $(RUN_VG) ../inspector/virt-inspector -d $$g; \ - $(RUN_VG) ../inspector/virt-inspector -d $$g > /dev/null; \ + echo $(RUN_VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid; \ + $(RUN_VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid > /dev/null; \ r=$$?; \ if [ $$r -ne 0 ]; then exit $$r; fi; \ done + +test-inspector-real: @for g in $(GUESTS); do \ - echo $(RUN_VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid; \ - $(RUN_VG) ../cat/virt-filesystems -d $$g --all --long -h --uuid > /dev/null; \ + echo $(RUN_VG) ../inspector/virt-inspector -d $$g; \ + $(RUN_VG) ../inspector/virt-inspector -d $$g > /dev/null; \ r=$$?; \ if [ $$r -ne 0 ]; then exit $$r; fi; \ done +# Run virt-resize tests under valgrind. +test-resize: + $(MAKE) -C ../resize VG="$(VG)" check -# XXX Not tested: -# ../clone/virt-sysprep -# ../edit/virt-edit -# ../edit/virt-edit -e -# ../fuse/guestmount -# ../resize/virt-resize (OCaml) -# ../sparsify/virt-sparsify (OCaml) -# ../tools/virt-win-reg (Perl) -# ../tools/virt-make-fs (Perl) +# Run virt-sparsify tests under valgrind. +test-sparsify: + $(MAKE) -C ../sparsify VG="$(VG)" check + +# Run c-api tests under valgrind. +test-c-api: + $(MAKE) -C ../tests/c-api VG="$(RUN_VG)" check + +# Test OCaml bindings under valgrind. +test-ocaml: + $(MAKE) -C ../ocaml VG="$(VG)" check