[Libguestfs] [v2v PATCH 2/2] test-v2v-i-ova: spell out ntfs feature group dependency

Laszlo Ersek lersek at redhat.com
Thu Jan 12 12:01:50 UTC 2023


"windows.img" is created as an empty phony image if the libguestfs
appliance lacks the ntfs feature group.

"tests/Makefile.am" deals well with this, because for the "central"
"windows.vmdk" target, we restrict the VMDK conversion to a non-empty
"windows.img". Subsequently, dependent test cases check for "windows.vmdk"
specifically, and if that file is missing, the tests are skipped (they
exit with code 77).

"test-v2v-i-ova.sh" and "test-v2v-i-ova-directory.sh" are exceptions
however. They perform the same conversion manually (in their own separate
workspace directories). They assume that, if "windows.img" exists, it can
be converted to VMDK. When the image size is zero, the conversion breaks,
and both test cases fail. Skip both tests if "windows.img" is empty.

Signed-off-by: Laszlo Ersek <lersek at redhat.com>
---
 tests/test-v2v-i-ova-directory.sh | 4 +++-
 tests/test-v2v-i-ova.sh           | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/test-v2v-i-ova-directory.sh b/tests/test-v2v-i-ova-directory.sh
index fff236f58ae8..a8660648e0bc 100755
--- a/tests/test-v2v-i-ova-directory.sh
+++ b/tests/test-v2v-i-ova-directory.sh
@@ -25,7 +25,9 @@ set -e
 set -x
 
 skip_if_skipped
-requires test -f ../test-data/phony-guests/windows.img
+f=../test-data/phony-guests/windows.img
+requires test -f $f
+requires test -s $f
 
 export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
 export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
diff --git a/tests/test-v2v-i-ova.sh b/tests/test-v2v-i-ova.sh
index a55966a750dc..2595f9c0ffd1 100755
--- a/tests/test-v2v-i-ova.sh
+++ b/tests/test-v2v-i-ova.sh
@@ -25,7 +25,9 @@ set -e
 set -x
 
 skip_if_skipped
-requires test -f ../test-data/phony-guests/windows.img
+f=../test-data/phony-guests/windows.img
+requires test -f $f
+requires test -s $f
 
 export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
 export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"


More information about the Libguestfs mailing list