public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Cc: Betty Zhou <bettyzhou@google.com>, Edward Liaw <edliaw@google.com>
Subject: [LTP] [RFC] 'nobody' user for testing
Date: Wed, 17 Sep 2025 12:27:37 +0200	[thread overview]
Message-ID: <20250917102737.GA336745@pevik> (raw)

Hi,

I found a setup bug on LTP IMA tests ima_conditionals.sh and
ima_measurements.sh which use 'sudo' (with user 'nobody'). We have many C tests
in LTP which use 'nobody' user somehow, but they don't actually execute
anything with this account. IMHO these are the only tests which execute with 'sudo'
(please double check me).

$ git grep -l nobody testcases/kernel/syscalls/ | wc -l
160

Because on newer systems (I checked Tumblewed, Fedora, Debian) 'nobody' account use
/usr/sbin/nologin which prevents logging, we 1) either need to change account
to use bash (and restore it back after testing) or 2) create a dedicated user
for testing. I'd try to use 'useradd' and check with grep /etc/passwd if the
user is not already defined.

I tend to use 2), add it only to IMA tests (to ima_setup.sh). But I could
put some more generic code to tst_test.sh so that it can be reused by other
tests in the future. WDYT?

Also, as we heavily use 'nobody' already I'm not sure if it's worth to bother
with putting environment variable allowing a different user. Nobody so far complained,
even AOSP folks seem to be used C tests which use 'nobody' (e.g. fchmod06.c is
compiled [1] and not disabled [2]).

Also, we agreed with Cyril, that it'd be good to convert these 2 IMA tests to
use 'su' instead of 'sudo' because 'su' is simpler than 'sudo' (although when
testing with rapido [3] none of them works out of the box).

[1] https://android.googlesource.com/platform/external/ltp/+/refs/heads/main/android/Android.bp
[2] https://android.googlesource.com/platform/external/ltp/+/refs/heads/main/android/tools/disabled_tests.txt
[3] https://github.com/rapido-linux/rapido

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

             reply	other threads:[~2025-09-17 10:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 10:27 Petr Vorel [this message]
2025-09-22  8:48 ` [LTP] [RFC] 'nobody' user for testing Jan Stancek via ltp
2025-09-26 12:25   ` Petr Vorel
2025-10-06  9:48   ` Petr Vorel
2025-09-26 13:24 ` Andrea Cervesato via ltp
2025-09-29  8:31   ` Petr Vorel
2025-10-16 12:32     ` Cyril Hrubis
2025-10-16 13:09       ` Petr Vorel
2025-10-16 13:35         ` Cyril Hrubis
2025-10-16 14:07           ` Petr Vorel

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=20250917102737.GA336745@pevik \
    --to=pvorel@suse.cz \
    --cc=bettyzhou@google.com \
    --cc=edliaw@google.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox