Re: [PATCH v3 1/4] common/rc: Add _require_{chown,chmod}()

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



On Thu, Apr 15, 2021 at 11:49:02AM +0200, Pavel Reichl wrote:
> Add helper functions that ensure that test is only executed on file
> systems that implement chown, chmod and symbolic links.
> 
> Fixed test are: generic/{87,88,125,126,128,193,314,317,355,597,598}
> 
> Signed-off-by: Pavel Reichl <preichl@xxxxxxxxxx>
> ---
>  common/rc         | 23 +++++++++++++++++++++++
>  tests/generic/087 |  1 +
>  tests/generic/088 |  1 +
>  tests/generic/125 |  1 +
>  tests/generic/126 |  1 +
>  tests/generic/128 |  1 +
>  tests/generic/193 |  1 +
>  tests/generic/314 |  1 +
>  tests/generic/317 |  1 +
>  tests/generic/355 |  1 +
>  tests/generic/597 |  1 +
>  tests/generic/598 |  1 +
>  12 files changed, 34 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 23f86ce6..be292aaf 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2115,6 +2115,29 @@ _require_user()
>      [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
>  }
>  
> +# check for a chown support
> +#
> +_require_chown()
> +{
> +	rnd_uid=4242
> +
> +	_require_test
> +
> +	local file="$TEST_DIR/chown_testfile"
> +	touch $file
> +	chown ${rnd_uid}:${rnd_uid} $file >/dev/null 2>&1 \
> +		|| _notrun "chown is not supported ${FSTYP}"
> +	rm -f $file
> +}
> +
> +
> +# check for a chmod support
> +#
> +_require_chmod()
> +{
> +	_require_chown

It's not clear to me why _require_chown also works for _require_chmod,
other than actually doing chmod test. Some comments would be good.

Thanks,
Eryu

P.S. I've applied other patches in this patchset, thanks for the fixes!



[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