qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 29/29] iotests: Test QUORUM_REPORT_BAD in fifo mode
Date: Thu, 17 Mar 2016 16:56:42 +0100	[thread overview]
Message-ID: <1458230202-29136-30-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1458230202-29136-1-git-send-email-kwolf@redhat.com>

From: Alberto Garcia <berto@igalia.com>

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-id: c0a8dbfdbe939520cda5f661af6f1cd7b6b4df9d.1458034554.git.berto@igalia.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 tests/qemu-iotests/148     | 17 +++++++++++++++--
 tests/qemu-iotests/148.out |  4 ++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/tests/qemu-iotests/148 b/tests/qemu-iotests/148
index 30bc379..d066ec3 100644
--- a/tests/qemu-iotests/148
+++ b/tests/qemu-iotests/148
@@ -35,6 +35,7 @@ sector_size = 512
 offset = 10
 
 class TestQuorumEvents(iotests.QMPTestCase):
+    read_pattern = 'quorum'
 
     def create_blkdebug_file(self, blkdebug_file, bad_sector):
         file = open(blkdebug_file, 'w')
@@ -48,6 +49,7 @@ sector = "%d"
 
     def setUp(self):
         driveopts = ['driver=quorum', 'vote-threshold=2']
+        driveopts.append('read-pattern=%s' % self.read_pattern)
         for i in range(len(imgs)):
             iotests.qemu_img('create', '-f', iotests.imgfmt, imgs[i], '1M')
             self.create_blkdebug_file(img_conf[i], i + offset)
@@ -112,7 +114,11 @@ sector = "%d"
             self.vm.hmp_qemu_io("drive0", "aio_read %d %d" %
                                 ((offset + i) * sector_size, sector_size))
             self.vm.qtest("clock_step %d" % delay)
-            self.do_check_event('img%d' % i, offset + i)
+            # In fifo mode only errors in the first child are detected
+            if i > 0 and self.read_pattern == 'fifo':
+                self.do_check_event(None)
+            else:
+                self.do_check_event('img%d' % i, offset + i)
 
         # I/O errors in different children: all events are emitted
         delay = 2 * event_rate
@@ -120,10 +126,17 @@ sector = "%d"
             self.vm.hmp_qemu_io("drive0", "aio_read %d %d" %
                                 ((offset + i) * sector_size, sector_size))
             self.vm.qtest("clock_step %d" % delay)
-            self.do_check_event('img%d' % i, offset + i)
+            # In fifo mode only errors in the first child are detected
+            if i > 0 and self.read_pattern == 'fifo':
+                self.do_check_event(None)
+            else:
+                self.do_check_event('img%d' % i, offset + i)
 
         # No more pending events
         self.do_check_event(None)
 
+class TestFifoQuorumEvents(TestQuorumEvents):
+    read_pattern = 'fifo'
+
 if __name__ == '__main__':
     iotests.main(supported_fmts=["raw"])
diff --git a/tests/qemu-iotests/148.out b/tests/qemu-iotests/148.out
index ae1213e..fbc63e6 100644
--- a/tests/qemu-iotests/148.out
+++ b/tests/qemu-iotests/148.out
@@ -1,5 +1,5 @@
-.
+..
 ----------------------------------------------------------------------
-Ran 1 tests
+Ran 2 tests
 
 OK
-- 
1.8.3.1

  parent reply	other threads:[~2016-03-17 15:57 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17 15:56 [Qemu-devel] [PULL 00/29] Block patches Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 01/29] block: Fix qemu_root_bds_opts.head initialisation Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 02/29] block: Fix memory leak in hmp_drive_add_node() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 03/29] monitor: Use BB list for BB name completion Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 04/29] block: Use blk_next() in block-backend.c Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 05/29] block: Add blk_commit_all() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 06/29] block: Use blk_{commit, flush}_all() consistently Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 07/29] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 08/29] block: Drop BB name from bad option error Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 09/29] blockdev: Rename blk_backends Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 10/29] blockdev: Add list of all BlockBackends Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 11/29] blockdev: Separate BB name management Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 12/29] blockdev: Split monitor reference from BB creation Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 13/29] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 14/29] block: Move some bdrv_*_all() functions to BB Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 15/29] block: Add bdrv_next_monitor_owned() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 16/29] block: Add blk_next_root_bs() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 17/29] block: Rewrite bdrv_next() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 18/29] block: Use bdrv_next() instead of bdrv_states Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 19/29] block: Remove bdrv_states list Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 20/29] block: Use BdrvChild in BlockBackend Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 21/29] block: Use blk_co_preadv() for blk_read() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 22/29] block: Use blk_co_pwritev() for blk_write() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 23/29] block: Pull up blk_read_unthrottled() implementation Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 24/29] block: Use blk_co_pwritev() in blk_write_zeroes() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 25/29] block: Use blk_prw() in blk_pread()/blk_pwrite() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 26/29] block: Use blk_aio_prwv() for aio_read/write/write_zeroes Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 27/29] block: Use blk_co_pwritev() in blk_co_write_zeroes() Kevin Wolf
2016-03-17 15:56 ` [Qemu-devel] [PULL 28/29] quorum: Emit QUORUM_REPORT_BAD for reads in fifo mode Kevin Wolf
2016-03-17 15:56 ` Kevin Wolf [this message]
2016-03-17 16:46 ` [Qemu-devel] [PULL 00/29] Block patches Peter Maydell

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=1458230202-29136-30-git-send-email-kwolf@redhat.com \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).