[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/17] iotests/040: Don't check image pattern on zero-length i
From: |
John Snow |
Subject: |
[PATCH v2 04/17] iotests/040: Don't check image pattern on zero-length image |
Date: |
Thu, 24 Mar 2022 14:30:05 -0400 |
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>
---
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.34.1
- [PATCH v2 00/17] iotests: add enhanced debugging info to qemu-io failures, John Snow, 2022/03/24
- [PATCH v2 02/17] iotests/163: Fix broken qemu-io invocation, John Snow, 2022/03/24
- [PATCH v2 01/17] iotests: replace calls to log(qemu_io(...)) with qemu_io_log(), John Snow, 2022/03/24
- [PATCH v2 08/17] iotests/030: fixup, John Snow, 2022/03/24
- [PATCH v2 05/17] iotests/040: Fix TestCommitWithFilters test, John Snow, 2022/03/24
- [PATCH v2 04/17] iotests/040: Don't check image pattern on zero-length image,
John Snow <=
- [PATCH v2 07/17] iotests: rebase qemu_io() on top of qemu_tool(), John Snow, 2022/03/24
- [PATCH v2 09/17] iotests/149: fixup, John Snow, 2022/03/24
- [PATCH v2 12/17] iotests/migration-permissions: fixup, John Snow, 2022/03/24
- [PATCH v2 13/17] iotests/migration-permissions: use assertRaises() for qemu_io() negative test, John Snow, 2022/03/24
- [PATCH v2 17/17] iotests: make qemu_io_log() check return codes by default, John Snow, 2022/03/24
- [PATCH v2 14/17] iotests/image-fleecing: switch to qemu_io(), John Snow, 2022/03/24
- [PATCH v2 06/17] iotests: create generic qemu_tool() function, John Snow, 2022/03/24