Laszlo Ersek
2023-Jan-12 12:01 UTC
[Libguestfs] [v2v PATCH 0/2] tests: spell out btrfs and ntfs feature group dependencies
A few test cases fail if the libguestfs appliance lacks the btrfs or the ntfs feature group. Let us skip these tests in those situations instead. Laszlo Ersek (2): test-v2v-fedora-btrfs-conversion: spell out btrfs feature group dependency test-v2v-i-ova: spell out ntfs feature group dependency tests/test-v2v-fedora-btrfs-conversion.sh | 1 + tests/test-v2v-i-ova-directory.sh | 4 +++- tests/test-v2v-i-ova.sh | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-)
Laszlo Ersek
2023-Jan-12 12:01 UTC
[Libguestfs] [v2v PATCH 1/2] test-v2v-fedora-btrfs-conversion: spell out btrfs feature group dependency
In case the libguestfs appliance lacks the btrfs feature group, we create a zero-sized phony Fedora/BTRFS image variant, causing this test case to fail. In that situation, the test should just be skipped. Signed-off-by: Laszlo Ersek <lersek at redhat.com> --- tests/test-v2v-fedora-btrfs-conversion.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-v2v-fedora-btrfs-conversion.sh b/tests/test-v2v-fedora-btrfs-conversion.sh index c78f8ae246f6..140998933953 100755 --- a/tests/test-v2v-fedora-btrfs-conversion.sh +++ b/tests/test-v2v-fedora-btrfs-conversion.sh @@ -27,5 +27,6 @@ set -x skip_if_skipped f=../test-data/phony-guests/fedora-btrfs.img requires test -f $f +requires test -s $f $VG virt-v2v --debug-gc -i disk $f -o null
Laszlo Ersek
2023-Jan-12 12:01 UTC
[Libguestfs] [v2v PATCH 2/2] test-v2v-i-ova: spell out ntfs feature group dependency
"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"