From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-devel@nongnu.org
Cc: famz@redhat.com, armbru@redhat.com, stefanha@redhat.com,
mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 6/6] qemu-iotests: Check qemu-img command line parsing
Date: Thu, 20 Feb 2014 10:51:20 -0700 [thread overview]
Message-ID: <53064098.3010804@redhat.com> (raw)
In-Reply-To: <1392908243-8835-7-git-send-email-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2138 bytes --]
On 02/20/2014 07:57 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> tests/qemu-iotests/082 | 187 +++++++++++++++++++
> tests/qemu-iotests/082.out | 436 +++++++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/group | 1 +
> 3 files changed, 624 insertions(+)
> create mode 100755 tests/qemu-iotests/082
> create mode 100644 tests/qemu-iotests/082.out
>
> +
> +seq=`basename $0`
[rambling side note - I ought to submit a patch that updates all this
copy-and-pasted boilerplate to use $() instead of ``]
> +echo === create: Options specified more than once ===
> +
> +# Last -f should win
> +run_qemu_img create -f foo -f $IMGFMT $TEST_IMG $size
> +run_qemu_img info $TEST_IMG
> +
> +# Multiple -o should be merged
> +run_qemu_img create -f $IMGFMT -o cluster_size=4k -o lazy_refcounts=on $TEST_IMG $size
> +run_qemu_img info $TEST_IMG
If we later fix my corner case of trailing ',', don't forget to also add
a test for the new behavior :)
> +
> +# Adding the help option to the same -o option
> +run_qemu_img create -f $IMGFMT -o cluster_size=4k,help $TEST_IMG $size
> +run_qemu_img create -f $IMGFMT -o cluster_size=4k,\? $TEST_IMG $size
You should probably also test -o help,cluster_size=4k.
> +
> +# Adding the help option to a separate -o option
> +run_qemu_img create -f $IMGFMT -o cluster_size=4k -o help $TEST_IMG $size
> +run_qemu_img create -f $IMGFMT -o cluster_size=4k -o \? $TEST_IMG $size
> +
> +# Looks like a help option, but is part of the backing file name
> +run_qemu_img create -f $IMGFMT -o backing_file=$TEST_IMG,,help $TEST_IMG $size
> +run_qemu_img create -f $IMGFMT -o backing_file=$TEST_IMG,,\? $TEST_IMG $size
Or, per my corner case:
-o backing_file=$TESET_IMG, -o help
is currently perversely part of the file name.
Even with my suggestions for further tests and improvements, this is
strictly better than what we previously had, so:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2014-02-20 17:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-20 14:57 [Qemu-devel] [PATCH v2 0/6] qemu-img: Support multiple -o options Kevin Wolf
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 1/6] qemu-option: Introduce has_help_option() Kevin Wolf
2014-02-20 15:28 ` Eric Blake
2014-02-20 20:21 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 2/6] qemu-img create: Support multiple -o options Kevin Wolf
2014-02-20 15:52 ` Eric Blake
2014-02-20 16:24 ` Eric Blake
2014-02-20 19:14 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 3/6] qemu-img convert: " Kevin Wolf
2014-02-20 16:01 ` Eric Blake
2014-02-20 19:33 ` Jeff Cody
2014-02-20 19:38 ` Eric Blake
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 4/6] qemu-img amend: " Kevin Wolf
2014-02-20 16:18 ` Eric Blake
2014-02-20 19:39 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 5/6] qemu-img: Allow -o help with incomplete argument list Kevin Wolf
2014-02-20 16:58 ` Eric Blake
2014-02-20 20:05 ` Jeff Cody
2014-02-20 14:57 ` [Qemu-devel] [PATCH v2 6/6] qemu-iotests: Check qemu-img command line parsing Kevin Wolf
2014-02-20 17:51 ` Eric Blake [this message]
2014-02-20 18:42 ` Jeff Cody
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=53064098.3010804@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.