]> Git Repo - qemu.git/blobdiff - tests/qemu-iotests/025
iotests: Add qemu_io_log()
[qemu.git] / tests / qemu-iotests / 025
index 6af1e46a1dbee386a79d404fedb5eef83377ec8a..e05d833452dc250e62d242219e0eb9c662db4127 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Resizing images
 #
 seq=`basename $0`
 echo "QA output created by $seq"
 
-here=`pwd`
-tmp=/tmp/$$
 status=1       # failure is the default!
 
 _cleanup()
@@ -39,8 +37,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 . ./common.filter
 . ./common.pattern
 
-_supported_fmt raw qcow2
-_supported_os Linux
+_supported_fmt raw qcow2 qed luks
+_supported_proto file sheepdog rbd nfs
 
 echo "=== Creating image"
 echo
@@ -55,16 +53,23 @@ _check_test_img
 
 echo
 echo "=== Resizing image"
-$QEMU_IO $TEST_IMG <<EOF
+$QEMU_IO "$TEST_IMG" <<EOF | _filter_qemu_io
 length
 truncate $big_size
 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
+$QEMU_IO -c "length" "$TEST_IMG"
 
 echo
 echo "=== Verifying resized image"
This page took 0.025359 seconds and 4 git commands to generate.