From 54a7982dc3a6d3cc903c8d6e73be30c46fdf90d4 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 10 Jan 2012 18:52:53 +0000 Subject: 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. --- tests/extra/Makefile.am | 16 ++++++++++------ 1 file 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=$$?; \ -- cgit