mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user