iotests: Test convert -n -B to backing-less target

This must not crash.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200121155915.98232-3-mreitz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
Max Reitz 2020-01-21 16:59:15 +01:00
parent c69291e712
commit f535cc90b5
2 changed files with 19 additions and 0 deletions

View File

@ -276,6 +276,20 @@ $QEMU_IMG convert -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG".orig
$QEMU_IMG compare "$TEST_IMG" "$TEST_IMG".orig $QEMU_IMG compare "$TEST_IMG" "$TEST_IMG".orig
echo
echo '=== -n -B to an image without a backing file ==='
echo
# Base for the output
TEST_IMG="$TEST_IMG".base _make_test_img 64M
# Output that does have $TEST_IMG.base set as its (implicit) backing file
TEST_IMG="$TEST_IMG".orig _make_test_img 64M
# Convert with -n, which should not confuse -B with "target BDS has a
# backing file"
$QEMU_IMG convert -O $IMGFMT -B "$TEST_IMG".base -n "$TEST_IMG" "$TEST_IMG".orig
# success, all done # success, all done
echo '*** done' echo '*** done'
rm -f $seq.full rm -f $seq.full

View File

@ -228,4 +228,9 @@ Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
wrote 65536/65536 bytes at offset 0 wrote 65536/65536 bytes at offset 0
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
Images are identical. Images are identical.
=== -n -B to an image without a backing file ===
Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
Formatting 'TEST_DIR/t.IMGFMT.orig', fmt=IMGFMT size=67108864
*** done *** done