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.
This commit is contained in:
Richard W.M. Jones
2012-12-18 17:29:21 +00:00
parent a34072e25b
commit d1ad89520e
3 changed files with 13 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 <<EOF
run