aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/244
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-09 15:10:06 -0400
committerKevin Wolf <kwolf@redhat.com>2020-04-30 17:51:06 +0200
commit3fb61087074474b088fee23bb81ffd258cb9cb2a (patch)
treebf089acc40162da08156b13aeed858b9b575422c /tests/qemu-iotests/244
parenta50c1f57e491ba17c0fcb7d285dfe04770be0a70 (diff)
downloadqemu-3fb61087074474b088fee23bb81ffd258cb9cb2a.zip
qemu-3fb61087074474b088fee23bb81ffd258cb9cb2a.tar.gz
qemu-3fb61087074474b088fee23bb81ffd258cb9cb2a.tar.bz2
qemu-iotests: allow qcow2 external discarded clusters to contain stale data
Test 244 checks the expected behavior of qcow2 external data files with respect to zero and discarded clusters. Filesystems however are free to ignore discard requests, and this seems to be the case for overlayfs. Relax the tests to skip checks on the external data file for discarded areas, which implies not using qemu-img compare in the data_file_raw=on case. This fixes docker tests on RHEL8. Cc: Kevin Wolf <kwolf@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200409191006.24429-1-pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/244')
-rwxr-xr-xtests/qemu-iotests/24410
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244
index 2ec1815..efe3c04 100755
--- a/tests/qemu-iotests/244
+++ b/tests/qemu-iotests/244
@@ -143,7 +143,6 @@ $QEMU_IO -c 'read -P 0 0 1M' \
echo
$QEMU_IO -c 'read -P 0 0 1M' \
-c 'read -P 0x11 1M 1M' \
- -c 'read -P 0 2M 2M' \
-c 'read -P 0x11 4M 1M' \
-c 'read -P 0 5M 1M' \
-f raw "$TEST_IMG.data" |
@@ -180,8 +179,15 @@ $QEMU_IO -c 'read -P 0 0 1M' \
-f $IMGFMT "$TEST_IMG" |
_filter_qemu_io
+# Discarded clusters are only marked as such in the qcow2 metadata, but
+# they can contain stale data in the external data file. Instead, zero
+# clusters must be zeroed in the external data file too.
echo
-$QEMU_IMG compare "$TEST_IMG" "$TEST_IMG.data"
+$QEMU_IO -c 'read -P 0 0 1M' \
+ -c 'read -P 0x11 1M 1M' \
+ -c 'read -P 0 3M 3M' \
+ -f raw "$TEST_IMG".data |
+ _filter_qemu_io
echo -n "qcow2 file size after I/O: "
du -b $TEST_IMG | cut -f1