All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	Hanna Reitz <hreitz@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-block@nongnu.org
Subject: [PATCH v3 04/12] iotests/040: Don't check image pattern on zero-length image
Date: Mon, 18 Apr 2022 17:14:56 -0400	[thread overview]
Message-ID: <20220418211504.943969-5-jsnow@redhat.com> (raw)
In-Reply-To: <20220418211504.943969-1-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>
---
 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 adf5815781e..c4a90937dcb 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



  parent reply	other threads:[~2022-04-18 21:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 21:14 [PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures John Snow
2022-04-18 21:14 ` [PATCH v3 01/12] iotests: replace calls to log(qemu_io(...)) with qemu_io_log() John Snow
2022-04-18 21:14 ` [PATCH v3 02/12] iotests/163: Fix broken qemu-io invocation John Snow
2022-04-18 21:14 ` [PATCH v3 03/12] iotests: Don't check qemu_io() output for specific error strings John Snow
2022-04-18 21:14 ` John Snow [this message]
2022-04-18 21:14 ` [PATCH v3 05/12] iotests/040: Fix TestCommitWithFilters test John Snow
2022-04-18 21:14 ` [PATCH v3 06/12] iotests: create generic qemu_tool() function John Snow
2022-04-18 21:14 ` [PATCH v3 07/12] iotests: rebase qemu_io() on top of qemu_tool() John Snow
2022-04-19 19:19   ` Eric Blake
2022-04-18 21:15 ` [PATCH v3 08/12] iotests/migration-permissions: use assertRaises() for qemu_io() negative test John Snow
2022-04-18 21:15 ` [PATCH v3 09/12] iotests/image-fleecing: switch to qemu_io() John Snow
2022-04-18 21:15 ` [PATCH v3 10/12] iotests: remove qemu_io_pipe_and_status() John Snow
2022-04-18 21:15 ` [PATCH v3 11/12] iotests: remove qemu_io_silent() and qemu_io_silent_check() John Snow
2022-04-18 21:15 ` [PATCH v3 12/12] iotests: make qemu_io_log() check return codes by default John Snow
2022-04-25 12:31 ` [PATCH v3 00/12] iotests: add enhanced debugging info to qemu-io failures Hanna Reitz
2022-04-26 16:40   ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220418211504.943969-5-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=eblake@redhat.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.