summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/028
diff options
context:
space:
mode:
authorMax Reitz2020-07-28 14:08:05 +0200
committerMax Reitz2020-07-28 15:28:56 +0200
commitae159450e161b3e1e2c5b815d19632abbbbcd1a1 (patch)
tree36f1167c8e0f801c1d5ddee1d103fb8c1ff3390b /tests/qemu-iotests/028
parentblock: Fix bdrv_aligned_p*v() for qiov_offset != 0 (diff)
downloadqemu-ae159450e161b3e1e2c5b815d19632abbbbcd1a1.tar.gz
qemu-ae159450e161b3e1e2c5b815d19632abbbbcd1a1.tar.xz
qemu-ae159450e161b3e1e2c5b815d19632abbbbcd1a1.zip
iotests/028: Add test for cross-base-EOF reads
Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200728120806.265916-3-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Tested-by: Claudio Fontana <cfontana@suse.de>
Diffstat (limited to 'tests/qemu-iotests/028')
-rwxr-xr-xtests/qemu-iotests/02819
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 5d043cef92..6dd3ae09a3 100755
--- a/tests/qemu-iotests/028
+++ b/tests/qemu-iotests/028
@@ -142,6 +142,25 @@ TEST_IMG="${TEST_IMG}.copy" io_zero readv $(( offset + 32 * 1024 )) 512 1024 32
_check_test_img
+echo
+echo '=== Reading across backing EOF in one operation ==='
+echo
+
+# Use a cluster boundary as the base end here
+base_size=$((3 * 1024 * 1024 * 1024))
+
+TEST_IMG="$TEST_IMG.base" _make_test_img $base_size
+_make_test_img -b "$TEST_IMG.base" -F $IMGFMT $image_size
+
+# Write 16 times 42 at the end of the base image
+$QEMU_IO -c "write -P 42 $((base_size - 16)) 16" "$TEST_IMG.base" \
+ | _filter_qemu_io
+
+# Read 32 bytes across the base EOF from the top;
+# should be 16 times 0x2a, then 16 times 0x00
+$QEMU_IO -c "read -v $((base_size - 16)) 32" "$TEST_IMG" \
+ | _filter_qemu_io
+
# success, all done
echo "*** done"
rm -f $seq.full