From patchwork Wed Apr 30 18:23:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 344261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 456B9140099 for ; Thu, 1 May 2014 04:25:23 +1000 (EST) Received: from localhost ([::1]:58407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZC5-0000TO-3J for incoming@patchwork.ozlabs.org; Wed, 30 Apr 2014 14:25:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45583) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZBD-0006qI-Pv for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfZB8-0003G2-RE for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfZB8-0003Fp-KA for qemu-devel@nongnu.org; Wed, 30 Apr 2014 14:24:22 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3UIOLvB029269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 30 Apr 2014 14:24:21 -0400 Received: from noname.redhat.com (ovpn-116-113.ams2.redhat.com [10.36.116.113]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3UIO4ii011903; Wed, 30 Apr 2014 14:24:20 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 30 Apr 2014 20:23:42 +0200 Message-Id: <1398882243-14783-11-git-send-email-kwolf@redhat.com> In-Reply-To: <1398882243-14783-1-git-send-email-kwolf@redhat.com> References: <1398882243-14783-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PULL 10/31] iotests: Discarding compressed clusters on qcow2 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 From: Max Reitz Add a test which discards a compressed cluster on qcow2. This should work without any problems. Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- tests/qemu-iotests/090 | 61 ++++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/090.out | 12 +++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 74 insertions(+) create mode 100755 tests/qemu-iotests/090 create mode 100644 tests/qemu-iotests/090.out diff --git a/tests/qemu-iotests/090 b/tests/qemu-iotests/090 new file mode 100755 index 0000000..8d032f8 --- /dev/null +++ b/tests/qemu-iotests/090 @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Test for discarding compressed clusters on qcow2 images +# +# Copyright (C) 2014 Red Hat, Inc. +# +# 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=mreitz@redhat.com + +seq="$(basename $0)" +echo "QA output created by $seq" + +here="$PWD" +tmp=/tmp/$$ +status=1 # 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 qcow2 +_supported_proto file +_supported_os Linux + +IMG_SIZE=128K + +_make_test_img $IMG_SIZE + +$QEMU_IO -c 'write -c -P 42 0 64k' \ + -c 'write -c -P 23 64k 64k' \ + -c 'discard 64k 64k' \ + "$TEST_IMG" | _filter_qemu_io + +$QEMU_IO -c 'read -P 0 64k 64k' "$TEST_IMG" | _filter_qemu_io + +_check_test_img + +# success, all done +echo "*** done" +rm -f $seq.full +status=0 diff --git a/tests/qemu-iotests/090.out b/tests/qemu-iotests/090.out new file mode 100644 index 0000000..2df93e0 --- /dev/null +++ b/tests/qemu-iotests/090.out @@ -0,0 +1,12 @@ +QA output created by 090 +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 +wrote 65536/65536 bytes at offset 0 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +discard 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 65536/65536 bytes at offset 65536 +64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +No errors were found on the image. +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index 864643d..ae09663 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -95,3 +95,4 @@ 086 rw auto quick 087 rw auto 088 rw auto +090 rw auto quick