mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
extra-tests: Add $(libvirt_ro_uri) substitution to configure.
This is essentially just code motion.
This commit is contained in:
@@ -708,6 +708,9 @@ AS_IF([test "$with_libvirt" != "no"],[
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"])
|
||||
|
||||
libvirt_ro_uri='qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro'
|
||||
AC_SUBST([libvirt_ro_uri])
|
||||
|
||||
dnl libxml2 (highly recommended)
|
||||
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0],
|
||||
[AC_SUBST([LIBXML2_CFLAGS])
|
||||
|
||||
@@ -66,12 +66,10 @@ EXTRA_DIST = \
|
||||
VG = @VG@
|
||||
RUN_VG = $(abs_top_builddir)/run $(VG)
|
||||
|
||||
libvirt_uri = qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock-ro
|
||||
|
||||
# Choose guests at random on each run.
|
||||
random_guests := \
|
||||
$(shell \
|
||||
LIBVIRT_DEFAULT_URI="$(libvirt_uri)" \
|
||||
LIBVIRT_DEFAULT_URI="$(libvirt_ro_uri)" \
|
||||
$(abs_top_builddir)/run $(srcdir)/pick-guests.pl 5)
|
||||
|
||||
extra-tests-non-recursive: \
|
||||
@@ -147,29 +145,29 @@ test-tools-internal:
|
||||
|
||||
# Invocations of tools on real images shouldn't leak memory.
|
||||
test-df-real:
|
||||
$(RUN_VG) ../../df/virt-df -c "$(libvirt_uri)" >/dev/null
|
||||
$(RUN_VG) ../../df/virt-df -c "$(libvirt_uri)" -h >/dev/null
|
||||
$(RUN_VG) ../../df/virt-df -c "$(libvirt_ro_uri)" >/dev/null
|
||||
$(RUN_VG) ../../df/virt-df -c "$(libvirt_ro_uri)" -h >/dev/null
|
||||
|
||||
test-filesystems-real:
|
||||
@for g in $(random_guests); do \
|
||||
echo $(RUN_VG) ../../cat/virt-filesystems -c "$(libvirt_uri)" -d $$g --all --long -h --uuid; \
|
||||
$(RUN_VG) ../../cat/virt-filesystems -c "$(libvirt_uri)" -d $$g --all --long -h --uuid > /dev/null; \
|
||||
echo $(RUN_VG) ../../cat/virt-filesystems -c "$(libvirt_ro_uri)" -d $$g --all --long -h --uuid; \
|
||||
$(RUN_VG) ../../cat/virt-filesystems -c "$(libvirt_ro_uri)" -d $$g --all --long -h --uuid > /dev/null; \
|
||||
r=$$?; \
|
||||
if [ $$r -ne 0 ]; then exit $$r; fi; \
|
||||
done
|
||||
|
||||
test-inspector-real:
|
||||
@for g in $(random_guests); do \
|
||||
echo $(RUN_VG) ../../inspector/virt-inspector -c "$(libvirt_uri)" -d $$g; \
|
||||
$(RUN_VG) ../../inspector/virt-inspector -c "$(libvirt_uri)" -d $$g > /dev/null; \
|
||||
echo $(RUN_VG) ../../inspector/virt-inspector -c "$(libvirt_ro_uri)" -d $$g; \
|
||||
$(RUN_VG) ../../inspector/virt-inspector -c "$(libvirt_ro_uri)" -d $$g > /dev/null; \
|
||||
r=$$?; \
|
||||
if [ $$r -ne 0 ]; then exit $$r; fi; \
|
||||
done
|
||||
|
||||
test-sysprep-real:
|
||||
@for g in $(random_guests); do \
|
||||
echo $(RUN_VG) ../../sysprep/virt-sysprep -n -c "$(libvirt_uri)" -d $$g; \
|
||||
$(RUN_VG) ../../sysprep/virt-sysprep -n -c "$(libvirt_uri)" -d $$g > /dev/null; \
|
||||
echo $(RUN_VG) ../../sysprep/virt-sysprep -n -c "$(libvirt_ro_uri)" -d $$g; \
|
||||
$(RUN_VG) ../../sysprep/virt-sysprep -n -c "$(libvirt_ro_uri)" -d $$g > /dev/null; \
|
||||
r=$$?; \
|
||||
if [ $$r -ne 0 ]; then exit $$r; fi; \
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user