From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] mount08.c: SKIP test if selinux is running
Date: Mon, 28 Jul 2025 12:31:41 +0200 [thread overview]
Message-ID: <20250728103141.GA756176@pevik> (raw)
In-Reply-To: <aIdLGf5Kx5NuAH98@yuki.lan>
Hi,
> The commit is missing why this has to be done. Please be more verbose
> and explain the reasons in the commit message.
+1, I was going to write the same (remember: often more useful commit message is
not *what* you change, but *why* your did the change).
Also, test under SELinux returns EACCES instead of ENOENT:
mount08.c:32: TFAIL: mount(/proc/130541/fd/4) expected ENOENT: EACCES (13)
Why not keep the test just update errno for SELinux?
In setup:
static int exp_errno = ENOENT;
if (tst_selinux_enforcing())
exp_errno = EACCES;
> > Signed-off-by: Wei Gao <wegao@suse.com>
> > ---
> > testcases/kernel/syscalls/mount/mount08.c | 3 +++
> > 1 file changed, 3 insertions(+)
> > diff --git a/testcases/kernel/syscalls/mount/mount08.c b/testcases/kernel/syscalls/mount/mount08.c
> > index e2824ac55..1f97de182 100644
> > --- a/testcases/kernel/syscalls/mount/mount08.c
> > +++ b/testcases/kernel/syscalls/mount/mount08.c
> > @@ -41,6 +41,9 @@ static void run(void)
> > static void setup(void)
> > {
> > + if (tst_selinux_enforcing())
> > + tst_brk(TCONF, "SKIP test since selinux is running");
Please don't use upper case. Also SELinux is not "running" but enabled
in enforce mode. If test should be really skip I would use:
tst_brk(TCONF, "skip test due SELinux enforce");
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-07-28 10:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-28 21:27 [LTP] [PATCH v1] mount08.c: SKIP test if selinux is running Wei Gao via ltp
2025-07-28 10:04 ` Cyril Hrubis
2025-07-28 10:31 ` Petr Vorel [this message]
2025-07-31 14:33 ` [LTP] [PATCH v2] mount08.c: Check EACCES error when test under selinux enabled in enforce mode Wei Gao via ltp
2025-07-31 4:39 ` Petr Vorel
2025-07-31 6:44 ` Andrea Cervesato via ltp
2025-07-31 10:54 ` Petr Vorel
2025-08-01 0:28 ` [LTP] [PATCH v3] " Wei Gao via ltp
2025-07-31 17:09 ` Andrea Cervesato via ltp
2025-07-31 17:13 ` Andrea Cervesato via ltp
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=20250728103141.GA756176@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.