From patchwork Wed Oct 17 14:33:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alberto Garcia X-Patchwork-Id: 985415 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=igalia.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="VC3eQ9r4"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42ZvqY53ZHz9s8J for ; Thu, 18 Oct 2018 01:35:53 +1100 (AEDT) Received: from localhost ([::1]:37020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCmvP-0000Rd-9V for incoming@patchwork.ozlabs.org; Wed, 17 Oct 2018 10:35:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCmuJ-0000D8-5M for qemu-devel@nongnu.org; Wed, 17 Oct 2018 10:34:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCmuG-0006Gd-7g for qemu-devel@nongnu.org; Wed, 17 Oct 2018 10:34:43 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:48025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCmuE-0005or-F3; Wed, 17 Oct 2018 10:34:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=jPmBiybIYQlNkYQMVI+70/FvaaYTdPTfPByJcNwaI1M=; b=VC3eQ9r4rQ57VuX5UrEIhlHT2bP48BLiDDk0HEgDzCxjMM8p95Kg7Hc/5GjNVczdRa0mFqGlgKxkcx62AoIplHCMq2M1pJh8kOM1mGwXs7Vh+T1gmAkNJo1JAMCO6eR1y9kn6V32T3qDrQ62K0wBC8vRJ40HlAybtNPPblMYb704V/a8bE+xGbb4qkXVrFEoldGmoGo8W/58POvd581S4zRnyYhyaZVyHw664V8eLGsyRuYP6+dkU2n8Q/lUERBWVDG8V+YhHJ2JDhW8xF8+fZSA81e/WU48EhFPNKBDMVT/03ldblB1CuyhjoudE0xp6uYpYc6nzioDc+2PSdoCrg==; Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1gCmtt-0004Gq-9f; Wed, 17 Oct 2018 16:34:17 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1gCmtb-0003id-Bz; Wed, 17 Oct 2018 17:33:59 +0300 From: Alberto Garcia To: qemu-devel@nongnu.org Date: Wed, 17 Oct 2018 17:33:51 +0300 Message-Id: <3e64535f5e375a67890d3f912bc4618471d8e0ff.1539786605.git.berto@igalia.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH 3/3] iotest: Test the blkverify mode of the Quorum driver X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , Markus Armbruster , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alberto Garcia --- tests/qemu-iotests/081 | 30 ++++++++++++++++++++++++++++++ tests/qemu-iotests/081.out | 16 ++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index da3fb0984b..0ea010afbf 100755 --- a/tests/qemu-iotests/081 +++ b/tests/qemu-iotests/081 @@ -168,6 +168,36 @@ echo "== checking that quorum is broken ==" $QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu_io +echo +echo "== checking the blkverify mode with broken content ==" + +quorum="driver=raw,file.driver=quorum,file.vote-threshold=2,file.blkverify=on" +quorum="$quorum,file.children.0.file.filename=$TEST_DIR/1.raw" +quorum="$quorum,file.children.1.file.filename=$TEST_DIR/2.raw" +quorum="$quorum,file.children.0.driver=raw" +quorum="$quorum,file.children.1.driver=raw" + +$QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu_io + +echo +echo "== writing the same data to both files ==" + +$QEMU_IO -c "write -P 0x32 0 $size" "$TEST_DIR/1.raw" | _filter_qemu_io +$QEMU_IO -c "write -P 0x32 0 $size" "$TEST_DIR/2.raw" | _filter_qemu_io + +echo +echo "== checking the blkverify mode with valid content ==" + +$QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu_io + +echo +echo "== checking the blkverify mode with invalid settings ==" + +quorum="$quorum,file.children.2.file.filename=$TEST_DIR/3.raw" +quorum="$quorum,file.children.2.driver=raw" + +$QEMU_IO -c "open -o $quorum" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out index 2533c31c78..2f12c890e9 100644 --- a/tests/qemu-iotests/081.out +++ b/tests/qemu-iotests/081.out @@ -55,4 +55,20 @@ wrote 10485760/10485760 bytes at offset 0 == checking that quorum is broken == read failed: Input/output error + +== checking the blkverify mode with broken content == +quorum: offset=0 bytes=10485760 contents mismatch at offset 0 + +== writing the same data to both files == +wrote 10485760/10485760 bytes at offset 0 +10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 10485760/10485760 bytes at offset 0 +10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== checking the blkverify mode with valid content == +read 10485760/10485760 bytes at offset 0 +10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== checking the blkverify mode with invalid settings == +can't open: blkverify=on can only be set if there are exactly two files and vote-threshold is 2 *** done