[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 73/77] iotests/028: Add test for cross-base-EOF reads
From: |
Michael Roth |
Subject: |
[PATCH 73/77] iotests/028: Add test for cross-base-EOF reads |
Date: |
Thu, 3 Sep 2020 15:59:31 -0500 |
From: Max Reitz <mreitz@redhat.com>
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>
(cherry picked from commit ae159450e161b3e1e2c5b815d19632abbbbcd1a1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qemu-iotests/028 | 19 +++++++++++++++++++
tests/qemu-iotests/028.out | 11 +++++++++++
2 files changed, 30 insertions(+)
diff --git a/tests/qemu-iotests/028 b/tests/qemu-iotests/028
index 797dae5350..1e52986b74 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
diff --git a/tests/qemu-iotests/028.out b/tests/qemu-iotests/028.out
index 37aed84436..51ae06d38f 100644
--- a/tests/qemu-iotests/028.out
+++ b/tests/qemu-iotests/028.out
@@ -730,4 +730,15 @@ read 512/512 bytes at offset 3221257728
read 512/512 bytes at offset 3221258752
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
No errors were found on the image.
+
+=== Reading across backing EOF in one operation ===
+
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=3221225472
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294968832
backing_file=TEST_DIR/t.IMGFMT.base backing_fmt=IMGFMT
+wrote 16/16 bytes at offset 3221225456
+16 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+bffffff0: 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a 2a ................
+c0000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
+read 32/32 bytes at offset 3221225456
+32 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
*** done
--
2.17.1
- [PATCH 67/77] intel_iommu: Use correct shift for 256 bits qi descriptor, (continued)
- [PATCH 67/77] intel_iommu: Use correct shift for 256 bits qi descriptor, Michael Roth, 2020/09/03
- [PATCH 69/77] libvhost-user: Report descriptor index on panic, Michael Roth, 2020/09/03
- [PATCH 06/77] nbd/server: Avoid long error message assertions CVE-2020-10761, Michael Roth, 2020/09/03
- [PATCH 71/77] migration/block-dirty-bitmap: fix dirty_bitmap_mig_before_vm_start, Michael Roth, 2020/09/03
- [PATCH 64/77] virtio-balloon: Replace free page hinting references to 'report' with 'hint', Michael Roth, 2020/09/03
- [PATCH 66/77] virtio: verify that legacy support is not accidentally on, Michael Roth, 2020/09/03
- [PATCH 68/77] virtio-pci: Changed vdev to proxy for VirtIO PCI BAR callbacks., Michael Roth, 2020/09/03
- [PATCH 62/77] virtio-balloon: always indicate S_DONE when migration fails, Michael Roth, 2020/09/03
- [PATCH 72/77] block: Fix bdrv_aligned_p*v() for qiov_offset != 0, Michael Roth, 2020/09/03
- [PATCH 73/77] iotests/028: Add test for cross-base-EOF reads,
Michael Roth <=
- [PATCH 74/77] nbd: Fix large trim/zero requests, Michael Roth, 2020/09/03
- [PATCH 70/77] Update OpenBIOS images to 7f28286f built from submodule., Michael Roth, 2020/09/03
- [PATCH 75/77] virtio-net: align RSC fields with updated virtio-net header, Michael Roth, 2020/09/03
- [PATCH 76/77] hw/arm/sbsa-ref: fix typo breaking PCIe IRQs, Michael Roth, 2020/09/03
- [PATCH 77/77] usb: fix setup_len init (CVE-2020-14364), Michael Roth, 2020/09/03
- [PATCH 07/77] virtio-balloon: fix free page hinting without an iothread, Michael Roth, 2020/09/03
- [PATCH 08/77] virtio-balloon: fix free page hinting check on unrealize, Michael Roth, 2020/09/03
- Re: [PATCH 00/77] Patch Round-up for stable 5.0.1, freeze on 2020-09-10, Philippe Mathieu-Daudé, 2020/09/04