On 01/29/2013 03:01 AM, Kevin Wolf wrote:
> Just create lots of images and try out each of the creation options that
> qcow2 provides (except backing_file/fmt for now)
> 
> I'm not totally happy with the behaviour of qemu-img in each of the
> cases, but let's be explicit and update the test when we do change
> things later.
> 
> Signed-off-by: Kevin Wolf <kw...@redhat.com>
> ---

> @@ -0,0 +1,117 @@
> +#!/bin/bash

Good, because you definitely used some bash-isms (such as sizes+="more").

> +# creator
> +owner=kw...@redhat.com
> +
> +seq=`basename $0`

Since you are already using a capable shell, why not go all the way and
use $() instead of ``?  And in this case, why not:

seq=${0##*/}

to avoid a fork?

> +echo "QA output created by $seq"
> +
> +here=`pwd`

Likewise, since you are using a capable shell, you can avoid a fork:

here=$PWD

> +tmp=/tmp/$$

And since you are using a capable shell, it would be more secure to use:

tmp=/tmp/$$.$RANDOM

> +status=1     # failure is the default!
> +
> +_cleanup()
> +{

POSIX-style declaration,...

> +     _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
> +
> +function test_qemu_img()

...bash-style declaration.  I generally frown on the use of 'function'
in shell scripts, as it is not portable, and takes up more screen-space
than the POSIX style.

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