From patchwork Wed Sep 25 10:07:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 277779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D167E2C0098 for ; Wed, 25 Sep 2013 20:08:44 +1000 (EST) Received: from localhost ([::1]:51239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOm1S-0003jA-TF for incoming@patchwork.ozlabs.org; Wed, 25 Sep 2013 06:08:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOm0O-0002Yx-UP for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOm0I-0005Uv-M2 for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:07:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOm0I-0005Uh-DV for qemu-devel@nongnu.org; Wed, 25 Sep 2013 06:07:30 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8PA7TJM005868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Sep 2013 06:07:30 -0400 Received: from localhost (dhcp-200-247.str.redhat.com [10.33.200.247]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8PA7S7R010557 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 25 Sep 2013 06:07:29 -0400 From: Max Reitz To: qemu-devel@nongnu.org Date: Wed, 25 Sep 2013 12:07:23 +0200 Message-Id: <1380103643-30419-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1380103643-30419-1-git-send-email-mreitz@redhat.com> References: <1380103643-30419-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH 2/2] qemu-iotests: Preallocated zero clusters in 061 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add a test case for zero cluster expansion on an image completely filled with preallocated zero clusters to test 061. Signed-off-by: Max Reitz --- tests/qemu-iotests/061 | 9 +++++++++ tests/qemu-iotests/061.out | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/tests/qemu-iotests/061 b/tests/qemu-iotests/061 index 5f04bfa..fa9319d 100755 --- a/tests/qemu-iotests/061 +++ b/tests/qemu-iotests/061 @@ -200,6 +200,15 @@ $QEMU_IMG snapshot -a foo "$TEST_IMG" _check_test_img $QEMU_IO -c "read -P 0 0 128k" "$TEST_IMG" | _filter_qemu_io +echo +echo "=== Testing preallocated zero expansion on full image ===" +echo +IMGOPTS="compat=1.1" TEST_IMG="$TEST_IMG" _make_test_img 64M +$QEMU_IO -c "write -P 0x2a 0 64M" "$TEST_IMG" -c "write -z 0 64M" | _filter_qemu_io +$QEMU_IMG amend -o "compat=0.10" "$TEST_IMG" +_check_test_img +$QEMU_IO -c "read -P 0 0 64M" "$TEST_IMG" | _filter_qemu_io + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index d42127f..4027e00 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -373,4 +373,15 @@ read 131072/131072 bytes at offset 0 No errors were found on the image. read 131072/131072 bytes at offset 0 128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +=== Testing preallocated zero expansion on full image === + +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 +wrote 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +No errors were found on the image. +read 67108864/67108864 bytes at offset 0 +64 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done