[Libguestfs] [PATCH v2 nbdkit 6/6] tests: truncate: Add two simple tests of the truncate filter.

Eric Blake eblake at redhat.com
Wed Aug 1 14:23:03 UTC 2018


On 08/01/2018 06:10 AM, Richard W.M. Jones wrote:
> ---
>   tests/Makefile.am       |   7 +++
>   tests/test-truncate1.sh | 120 ++++++++++++++++++++++++++++++++++++++++
>   tests/test-truncate2.sh | 120 ++++++++++++++++++++++++++++++++++++++++
>   3 files changed, 247 insertions(+)
> 

> +
> +# Test the truncate filter using the pattern plugin.
> +
> +set -e
> +set -x

Do you want both -e and -x? Is it worth combining them as 'set -ex'? 
(I'm personally not a fan of 'set -e'; it does not behave intuitively, 
especially when shell functions are involved; but I also understand 
copy-and-paste from other tests that use it).


> +# Kill the nbdkit process on exit.
> +cleanup ()
> +{
> +    status=$?
> +
> +    kill $pid

Missing the additional cleanup fixes that you have in a separate patch 
(depending on which patch you push first...)

Otherwise seems reasonable.

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




More information about the Libguestfs mailing list