On 02/20/2014 07:57 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kw...@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 <ebl...@redhat.com>

-- 
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