qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 6/6] qemu-iotests: Check qemu-img command lin


From: Eric Blake
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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 02/20/2014 07:57 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  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 <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]