fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eryu Guan <guan@eryu.me>
To: Pavel Reichl <preichl@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH v3 1/4] common/rc: Add _require_{chown,chmod}()
Date: Sun, 18 Apr 2021 20:50:06 +0800	[thread overview]
Message-ID: <YHwq/hmeTmGktR/G@desktop> (raw)
In-Reply-To: <20210415094905.61853-2-preichl@redhat.com>

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@redhat.com>
> ---
>  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!

  reply	other threads:[~2021-04-18 12:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15  9:49 [PATCH v3 0/4] Fix some tests that fail for exfat FS Pavel Reichl
2021-04-15  9:49 ` [PATCH v3 1/4] common/rc: Add _require_{chown,chmod}() Pavel Reichl
2021-04-18 12:50   ` Eryu Guan [this message]
2021-04-19 22:06     ` Pavel Reichl
2021-04-15  9:49 ` [PATCH v3 2/4] common: hide permision warning from mkswap for exfat Pavel Reichl
2021-04-15  9:49 ` [PATCH v3 3/4] generic/554: hide permision warning on exfat Pavel Reichl
2021-04-15  9:49 ` [PATCH v3 4/4] generic/003: Amend the test for exfat Pavel Reichl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHwq/hmeTmGktR/G@desktop \
    --to=guan@eryu.me \
    --cc=fstests@vger.kernel.org \
    --cc=preichl@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).