Blame SOURCES/0002-test-v2v-i-ova-spell-out-ntfs-feature-group-dependen.patch

b85204
From 224243b8e26aa299bd99dd24662c4df10a3f612c Mon Sep 17 00:00:00 2001
b85204
From: Laszlo Ersek <lersek@redhat.com>
b85204
Date: Thu, 12 Jan 2023 12:31:10 +0100
b85204
Subject: [PATCH] test-v2v-i-ova: spell out ntfs feature group dependency
b85204
b85204
"windows.img" is created as an empty phony image if the libguestfs
b85204
appliance lacks the ntfs feature group.
b85204
b85204
"tests/Makefile.am" deals well with this, because for the "central"
b85204
"windows.vmdk" target, we restrict the VMDK conversion to a non-empty
b85204
"windows.img". Subsequently, dependent test cases check for "windows.vmdk"
b85204
specifically, and if that file is missing, the tests are skipped (they
b85204
exit with code 77).
b85204
b85204
"test-v2v-i-ova.sh" and "test-v2v-i-ova-directory.sh" are exceptions
b85204
however. They perform the same conversion manually (in their own separate
b85204
workspace directories). They assume that, if "windows.img" exists, it can
b85204
be converted to VMDK. When the image size is zero, the conversion breaks,
b85204
and both test cases fail. Skip both tests if "windows.img" is empty.
b85204
b85204
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
b85204
Acked-by: Richard W.M. Jones <rjones@redhat.com>
b85204
[lersek@redhat.com: replace further occurrences of windows.img with $f]
b85204
---
b85204
 tests/test-v2v-i-ova-directory.sh | 7 ++++---
b85204
 tests/test-v2v-i-ova.sh           | 7 ++++---
b85204
 2 files changed, 8 insertions(+), 6 deletions(-)
b85204
b85204
diff --git a/tests/test-v2v-i-ova-directory.sh b/tests/test-v2v-i-ova-directory.sh
b85204
index fff236f5..ec858464 100755
b85204
--- a/tests/test-v2v-i-ova-directory.sh
b85204
+++ b/tests/test-v2v-i-ova-directory.sh
b85204
@@ -25,7 +25,9 @@ set -e
b85204
 set -x
b85204
 
b85204
 skip_if_skipped
b85204
-requires test -f ../test-data/phony-guests/windows.img
b85204
+f=../test-data/phony-guests/windows.img
b85204
+requires test -f $f
b85204
+requires test -s $f
b85204
 
b85204
 export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
b85204
 export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
b85204
@@ -39,8 +41,7 @@ vmdk=test-ova.vmdk
b85204
 ovf=test-v2v-i-ova.ovf
b85204
 mf=test-ova.mf
b85204
 
b85204
-qemu-img convert ../test-data/phony-guests/windows.img \
b85204
-         -O vmdk $d/$vmdk
b85204
+qemu-img convert $f -O vmdk $d/$vmdk
b85204
 cp "$srcdir/$ovf" $d/$ovf
b85204
 sha1=`do_sha1 $d/$ovf`
b85204
 echo "SHA1($ovf)= $sha1" > $d/$mf
b85204
diff --git a/tests/test-v2v-i-ova.sh b/tests/test-v2v-i-ova.sh
b85204
index a55966a7..7d988330 100755
b85204
--- a/tests/test-v2v-i-ova.sh
b85204
+++ b/tests/test-v2v-i-ova.sh
b85204
@@ -25,7 +25,9 @@ set -e
b85204
 set -x
b85204
 
b85204
 skip_if_skipped
b85204
-requires test -f ../test-data/phony-guests/windows.img
b85204
+f=../test-data/phony-guests/windows.img
b85204
+requires test -f $f
b85204
+requires test -s $f
b85204
 
b85204
 export VIRT_TOOLS_DATA_DIR="$srcdir/../test-data/fake-virt-tools"
b85204
 export VIRTIO_WIN="$srcdir/../test-data/fake-virtio-win"
b85204
@@ -41,8 +43,7 @@ mf=test-ova.mf
b85204
 ova=test-ova.ova
b85204
 raw=TestOva-sda
b85204
 
b85204
-qemu-img convert ../test-data/phony-guests/windows.img \
b85204
-         -O vmdk $d/$vmdk
b85204
+qemu-img convert $f -O vmdk $d/$vmdk
b85204
 cp "$srcdir/$ovf" $d/$ovf
b85204
 sha1=`do_sha1 $d/$ovf`
b85204
 echo "SHA1($ovf)= $sha1" > $d/$mf