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

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