qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/2] qemu-iotests: Test qemu-img operation on zero size image
Date: Fri, 12 Oct 2012 18:57:36 +0200	[thread overview]
Message-ID: <50784C00.6020307@redhat.com> (raw)
In-Reply-To: <1350045069-8500-3-git-send-email-kwolf@redhat.com>

Il 12/10/2012 14:31, Kevin Wolf ha scritto:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  tests/qemu-iotests/041     |   78 ++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/041.out |   15 ++++++++
>  tests/qemu-iotests/group   |    1 +
>  3 files changed, 94 insertions(+), 0 deletions(-)
>  create mode 100755 tests/qemu-iotests/041
>  create mode 100644 tests/qemu-iotests/041.out
> 
> diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
> new file mode 100755
> index 0000000..c3c3ca8
> --- /dev/null
> +++ b/tests/qemu-iotests/041
> @@ -0,0 +1,78 @@
> +#!/bin/bash
> +#
> +# Test qemu-img operation on zero size images
> +#
> +# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
> +#
> +
> +# creator
> +owner=kwolf@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 qcow qed vmdk
> +_supported_proto file
> +_supported_os Linux
> +
> +echo
> +echo "== Creating zero size image =="
> +
> +_make_test_img 0
> +_check_test_img
> +
> +mv $TEST_IMG $TEST_IMG.orig
> +
> +echo
> +echo "== Converting the image =="
> +
> +$QEMU_IMG convert -O $IMGFMT $TEST_IMG.orig $TEST_IMG
> +_check_test_img
> +
> +echo
> +echo "== Converting the image, compressed =="
> +
> +if [ "$IMGFMT" == "qcow2" ]; then
> +    $QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
> +fi
> +_check_test_img
> +
> +echo
> +echo "== Rebasing the image =="
> +
> +$QEMU_IMG rebase -u -b $TEST_IMG.orig $TEST_IMG
> +$QEMU_IMG rebase -b $TEST_IMG.orig $TEST_IMG
> +_check_test_img
> +
> +# success, all done
> +echo "*** done"
> +rm -f $seq.full
> +status=0
> +
> diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
> new file mode 100644
> index 0000000..98514fa
> --- /dev/null
> +++ b/tests/qemu-iotests/041.out
> @@ -0,0 +1,15 @@
> +QA output created by 041
> +
> +== Creating zero size image ==
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=0 
> +No errors were found on the image.
> +
> +== Converting the image ==
> +No errors were found on the image.
> +
> +== Converting the image, compressed ==
> +No errors were found on the image.
> +
> +== Rebasing the image ==
> +No errors were found on the image.
> +*** done
> diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
> index 66d2ba9..fa4a7da 100644
> --- a/tests/qemu-iotests/group
> +++ b/tests/qemu-iotests/group
> @@ -47,3 +47,4 @@
>  038 rw auto backing
>  039 rw auto
>  040 rw auto
> +041 rw auto quick
> 

FWIW, this will require renaming the mirror test to 042 :(  Since I have
multiple patches touching the file while you have just one, any chance
you can hold up this series for a week or so?

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

  reply	other threads:[~2012-10-12 16:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 12:31 [Qemu-devel] [PATCH 0/2] qemu-img: Fix division by zero for zero size images Kevin Wolf
2012-10-12 12:31 ` [Qemu-devel] [PATCH 1/2] " Kevin Wolf
2012-10-12 16:56   ` Paolo Bonzini
2012-10-12 12:31 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: Test qemu-img operation on zero size image Kevin Wolf
2012-10-12 16:57   ` Paolo Bonzini [this message]
2012-10-15  8:47     ` Kevin Wolf
2012-10-15  9:42       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50784C00.6020307@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).