From patchwork Thu Aug 17 09:15:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Butsykin X-Patchwork-Id: 9905431 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D03C60244 for ; Thu, 17 Aug 2017 09:22:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DDCF28861 for ; Thu, 17 Aug 2017 09:22:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5291728AD6; Thu, 17 Aug 2017 09:22:28 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 60FD928861 for ; Thu, 17 Aug 2017 09:22:27 +0000 (UTC) Received: from localhost ([::1]:40624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diH0U-0005Ju-J2 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 17 Aug 2017 05:22:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diGuc-0000HR-NT for qemu-devel@nongnu.org; Thu, 17 Aug 2017 05:16:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diGub-0004eO-2w for qemu-devel@nongnu.org; Thu, 17 Aug 2017 05:16:22 -0400 Received: from mail-db5eur01on0106.outbound.protection.outlook.com ([104.47.2.106]:47612 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 1diGuV-0004Ns-Rp; Thu, 17 Aug 2017 05:16:16 -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; bh=uEq0UBQ/Bc7QRF2LpTfNWpxSt+z527ZL+/DmvCBvHJo=; b=Xazu1OJ56gUd0c6pdAJ28To+XJpoVxnddvDJZHABL8I/mWIyBt59aB09tA4guACQfe6nor0+ILwvu8ATvGQtVYlvM38NCgm7lLTDlCWvZMNcDFAm0xQUAVmU1zJSqS+4uyzfT1u/5DrmZAoNqtnxWBVsI4xfT1nSrkRG7sMJYQ0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pbutsykin@virtuozzo.com; Received: from pavelb-Z68P-DS3.sw.ru (195.214.232.6) by HE1PR0802MB2556.eurprd08.prod.outlook.com (2603:10a6:3:e1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21; Thu, 17 Aug 2017 09:16:13 +0000 From: Pavel Butsykin To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Thu, 17 Aug 2017 12:15:42 +0300 Message-Id: <20170817091542.9403-5-pbutsykin@virtuozzo.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170817091542.9403-1-pbutsykin@virtuozzo.com> References: <20170817091542.9403-1-pbutsykin@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5PR0602CA0016.eurprd06.prod.outlook.com (2603:10a6:203:a3::26) To HE1PR0802MB2556.eurprd08.prod.outlook.com (2603:10a6:3:e1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5c2c536-6e2a-4756-84d1-08d4e5509bc4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0802MB2556; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2556; 3:9oWSZBJZ89Pv0ouqcjD0pI7ZKO5yag0K2SzAUSjzIMtTVtOb/fiU48YOeRfYRl4qGQgmodlbparqmZUSvvE4/BaNTis+TYlsIS+sSV+xxfrCXsVuzVaALCMhahmRO2jYlxUldKJlPFSZGUu4Xi7XLxexQZ6lRcpTURnM/KEYq4eS4xS3rvnUlWzGBOmx3CqKyAPLYKa+jpCdyrjh7RzQ0BOLDyZfctDyXnZOKUENHSM7X7/fwqXdcFjM2lER4iTg; 25:jDLd5Vfcww2fKeNgQmUk8P8p0oMz1S872SUJQD4FDUkkpHdBMj28OvT9CwUrBc19vKnvhWH6Y1b3jsbM8QAtn0ajfuBAfAFK1HSZBIug565J97sJq109Zd3tHG7mIBzh2wqdCnEWYGaAP29elWdD+1ouJEqbxKTAleP9EuOMxSbmv5lfTK0IQaKF/wmZH1UJEKVk3g9Fe0Wjj/Lh6yhuqjZMIIxu9M2j6oBV+9nBWSlKST8Ayc1HgNPxBgsNtHaJ4QyuevLy0bh+yG7OwiNuxVSN79cGTDSTVTvkeswSUB2XqGIQwep3P+1gHnm5zYYqVwrhUuRlpvEfgQEX2rLW2w==; 31:+T2C0TEAiP1+lByxICvfcVIerWICmMz9Y9ApBqkwJpBNlJxjBf3GhlA7gqTc0fyHA13enJkjtbVFS4188ziE9oVAZs18/+13HKXE2h7CMym0ApsUv+nNuAGRn9QnDLZKGzh/ZWW/0Nu1VrP0h242plw2Gu9iXQQYtVKdCo4+SSGrFNrbMELOxZRmlZgIJgnzlRY/nw9xZiCRD2nQm+K28CMkPVicmwjHp0s/fbPgvC8= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2556: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2556; 20:2Ma5H+ixIOuuS0Kz1pNNm1tbFOJ/wQXJkEnDyz95/VhE+ZztJgWvW+ohbGE77QuxwJPZBMwUl1j9A0fdc7AfXYA/83QGYlfkVzDlMDg/6fCUtXsIgw7xr3ZzW6/DsD6DvRAFye8nwtc+FMSFs71gww1aGZ2I2Voktmsu6sekzEFKHDMgjTnqsKBhhDxPJKgpfuJAZxZvvGX+9/YGsFLvs9JWBDgUzMOJb+XA5gGW3s+waXPFPxZ00DUmqaLNbVnjhHwQ/koqYmfOBDlH/8fOxzenoBnj4ScUZ5ExLNuOZZ7BEeNvfcIQTYJrVEmedlpNSxZJ4F3w8neyvqiVJiDKkCZQhA/gm9k/cZldqFySUbEawerEuVnuxIEQSY+MZbrXdgJ94uUbKMqqjf8DbisieTTotS18Lc/U5gaE5ZzJwOU=; 4:rSafyUuJC0W7OMlKoMt43Yw2dzJBvNfDXkV9YMvRnAWKBUWJ4knzm7AVBRXWxYKIkhRVV46g2JUQC1BhW6hmAe0ba3xcUc1A86MemqlAgUz6FiXCFRH/b+tO65H79QgTqIe0yY+mGWeyfGeuGgN/HwLbeWkOrIIcTut/d3fWWVW9lCk2D7sRGZIzLoWvMmm77HeIIW3vhMxgiofoAtDN7rG/9oPUJozocnS8c4pHq0bqIP6Ahesxzoj/Yk0QIncyAIknnt5vT/ptd2ayVYt6LUhxG34zjmcYS5bgcCmnxWuQEZxbGlXWVHEJJhGPUqssMLilGg3IRGF/z2Fq5JufyQ== X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123562025)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0802MB2556; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0802MB2556; X-Forefront-PRVS: 0402872DA1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(39830400002)(199003)(189002)(86362001)(105586002)(36756003)(81166006)(50226002)(7736002)(66066001)(189998001)(6116002)(1076002)(97736004)(3846002)(81156014)(8676002)(33646002)(53936002)(107886003)(110136004)(478600001)(6506006)(575784001)(5003940100001)(6486002)(69596002)(48376002)(4326008)(2906002)(50466002)(47776003)(25786009)(6512007)(7350300001)(42186005)(53416004)(6666003)(2950100002)(5660300001)(305945005)(68736007)(50986999)(76176999)(106356001)(101416001)(6306002)(2004002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0802MB2556; H:pavelb-Z68P-DS3.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0802MB2556; 23:IsNkYgeZ4HHIDIST2uTuMqSdGJN06CwbW+RLo80?= =?us-ascii?Q?8rgk32YCYz/tP1jqQwqqm9yclNC39bQugyerKD3Vb/jL+atxlHIpKV0AamMz?= =?us-ascii?Q?Nss8OPrf5EhSYwPMTm7ozUGwzhpfrFlNj6cbIPF14BL5M323Oci/VzzIMRLG?= =?us-ascii?Q?Gx5fVDwWtMmYOQPMdMGf52FnPwKblennXKNKS8QlryrLHCDjBhZiIEuvobU6?= =?us-ascii?Q?W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utput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2556; 20:qPUKqwuBeHu2FC0PiUp6OU6eZ9gHFQ03uNpCFo7pHKW+wjWnACqixIujwMQz0GjTA4EYu3g09EeClWVy66RW/uiNu2cRk8LQmNSJJIDJh38sd20YXoxW/Ik72spUCCV3yI7Ks6OhxDJ/cQmejBlskZfPlfoIZe/5RdmNRuIaZZk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2017 09:16:13.1137 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2556 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.106 Subject: [Qemu-devel] [PATCH v7 4/4] qemu-iotests: add shrinking image test 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, pbutsykin@virtuozzo.com, jsnow@redhat.com, armbru@redhat.com, mreitz@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pavel Butsykin Reviewed-by: Max Reitz --- tests/qemu-iotests/163 | 170 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/163.out | 5 ++ tests/qemu-iotests/group | 1 + 3 files changed, 176 insertions(+) create mode 100644 tests/qemu-iotests/163 create mode 100644 tests/qemu-iotests/163.out diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163 new file mode 100644 index 0000000000..403842354e --- /dev/null +++ b/tests/qemu-iotests/163 @@ -0,0 +1,170 @@ +#!/usr/bin/env python +# +# Tests for shrinking images +# +# Copyright (c) 2016-2017 Parallels International GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +import os, random, iotests, struct, qcow2 +from iotests import qemu_img, qemu_io, image_size + +test_img = os.path.join(iotests.test_dir, 'test.img') +check_img = os.path.join(iotests.test_dir, 'check.img') + +def size_to_int(str): + suff = ['B', 'K', 'M', 'G', 'T'] + return int(str[:-1]) * 1024**suff.index(str[-1:]) + +class ShrinkBaseClass(iotests.QMPTestCase): + image_len = '128M' + shrink_size = '10M' + chunk_size = '16M' + refcount_bits = '16' + + def __qcow2_check(self, filename): + entry_bits = 3 + entry_size = 1 << entry_bits + l1_mask = 0x00fffffffffffe00 + div_roundup = lambda n, d: (n + d - 1) / d + + def split_by_n(data, n): + for x in xrange(0, len(data), n): + yield struct.unpack('>Q', data[x:x + n])[0] & l1_mask + + def check_l1_table(h, l1_data): + l1_list = list(split_by_n(l1_data, entry_size)) + real_l1_size = div_roundup(h.size, + 1 << (h.cluster_bits*2 - entry_size)) + used, unused = l1_list[:real_l1_size], l1_list[real_l1_size:] + + self.assertTrue(len(used) != 0, "Verifying l1 table content") + self.assertFalse(any(unused), "Verifying l1 table content") + + def check_reftable(fd, h, reftable): + for offset in split_by_n(reftable, entry_size): + if offset != 0: + fd.seek(offset) + cluster = fd.read(1 << h.cluster_bits) + self.assertTrue(any(cluster), "Verifying reftable content") + + with open(filename, "rb") as fd: + h = qcow2.QcowHeader(fd) + + fd.seek(h.l1_table_offset) + l1_table = fd.read(h.l1_size << entry_bits) + + fd.seek(h.refcount_table_offset) + reftable = fd.read(h.refcount_table_clusters << h.cluster_bits) + + check_l1_table(h, l1_table) + check_reftable(fd, h, reftable) + + def __raw_check(self, filename): + pass + + image_check = { + 'qcow2' : __qcow2_check, + 'raw' : __raw_check + } + + def setUp(self): + if iotests.imgfmt == 'raw': + qemu_img('create', '-f', iotests.imgfmt, test_img, self.image_len) + qemu_img('create', '-f', iotests.imgfmt, check_img, + self.shrink_size) + else: + qemu_img('create', '-f', iotests.imgfmt, + '-o', 'cluster_size=' + self.cluster_size + + ',refcount_bits=' + self.refcount_bits, + test_img, self.image_len) + qemu_img('create', '-f', iotests.imgfmt, + '-o', 'cluster_size=%s'% self.cluster_size, + check_img, self.shrink_size) + qemu_io('-c', 'write -P 0xff 0 ' + self.shrink_size, check_img) + + def tearDown(self): + os.remove(test_img) + os.remove(check_img) + + def image_verify(self): + self.assertEqual(image_size(test_img), image_size(check_img), + "Verifying image size") + self.image_check[iotests.imgfmt](self, test_img) + + if iotests.imgfmt == 'raw': + return + self.assertEqual(qemu_img('check', test_img), 0, + "Verifying image corruption") + + def test_empty_image(self): + qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img, + self.shrink_size) + + self.assertEqual( + qemu_io('-c', 'read -P 0x00 %s'%self.shrink_size, test_img), + qemu_io('-c', 'read -P 0x00 %s'%self.shrink_size, check_img), + "Verifying image content") + + self.image_verify() + + def test_sequential_write(self): + for offs in range(0, size_to_int(self.image_len), + size_to_int(self.chunk_size)): + qemu_io('-c', 'write -P 0xff %d %s' % (offs, self.chunk_size), + test_img) + + qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img, + self.shrink_size) + + self.assertEqual(qemu_img("compare", test_img, check_img), 0, + "Verifying image content") + + self.image_verify() + + def test_random_write(self): + offs_list = range(0, size_to_int(self.image_len), + size_to_int(self.chunk_size)) + random.shuffle(offs_list) + for offs in offs_list: + qemu_io('-c', 'write -P 0xff %d %s' % (offs, self.chunk_size), + test_img) + + qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img, + self.shrink_size) + + self.assertEqual(qemu_img("compare", test_img, check_img), 0, + "Verifying image content") + + self.image_verify() + +class TestShrink512(ShrinkBaseClass): + image_len = '3M' + shrink_size = '1M' + chunk_size = '256K' + cluster_size = '512' + refcount_bits = '64' + +class TestShrink64K(ShrinkBaseClass): + cluster_size = '64K' + +class TestShrink1M(ShrinkBaseClass): + cluster_size = '1M' + refcount_bits = '1' + +ShrinkBaseClass = None + +if __name__ == '__main__': + iotests.main(supported_fmts=['raw', 'qcow2']) diff --git a/tests/qemu-iotests/163.out b/tests/qemu-iotests/163.out new file mode 100644 index 0000000000..dae404e278 --- /dev/null +++ b/tests/qemu-iotests/163.out @@ -0,0 +1,5 @@ +......... +---------------------------------------------------------------------- +Ran 9 tests + +OK diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index afbdc427ea..9599d4c0de 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -166,6 +166,7 @@ 159 rw auto quick 160 rw auto quick 162 auto quick +163 rw auto quick 165 rw auto quick 170 rw auto quick 171 rw auto quick