From patchwork Tue May 14 13:55:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10943021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D2DB613AD for ; Tue, 14 May 2019 13:56:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C198728715 for ; Tue, 14 May 2019 13:56:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B637328716; Tue, 14 May 2019 13:56:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7242E28718 for ; Tue, 14 May 2019 13:56:37 +0000 (UTC) Received: from localhost ([127.0.0.1]:48596 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQXv2-00063A-Pk for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 May 2019 09:56:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQXu3-0005BH-2E for qemu-devel@nongnu.org; Tue, 14 May 2019 09:55:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQXu2-0006EU-0I for qemu-devel@nongnu.org; Tue, 14 May 2019 09:55:35 -0400 Received: from mail-eopbgr150109.outbound.protection.outlook.com ([40.107.15.109]:50035 helo=EUR01-DB5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQXty-00063f-Ct; Tue, 14 May 2019 09:55:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ha9v/mj7CFKfQE2RMbNIRPym71vuoqL6gmzlwemIDdg=; b=cBrn83hGXjOz5t8r1FQk8bO8YnhPd6cwW8wKFx5wkLqDC06/yaIvp9soas8n7TytkkECwaxrGJHY7QKCwNESF0o1WBYW8B8oDReg9cr0sARPEV9EdSWaBvZHDf3s364+CV61CFI97VwIDvmnRYj1q1tpUnaa+OLgIYVKZz6L/ag= Received: from VI1PR08MB4078.eurprd08.prod.outlook.com (20.178.127.92) by VI1PR08MB3117.eurprd08.prod.outlook.com (52.133.15.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Tue, 14 May 2019 13:55:26 +0000 Received: from VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::8ce8:ffb4:fe9:4900]) by VI1PR08MB4078.eurprd08.prod.outlook.com ([fe80::8ce8:ffb4:fe9:4900%3]) with mapi id 15.20.1878.024; Tue, 14 May 2019 13:55:26 +0000 From: Anton Nefedov To: "qemu-block@nongnu.org" Thread-Topic: [PATCH] iotest 134: test cluster-misaligned encrypted write Thread-Index: AQHVClyuZmHg12OSEkK/joUO9Y+YdA== Date: Tue, 14 May 2019 13:55:26 +0000 Message-ID: <20190514135515.34355-1-anton.nefedov@virtuozzo.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: HE1PR0202CA0002.eurprd02.prod.outlook.com (2603:10a6:3:8c::12) To VI1PR08MB4078.eurprd08.prod.outlook.com (2603:10a6:803:e5::28) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [185.231.240.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2ea2bc3a-8d5b-4776-8203-08d6d873d15c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:VI1PR08MB3117; x-ms-traffictypediagnostic: VI1PR08MB3117: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:883; x-forefront-prvs: 0037FD6480 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(366004)(376002)(346002)(136003)(39850400004)(189003)(199004)(478600001)(316002)(68736007)(54906003)(86362001)(66066001)(1076003)(36756003)(5660300002)(6436002)(6116002)(2906002)(3846002)(6486002)(64756008)(66446008)(66476007)(73956011)(66946007)(66556008)(5640700003)(71190400001)(71200400001)(2501003)(44832011)(476003)(2616005)(486006)(8936002)(81166006)(386003)(14454004)(99286004)(6506007)(53936002)(966005)(81156014)(107886003)(6512007)(4326008)(6306002)(52116002)(2351001)(8676002)(14444005)(256004)(102836004)(25786009)(7736002)(6916009)(186003)(50226002)(305945005)(26005)(21314003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR08MB3117; H:VI1PR08MB4078.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: NCVFCk7DH0ttWlQ1I8xqros937yXKEMmTsmlQIYcoMxd9pZYVT9ve9ccxZgHWONBIiCmxzUH7FwFxliNg5rSAvjkAEFIsJzitjtMmiitmQltaSxRpE761qWyg7fu+P20QNHGmPw7avKfLmHhTPV+Ru0dL+0WKn8dkTvFSvv7ENRTAkkL6XonCIdDQiJXz7zTfX1RSN+3d9tODRidJlDxD/yTPvRNTXwjMI+FxtHjLLzjiC3SvJ9wLYNdYprGbLmCdAwf1Dn4rDHNmN1oW34P4rVjSMmRam0aDbfZTMhVH0Q7m/DAT9nI7yjcjXcppfnga+/WHJ9PlmJV1nIk1PKu0Kq8b9Eeu6me2QyBn6fdYSYDyFY212fcJ45jJsemlgaVEY9pkfq0JbwNmZ5qCDf6U08eLj5Rg308s9RqdGhY7d0= MIME-Version: 1.0 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea2bc3a-8d5b-4776-8203-08d6d873d15c X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2019 13:55:26.6584 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3117 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.15.109 Subject: [Qemu-devel] [PATCH] iotest 134: test cluster-misaligned encrypted write 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: "kwolf@redhat.com" , Anton Nefedov , "qemu-devel@nongnu.org" , "mreitz@redhat.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP COW (even empty/zero) areas require encryption too Signed-off-by: Anton Nefedov Reviewed-by: Eric Blake Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia --- used to be a part of 'qcow2: cluster space preallocation' series http://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg02769.html tests/qemu-iotests/134 | 9 +++++++++ tests/qemu-iotests/134.out | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134 index e9e3e84c2a..f5fd3b7f34 100755 --- a/tests/qemu-iotests/134 +++ b/tests/qemu-iotests/134 @@ -57,6 +57,15 @@ echo echo "== reading whole image ==" $QEMU_IO --object $SECRET -c "read 0 $size" --image-opts $IMGSPEC | _filter_qemu_io | _filter_testdir +echo +echo "== rewriting cluster part ==" +$QEMU_IO --object $SECRET -c "write -P 0xb 512 512" --image-opts $IMGSPEC | _filter_qemu_io | _filter_testdir + +echo +echo "== verify pattern ==" +$QEMU_IO --object $SECRET -c "read -P 0 0 512" --image-opts $IMGSPEC | _filter_qemu_io | _filter_testdir +$QEMU_IO --object $SECRET -c "read -P 0xb 512 512" --image-opts $IMGSPEC | _filter_qemu_io | _filter_testdir + echo echo "== rewriting whole image ==" $QEMU_IO --object $SECRET -c "write -P 0xa 0 $size" --image-opts $IMGSPEC | _filter_qemu_io | _filter_testdir diff --git a/tests/qemu-iotests/134.out b/tests/qemu-iotests/134.out index 972be49d91..09d46f6b17 100644 --- a/tests/qemu-iotests/134.out +++ b/tests/qemu-iotests/134.out @@ -5,6 +5,16 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 encryption=on encrypt. read 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +== rewriting cluster part == +wrote 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +== verify pattern == +read 512/512 bytes at offset 0 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 512/512 bytes at offset 512 +512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + == rewriting whole image == wrote 134217728/134217728 bytes at offset 0 128 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)