[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/14] iotests/040: Don't check image pattern on zero-length image
From: |
Hanna Reitz |
Subject: |
[PULL 05/14] iotests/040: Don't check image pattern on zero-length image |
Date: |
Mon, 25 Apr 2022 16:08:12 +0200 |
From: John Snow <jsnow@redhat.com>
qemu-io fails on read/write beyond end-of-file on raw images, so skip
these invocations when running the zero-length image tests.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220418211504.943969-5-jsnow@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
---
tests/qemu-iotests/040 | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040
index adf5815781..c4a90937dc 100755
--- a/tests/qemu-iotests/040
+++ b/tests/qemu-iotests/040
@@ -86,8 +86,10 @@ class TestSingleDrive(ImageCommitTestCase):
qemu_img('create', '-f', iotests.imgfmt,
'-o', 'backing_file=%s' % mid_img,
'-F', iotests.imgfmt, test_img)
- qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
- qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',
mid_img)
+ if self.image_len:
+ qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img)
+ qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288',
+ mid_img)
self.vm = iotests.VM().add_drive(test_img,
"node-name=top,backing.node-name=mid,backing.backing.node-name=base",
interface="none")
self.vm.add_device('virtio-scsi')
self.vm.add_device("scsi-hd,id=scsi0,drive=drive0")
@@ -101,11 +103,15 @@ class TestSingleDrive(ImageCommitTestCase):
def test_commit(self):
self.run_commit_test(mid_img, backing_img)
+ if not self.image_len:
+ return
qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img)
qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_img)
def test_commit_node(self):
self.run_commit_test("mid", "base", node_names=True)
+ if not self.image_len:
+ return
qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img)
qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_img)
@@ -192,11 +198,15 @@ class TestSingleDrive(ImageCommitTestCase):
def test_top_is_active(self):
self.run_commit_test(test_img, backing_img, need_ready=True)
+ if not self.image_len:
+ return
qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img)
qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_img)
def test_top_is_default_active(self):
self.run_default_commit_test()
+ if not self.image_len:
+ return
qemu_io('-f', 'raw', '-c', 'read -P 0xab 0 524288', backing_img)
qemu_io('-f', 'raw', '-c', 'read -P 0xef 524288 524288', backing_img)
--
2.35.1
- [PULL 00/14] Block patches, Hanna Reitz, 2022/04/25
- [PULL 01/14] block: add 'force' parameter to 'blockdev-change-medium' command, Hanna Reitz, 2022/04/25
- [PULL 02/14] iotests: replace calls to log(qemu_io(...)) with qemu_io_log(), Hanna Reitz, 2022/04/25
- [PULL 03/14] iotests/163: Fix broken qemu-io invocation, Hanna Reitz, 2022/04/25
- [PULL 04/14] iotests: Don't check qemu_io() output for specific error strings, Hanna Reitz, 2022/04/25
- [PULL 05/14] iotests/040: Don't check image pattern on zero-length image,
Hanna Reitz <=
- [PULL 06/14] iotests/040: Fix TestCommitWithFilters test, Hanna Reitz, 2022/04/25
- [PULL 07/14] iotests: create generic qemu_tool() function, Hanna Reitz, 2022/04/25
- [PULL 09/14] iotests/migration-permissions: use assertRaises() for qemu_io() negative test, Hanna Reitz, 2022/04/25
- [PULL 08/14] iotests: rebase qemu_io() on top of qemu_tool(), Hanna Reitz, 2022/04/25
- [PULL 10/14] iotests/image-fleecing: switch to qemu_io(), Hanna Reitz, 2022/04/25
- [PULL 12/14] iotests: remove qemu_io_silent() and qemu_io_silent_check()., Hanna Reitz, 2022/04/25
- [PULL 13/14] iotests: make qemu_io_log() check return codes by default, Hanna Reitz, 2022/04/25
- [PULL 11/14] iotests: remove qemu_io_pipe_and_status(), Hanna Reitz, 2022/04/25
- [PULL 14/14] iotests/108: Fix when missing user_allow_other, Hanna Reitz, 2022/04/25
- Re: [PULL 00/14] Block patches, Richard Henderson, 2022/04/25