[Libguestfs] [PATCH] sparsify: Fix test-virt-sparsify-in-place-fstrim-unsupported.sh

Pino Toscano ptoscano at redhat.com
Thu Sep 6 13:49:10 UTC 2018


On Wednesday, 5 September 2018 18:30:39 CEST Richard W.M. Jones wrote:
> Since Linux commit f663b5b38fff trimming vfat is now supported by
> Linux.  This broke the test which assumed it was not supported.  Use
> another filesystem (minix) which does not support trimming instead.
> 
> Thanks: Daniel P. Berrangé and Pino Toscano.
> ---
>  ...virt-sparsify-in-place-fstrim-unsupported.sh | 17 ++++++++++-------
>  1 file changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/sparsify/test-virt-sparsify-in-place-fstrim-unsupported.sh b/sparsify/test-virt-sparsify-in-place-fstrim-unsupported.sh
> index ff7dab3fa..e2b2e9c20 100755
> --- a/sparsify/test-virt-sparsify-in-place-fstrim-unsupported.sh
> +++ b/sparsify/test-virt-sparsify-in-place-fstrim-unsupported.sh
> @@ -21,13 +21,11 @@
>  #
>  # https://bugzilla.redhat.com/show_bug.cgi?id=1364347
>  #
> -# This test assumes that the kernel vfat driver does not support
> +# This test assumes that the kernel minix driver does not support
>  # fstrim.  It might become supported in a future kernel version in
>  # which case we could use a different filesystem for this test, or
>  # delete the test if we are confident that all common filesystems are
>  # supported.

Spot-on comment...

> -# Create a test filesystem with a single vfat filesystem.
> -guestfish -N $img=fs:vfat exit
> +# Create a test filesystem with a single minix filesystem.  If this
> +# fails, skip the test under the assumption that (like with Enterprise
> +# Linux systems) Minix is not supported.
> +guestfish -N $img=fs:minix exit || {
> +    echo $0: skipping the test because Minix filesystems are not supported
> +    exit 77
> +}

IMHO a better test would be using "filesystem_available minix", although
that means spawning the appliance once more.  In case of genuine
failure in libguestfs/guestfish, the above check will mark the test as
skipped, which is not the ideal situation IMHO.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20180906/8bee8ec9/attachment.sig>


More information about the Libguestfs mailing list