[Libguestfs] [PATCH 2/2] tests/disks: skip test-qemu-drive-libvirt.sh if libvirt is < 1.1.3

Pino Toscano ptoscano at redhat.com
Mon Jan 27 13:51:07 UTC 2014


This test relies on the <test:runstate> element in the domain XML, which
has been introduced in libvirt 1.1.3.
---
 tests/disks/test-qemu-drive-libvirt.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/disks/test-qemu-drive-libvirt.sh b/tests/disks/test-qemu-drive-libvirt.sh
index e85c249..b355371 100755
--- a/tests/disks/test-qemu-drive-libvirt.sh
+++ b/tests/disks/test-qemu-drive-libvirt.sh
@@ -26,6 +26,16 @@ if [ -z "$abs_srcdir" ]; then
     exit 1
 fi
 
+if [ ! -s ../libvirt/libvirt-is-version ]; then
+    echo "$0: test skipped because libvirt-is-version is not built yet"
+    exit 77
+fi
+
+if ! ../libvirt/libvirt-is-version 1 1 3; then
+    echo "$0: test skipped because libvirt is too old (< 1.1.3)"
+    exit 77
+fi
+
 guestfish="\
   ../../fish/guestfish -c test://$abs_srcdir/test-qemu-drive-libvirt.xml"
 
-- 
1.8.3.1




More information about the Libguestfs mailing list