X-Git-Url: https://repo.jachan.dev/qemu.git/blobdiff_plain/adde0204e4edbebfeb77d244cad7d9d8be7ed7e0..7ea53245335b4f60b56a3323232baa39d9bb1ebb:/tests/qemu-iotests/025 diff --git a/tests/qemu-iotests/025 b/tests/qemu-iotests/025 index c41370f3b2..e05d833452 100755 --- a/tests/qemu-iotests/025 +++ b/tests/qemu-iotests/025 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # Resizing images # @@ -24,7 +24,6 @@ owner=stefanha@linux.vnet.ibm.com seq=`basename $0` echo "QA output created by $seq" -here=`pwd` status=1 # failure is the default! _cleanup() @@ -38,9 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter . ./common.pattern -_supported_fmt raw qcow2 qed -_supported_proto file sheepdog rbd nfs archipelago -_supported_os Linux +_supported_fmt raw qcow2 qed luks +_supported_proto file sheepdog rbd nfs echo "=== Creating image" echo @@ -62,6 +60,13 @@ length EOF _check_test_img +# bdrv_truncate() doesn't zero the new space, so we need to do that explicitly. +# We still want to test automatic zeroing for other formats even though +# bdrv_truncate() doesn't guarantee it. +if [ "$IMGFMT" == "luks" ]; then + $QEMU_IO -c "write -z $small_size $((big_size - small_size))" "$TEST_IMG" > /dev/null +fi + echo echo "=== Verifying image size after reopen" $QEMU_IO -c "length" "$TEST_IMG"