From: Richard Weinberger <richard@nod.at>
To: Zorro Lang <zlang@redhat.com>
Cc: Dave Chinner <david@fromorbit.com>, fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH] generic/193: Ensure user in expected group
Date: Tue, 16 Jan 2024 21:00:37 +0100 (CET) [thread overview]
Message-ID: <1532659619.242214.1705435237434.JavaMail.zimbra@nod.at> (raw)
In-Reply-To: <20240116171055.on2qz2zi3bijdgyi@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com>
----- Ursprüngliche Mail -----
> Von: "Zorro Lang" <zlang@redhat.com>
> An: "richard" <richard@nod.at>
> CC: "Dave Chinner" <david@fromorbit.com>, "fstests" <fstests@vger.kernel.org>
> Gesendet: Dienstag, 16. Januar 2024 18:10:55
> Betreff: Re: [PATCH] generic/193: Ensure user in expected group
> On Tue, Jan 16, 2024 at 10:19:36AM +0100, Richard Weinberger wrote:
>> Dave,
>>
>> ----- Ursprüngliche Mail -----
>> > Von: "Dave Chinner" <david@fromorbit.com>
>> > Just do this check in _require_user(). The user needs to be set up
>> > correctly for all tests - if the user and group is not set up
>> > correctly, don't run any of the tests that require that user.
>> >
>> > This means we don't have to play whack-a-mole with "user has no
>> > group" every time someone assumes that a user is created with a
>> > group by default.
>
> I think Dave is right. Due to not only the g/193, lots of cases base
> on "fsgqa* user is in fsgqa* group". If you hope to check that by
> the single function _require_user_in_group(), it might need to call
> it in most of cases which use _require_user.
>
> But yes, as you said, it's weird to do it in _require_user, that makes
> the _require_group calling is a bit redundant.
>
> If I have to choose one way, I think we can keep the _require_user_in_group
> as an independent function, but call it in _require_user, e.g.
>
> _require_user()
> {
> qa_user=fsgqa
> if [ -n "$1" ];then
> qa_user=$1
> fi
> _require_user_exists $qa_user
> + # fstests needs each test user is in its own group name, it only need
> + # a user exist, please use _require_user_exists directly.
> + _require_user_in_group $qa_user $qa_user
> echo /bin/true | su $qa_user
> [ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
> }
>
> What do both of you think?
Fine by me. :-)
Thanks,
//richard
prev parent reply other threads:[~2024-01-16 20:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 21:24 [PATCH] generic/193: Ensure user in expected group Richard Weinberger
2024-01-15 23:38 ` Dave Chinner
2024-01-16 9:19 ` Richard Weinberger
2024-01-16 17:10 ` Zorro Lang
2024-01-16 20:00 ` Richard Weinberger [this message]
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=1532659619.242214.1705435237434.JavaMail.zimbra@nod.at \
--to=richard@nod.at \
--cc=david@fromorbit.com \
--cc=fstests@vger.kernel.org \
--cc=zlang@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