From nobody Sun Feb 8 15:59:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487293137257480.3364872575843; Thu, 16 Feb 2017 16:58:57 -0800 (PST) Received: from localhost ([::1]:51045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceWsx-0008KG-Tu for importer@patchew.org; Thu, 16 Feb 2017 19:58:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceWm6-00019Q-OP for qemu-devel@nongnu.org; Thu, 16 Feb 2017 19:51:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceWm5-0007p7-GX for qemu-devel@nongnu.org; Thu, 16 Feb 2017 19:51:50 -0500 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceWm5-0007ny-Af; Thu, 16 Feb 2017 19:51:49 -0500 Received: by mail-wm0-x241.google.com with SMTP id c85so129304wmi.1; Thu, 16 Feb 2017 16:51:49 -0800 (PST) Received: from lean.local (bzq-79-181-80-34.red.bezeqint.net. [79.181.80.34]) by smtp.gmail.com with ESMTPSA id u184sm123712wmb.29.2017.02.16.16.51.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Feb 2017 16:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8eyhkju6J6VUQSl1Cf8j+YwFzk44d9oyD/Y18CoV7ZU=; b=rPzGQTbdQ3qMqhRGMD7hqak/+eRbgfMrfSs4Jjghx+RhLPd8o9lqfv2BBimVTV3lOr IJi1D9doSuxT4Q0H9L8UYnzHto/LNSBxGcmBpUFb4ZjLQWiweNplw9Zcu+TxS+3UZcjo 3vyWTsqLQU3nJWvoILITDf2QM61c9ObK+kF9bgp+uxZjd1PLfANdRXoOCgZwIhCsM/V6 5madAu8c98wcbxgkX/1UvbTG37sHzhPmRc9ZJOcE3Hxnb3vs6fjJYEn7HDDCT6JBrErD fjUBqsMcx00R76d/7cXqrjMTILBwdrHVZsomUoa4V//XvaCNnYbbxdcJaKBudXWFHEi2 aE3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8eyhkju6J6VUQSl1Cf8j+YwFzk44d9oyD/Y18CoV7ZU=; b=pTzfWWFyQPfsvGeDGIDSU1nMvYqhxl/Z4AL7LBP+SNUJPjKZcY/DsYu6xn0mNc91vF jCIJlurs4/VVvwmZ2SotieqFOJ1ofjQ6oqR3ThNsyODds7MNB1aNgPzhv4UL0s7/9dQK IqtW5GFSdsXjnQIXFbR6fOEaXjg3NBuqugOpL2gqnTnPX2SDv8MKi+jwTQgRMpYRo8Bg IKqewLlNJHAsocfXGo2TM6yc8gABtEX8HhvAgF54L+vhUecgpcEElcR0Dr5nTYlP1GVS HffOmSiKmPfn7vlI4s3uHev0CwTYBMtkCOv3tovv1/YDqyuw6I3UBaNHE/2zOqsCyerL qDxg== X-Gm-Message-State: AMke39lZdDgnkks//UFozqkuRHBYjkVhEKRNfbAjV/6esSwiO7BfacYkjpwj7r+ubECBVA== X-Received: by 10.28.211.205 with SMTP id k196mr169455wmg.124.1487292708018; Thu, 16 Feb 2017 16:51:48 -0800 (PST) From: Nir Soffer To: qemu-devel@nongnu.org Date: Fri, 17 Feb 2017 02:51:25 +0200 Message-Id: <20170217005127.21010-2-nirsof@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170217005127.21010-1-nirsof@gmail.com> References: <20170217005127.21010-1-nirsof@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH 1/3] qemu-img: Add tests for raw image preallocation 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, Nir Soffer , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add tests for creating raw image with and without the preallocation option. Signed-off-by: Nir Soffer --- tests/qemu-iotests/175 | 61 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/175.out | 18 ++++++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 80 insertions(+) create mode 100755 tests/qemu-iotests/175 create mode 100644 tests/qemu-iotests/175.out diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175 new file mode 100755 index 0000000..ca56e82 --- /dev/null +++ b/tests/qemu-iotests/175 @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Test creating raw image preallocation mode +# +# Copyright (C) 2017 Nir Soffer +# +# 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 . +# + +# creator +owner=3Dnirsof@gmail.com + +seq=3D`basename $0` +echo "QA output created by $seq" + +here=3D`pwd` +status=3D1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter + +_supported_fmt raw +_supported_proto file +_supported_os Linux + +size=3D1m + +echo +echo "=3D=3D creating image with default preallocation =3D=3D" +_make_test_img $size | _filter_imgfmt +stat -c "size=3D%s, blocks=3D%b" $TEST_IMG + +for mode in off full falloc; do + echo + echo "=3D=3D creating image with preallocation $mode =3D=3D" + IMGOPTS=3Dpreallocation=3D$mode _make_test_img $size | _filter_imgfmt + stat -c "size=3D%s, blocks=3D%b" $TEST_IMG +done + +# success, all done +echo "*** done" +rm -f $seq.full +status=3D0 diff --git a/tests/qemu-iotests/175.out b/tests/qemu-iotests/175.out new file mode 100644 index 0000000..76c02c6 --- /dev/null +++ b/tests/qemu-iotests/175.out @@ -0,0 +1,18 @@ +QA output created by 175 + +=3D=3D creating image with default preallocation =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 +size=3D1048576, blocks=3D0 + +=3D=3D creating image with preallocation off =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Doff +size=3D1048576, blocks=3D0 + +=3D=3D creating image with preallocation full =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Dfull +size=3D1048576, blocks=3D2048 + +=3D=3D creating image with preallocation falloc =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Dfalloc +size=3D1048576, blocks=3D2048 + *** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 985b9a6..1f4bf03 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -167,3 +167,4 @@ 172 auto 173 rw auto 174 auto +175 auto quick --=20 2.9.3