From patchwork Thu Mar 17 15:56:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 8612771 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C687E9F6E1 for ; Thu, 17 Mar 2016 16:09:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 29F6E201F2 for ; Thu, 17 Mar 2016 16:09:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 68B5720351 for ; Thu, 17 Mar 2016 16:09:16 +0000 (UTC) Received: from localhost ([::1]:36259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agaU7-0002vC-Mp for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Mar 2016 12:09:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agaIi-0002rk-G0 for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:57:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1agaIh-0001sy-Ex for qemu-devel@nongnu.org; Thu, 17 Mar 2016 11:57:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1agaIf-0001sH-3X; Thu, 17 Mar 2016 11:57:25 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A616C3D1; Thu, 17 Mar 2016 15:57:24 +0000 (UTC) Received: from noname.redhat.com (ovpn-116-71.ams2.redhat.com [10.36.116.71]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2HFuj1Z010106; Thu, 17 Mar 2016 11:57:23 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 17 Mar 2016 16:56:42 +0100 Message-Id: <1458230202-29136-30-git-send-email-kwolf@redhat.com> In-Reply-To: <1458230202-29136-1-git-send-email-kwolf@redhat.com> References: <1458230202-29136-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PULL 29/29] iotests: Test QUORUM_REPORT_BAD in fifo mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alberto Garcia Signed-off-by: Alberto Garcia Message-id: c0a8dbfdbe939520cda5f661af6f1cd7b6b4df9d.1458034554.git.berto@igalia.com Reviewed-by: Max Reitz Signed-off-by: Max Reitz --- 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