From patchwork Tue Mar 15 09:41:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 8586581 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 3B4159F54C for ; Tue, 15 Mar 2016 09:44:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9583920259 for ; Tue, 15 Mar 2016 09:44:02 +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 D77C42024C for ; Tue, 15 Mar 2016 09:44:01 +0000 (UTC) Received: from localhost ([::1]:46747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflWD-0000y2-9X for patchwork-qemu-devel@patchwork.kernel.org; Tue, 15 Mar 2016 05:44:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflUS-0006KX-3j for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:42:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aflUN-0002Lp-W7 for qemu-devel@nongnu.org; Tue, 15 Mar 2016 05:42:12 -0400 Received: from smtp3.mundo-r.com ([212.51.32.191]:11171 helo=smtp4.mundo-r.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aflUN-0002Ip-Ph; Tue, 15 Mar 2016 05:42:07 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2BIAgCX1+dW/5tjdVteGQEBAhEBAQGDFYE/plwBAgEBAQUBgQ8BkEiCDwENgXCGDQKBNTgUAQEBAQEBAWQnhEIBAQR5ED8SPBsZiCkBvFYBAQEHIIVSgkOHToNuBYdgj2+OAYFlh2+FMUSOOx4BAUKDZ2iKYwEBAQ X-IPAS-Result: A2BIAgCX1+dW/5tjdVteGQEBAhEBAQGDFYE/plwBAgEBAQUBgQ8BkEiCDwENgXCGDQKBNTgUAQEBAQEBAWQnhEIBAQR5ED8SPBsZiCkBvFYBAQEHIIVSgkOHToNuBYdgj2+OAYFlh2+FMUSOOx4BAUKDZ2iKYwEBAQ X-IronPort-AV: E=Sophos;i="5.24,338,1454972400"; d="scan'208";a="98051558" Received: from fanzine.igalia.com ([91.117.99.155]) by smtp4.mundo-r.com with ESMTP; 15 Mar 2016 10:41:52 +0100 Received: from dsl-hkibrasgw4-50df50-201.dhcp.inet.fi ([80.223.80.201] helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim) id 1aflU8-0007Nh-Dy; Tue, 15 Mar 2016 10:41:52 +0100 Received: from berto by perseus.local with local (Exim 4.86_2) (envelope-from ) id 1aflTv-00064Z-5B; Tue, 15 Mar 2016 11:41:39 +0200 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Tue, 15 Mar 2016 11:41:36 +0200 Message-Id: X-Mailer: git-send-email 2.7.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.51.32.191 Cc: Changlong Xie , Alberto Garcia , qemu-block@nongnu.org, Max Reitz Subject: [Qemu-devel] [PATCH 2/2] 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 Signed-off-by: Alberto Garcia Reviewed-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