In some tests we were specifying qcow2 as the image format when adding
a disk, but actually passing a raw format image.
Libguestfs previously did not detect this until guestfs_launch, but it
was still a bug to pass an incorrect format to guestfs_add_drive_opts.
It only worked because these tests never call guestfs_launch.
A later commit in this series will cause this to be detected
(sometimes) during guestfs_add_drive_opts.
---
fish/test-a.sh | 3 +++
fish/test-add-domain.sh | 2 +-
fish/test-d.sh | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fish/test-a.sh b/fish/test-a.sh
index 91adc77..df892fe 100755
--- a/fish/test-a.sh
+++ b/fish/test-a.sh
@@ -29,6 +29,9 @@ $VG ./guestfish -x -a test-a.img </dev/null >test-a.out
2>&1
! grep -sq 'add_drive.*format' test-a.out
+rm test-a.img
+qemu-img create -f qcow2 test-a.img 100M
+
$VG ./guestfish -x --format=qcow2 -a test-a.img </dev/null >test-a.out 2>&1
grep -sq 'add_drive.*format:qcow2' test-a.out
diff --git a/fish/test-add-domain.sh b/fish/test-add-domain.sh
index 1816b50..419c5cf 100755
--- a/fish/test-add-domain.sh
+++ b/fish/test-add-domain.sh
@@ -27,7 +27,7 @@ cwd="$(pwd)"
$VG ./guestfish sparse test-add-domain-1.img 1M
$VG ./guestfish sparse test-add-domain-2.img 1M
-$VG ./guestfish sparse test-add-domain-3.img 1M
+qemu-img create -f qcow2 test-add-domain-3.img 1M
$VG ./guestfish sparse test-add-domain-4.img 1M
# Libvirt test XML, see libvirt.git/examples/xml/test/testnode.xml
diff --git a/fish/test-d.sh b/fish/test-d.sh
index cbbd33e..b891505 100755
--- a/fish/test-d.sh
+++ b/fish/test-d.sh
@@ -27,7 +27,7 @@ cwd="$(pwd)"
$VG ./guestfish sparse test-d-1.img 1M
$VG ./guestfish sparse test-d-2.img 1M
-$VG ./guestfish sparse test-d-3.img 1M
+qemu-img create -f qcow2 test-d-3.img 1M
$VG ./guestfish sparse test-d-4.img 1M
# Libvirt test XML, see libvirt.git/examples/xml/test/testnode.xml
--
1.8.4.2