qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DI


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v5 01/10] qemu-iotests: refuse to run if TEST_DIR contains spaces
Date: Tue, 17 Oct 2017 20:03:56 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/17/2017 11:31 AM, Jeff Cody wrote:
> Currently, not all qemu-iotests work if TEST_DIR has spaces, and they
> also might not be safe.  Refuse to run if TEST_DIR in this case, at
> least until all tests are fixed sometime in the future.
> 
> Signed-off-by: Jeff Cody <address@hidden>
> ---
>  tests/qemu-iotests/check | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index e6b6ff7..e2163cc 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -102,6 +102,14 @@ if [ -z "$TEST_DIR" ]; then
>          TEST_DIR=`pwd`/scratch
>  fi
>  
> +case $TEST_DIR in
> +    *[[:blank:]]*)
> +        echo "The TEST_DIR pathname '$TEST_DIR' contains whitespace. "

Echoes a trailing space. Do we care?

> +        echo "This is currently unsupported by qemu-iotests"

Is it just whitespace, or should we also be wary of other shell
metacharacters (such as quotes or glob characters)?  In test 197, I did
an alternative check for anything that is not alphanumeric, -, or _ (and
allowing / between names).

> +        exit 1
> +        ;;
> +esac
> +
>  if [ ! -e "$TEST_DIR" ]; then
>          mkdir "$TEST_DIR"
>  fi
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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