mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
tests: specify the image format when possible
When possible, make the disk image format explicit when invoking tools or using add-drive. This avoids warnings from qemu about the unspecified format for the image, and also makes qemu slightly faster (skipping the disk image probing). Tests checking the image probing are not touched. This changes also: - old-style invocations of tools (`$tool $filename`) into new style (`$tool -a $filename`) - add-drive-ro/add-drive-with-if guestfish commands into add/add-drive with explicit readonly/iface arguments There should be no change in the tests results.
This commit is contained in:
@@ -57,7 +57,7 @@ guestfish -- \
|
||||
backingfile:../test-data/phony-guests/fedora.img backingformat:raw
|
||||
|
||||
mkdir mp
|
||||
./guestmount -a test.qcow2 -m /dev/VG/Root --pid-file test.pid mp
|
||||
./guestmount --format=qcow2 -a test.qcow2 -m /dev/VG/Root --pid-file test.pid mp
|
||||
cp $0 mp/test-umount
|
||||
|
||||
# Save the PID of guestmount.
|
||||
@@ -82,7 +82,7 @@ fi
|
||||
# It should now be safe to copy and read the disk image.
|
||||
cp test.qcow2 test-copy.qcow2
|
||||
|
||||
if [ "$(guestfish -a test-copy.qcow2 --ro -i is-file /test-umount)" != "true" ]; then
|
||||
if [ "$(guestfish --format=qcow2 -a test-copy.qcow2 --ro -i is-file /test-umount)" != "true" ]; then
|
||||
echo "$0: test failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user