diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-01-10 18:52:53 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-01-10 18:52:53 +0000 |
commit | 54a7982dc3a6d3cc903c8d6e73be30c46fdf90d4 (patch) | |
tree | 9413e1ac82ae7392148840e3af4a6e7aa714b669 | |
parent | adb0050d86dd069a7ac78d7bc9e7b932b25b8f5b (diff) | |
download | libguestfs-54a7982dc3a6d3cc903c8d6e73be30c46fdf90d4.tar.gz libguestfs-54a7982dc3a6d3cc903c8d6e73be30c46fdf90d4.tar.xz libguestfs-54a7982dc3a6d3cc903c8d6e73be30c46fdf90d4.zip |
extra-tests: Only test 5 random guests.
If you have a lot of guests, running extra tests takes a lot of time,
but (arguably) you're not really doing any more detailed testing.
Thus pick up to 5 guests at random to test. A different random
selection is done on each run, ensuring that data-driven errors (eg in
inspection) will still be found eventually.
-rw-r--r-- | tests/extra/Makefile.am | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/extra/Makefile.am b/tests/extra/Makefile.am index d129b6dc..8f349582 100644 --- a/tests/extra/Makefile.am +++ b/tests/extra/Makefile.am @@ -63,10 +63,14 @@ RUN_VG = $(abs_top_builddir)/run $(VG) export LIBVIRT_DEFAULT_URI = \ qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro -GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \ - head -n -1 | \ - tail -n +3 | \ - awk '{print $$2}') +# Choose 5 guests at random on each run. +RANDOM_GUESTS = $(shell virsh -c $(LIBVIRT_DEFAULT_URI) list --all | \ + head -n -1 | \ + tail -n +3 | \ + awk '{print $$2}' | \ + sort -R | \ + head -5 | \ + sort) extra-tests: \ test-guests \ @@ -131,7 +135,7 @@ test-df-real: $(RUN_VG) ../../df/virt-df -h >/dev/null test-filesystems-real: - @for g in $(GUESTS); do \ + @for g in $(RANDOM_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; \ r=$$?; \ @@ -139,7 +143,7 @@ test-filesystems-real: done test-inspector-real: - @for g in $(GUESTS); do \ + @for g in $(RANDOM_GUESTS); do \ echo $(RUN_VG) ../../inspector/virt-inspector -d $$g; \ $(RUN_VG) ../../inspector/virt-inspector -d $$g > /dev/null; \ r=$$?; \ |