Re: [PATCH 2/3] modify xfs/ quota tests to work on generic filesystems

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



On Tue, Sep 20, 2016 at 05:21:46PM -0500, Eric Sandeen wrote:
> Fix several xfs quota tests to work on non-xfs filesystems.
> 
> New _require function to be sure that the xfs_quota tool can operate
> on foreign filesystems; if it can, and if it needs to, it adds "-f"
> to the XFS_QUOTA_PROG variable.
> 
> Modify _qmount to do quotacheck/quotaon to mount and /enable/
> quota.  On xfs this isn't needed and/or fails; it's ignored.
> 
> All quota-related options used as arguments to _qmount are changed
> from i.e. uquota to i.e. usrquota; the latter is standard across
> almost all linux filesytems, including xfs.
> 
> xfs/260 filters out the root/default quota line, because ext4
> consumes a different amount of space than xfs, and it's not what
> we're testing for, so just ignore it.
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 
> diff --git a/common/quota b/common/quota
> index d91062a..2ec56a5 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -78,6 +78,19 @@ _require_xfs_quota()
>  }
>  
>  #
> +# checks that xfs_quota can operate on foreign (non-xfs) filesystems
> +# Skips check on xfs filesystems, old xfs_quota is fine there.
> +# Appends "-f" to enable foreign behavior on non-xfs filesystems if available.
> +#
> +_require_xfs_quota_foreign()
> +{
> +    if [ "$FSTYP" != "xfs" ]; then
> +	$XFS_QUOTA_PROG -f -V &>/dev/null || \
> +		_notrun "xfs_quota binary does not support foreign filesystems"
> +	XFS_QUOTA_PROG="$XFS_QUOTA_PROG -f"
> +    fi

Mixing space and tab in this function.

> +}

Better to have an empty line here :)

> +#
>  # checks that the XFS project quota support in the kernel is enabled.
>  #
>  _require_prjquota()

[snip]

> diff --git a/tests/xfs/118 b/tests/xfs/118
> index 8414594..da18a32 100755
> --- a/tests/xfs/118
> +++ b/tests/xfs/118
> @@ -47,11 +47,12 @@ _cleanup()
>  # real QA test starts here
>  
>  # Modify as appropriate.
> -_supported_fs xfs
> +_supported_fs generic
>  _supported_os IRIX Linux
>  
>  _require_scratch
> -_require_xfs_quota
> +_require_quota
> +_require_xfs_quota_foreign
>  
>  _chowning_file()
>  {
> @@ -72,10 +73,10 @@ _chowning_file()
>  }
>  
>  echo "mkfs on scratch"
> -_scratch_mkfs_xfs >$seqres.full
> +_scratch_mkfs >$seqres.full

I found that stderr should be redirected to $seqres.full too, otherwise
it fails with ext2/3 as

+mke2fs 1.42.9 (28-Dec-2013)

I can fix them at commit time if there's no other review comments.

Thanks,
Eryu
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux