From d1ad89520e626c7fc03fb9627b8a054abd760a61 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 18 Dec 2012 17:29:21 +0000 Subject: [PATCH] tests: Skip windows.img tests if it is zero-sized. If ntfs-3g is not installed, then tests/guests creates a 'windows.img' file which is zero-sized. This is problematical because other tests which use this image will fail at best, or hit RHBZ#847549 (qemu/virtio-scsi bug) at worst. Change the tests which use windows.img so they skip if 'windows.img' has zero size. --- inspector/test-virt-inspector.sh | 5 ++++- sysprep/test-virt-sysprep.sh | 5 ++++- tests/ntfsclone/test-ntfsclone.sh | 5 +++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/inspector/test-virt-inspector.sh b/inspector/test-virt-inspector.sh index fad5e5835..7ad075089 100755 --- a/inspector/test-virt-inspector.sh +++ b/inspector/test-virt-inspector.sh @@ -20,7 +20,10 @@ export LANG=C set -e for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do - $VG ./virt-inspector -a $f + # Ignore zero-sized windows.img if ntfs-3g is not installed. + if [ -s "$f" ]; then + $VG ./virt-inspector -a $f + fi done # We could also test this image, but mdadm is problematic for diff --git a/sysprep/test-virt-sysprep.sh b/sysprep/test-virt-sysprep.sh index 8a375f6ff..4986aa07f 100755 --- a/sysprep/test-virt-sysprep.sh +++ b/sysprep/test-virt-sysprep.sh @@ -23,7 +23,10 @@ set -e # to be able to sysprep any of our test guests. for f in ../tests/guests/{debian,fedora,ubuntu,windows}.img; do - $VG ./virt-sysprep -q -n -a $f + # Ignore zero-sized windows.img if ntfs-3g is not installed. + if [ -s "$f" ]; then + $VG ./virt-sysprep -q -n -a $f + fi done # We could also test this image, but mdadm is problematic for diff --git a/tests/ntfsclone/test-ntfsclone.sh b/tests/ntfsclone/test-ntfsclone.sh index efed7d879..d31d2a9fc 100755 --- a/tests/ntfsclone/test-ntfsclone.sh +++ b/tests/ntfsclone/test-ntfsclone.sh @@ -35,6 +35,11 @@ if ! $guestfish add /dev/null : run : available "ntfs3g"; then exit 77 fi +if [ ! -s ../guests/windows.img ]; then + echo "$0: skipped because windows.img is zero-sized" + exit 77 +fi + # Export the filesystems to the backup file. $guestfish --ro -a ../guests/windows.img <