public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: Ricardo Branco <rbranco@suse.com>,
	Martin Doucha <martin.doucha@suse.com>,
	ltp@lists.linux.it, Terry Tritton <terry.tritton@linaro.org>
Subject: Re: [LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs
Date: Fri, 30 Jan 2026 01:27:19 +0100	[thread overview]
Message-ID: <20260130002719.GB120546@pevik> (raw)
In-Reply-To: <aXt3cKet0G4d0oF0@yuki.lan>

Hi all,

[ Cc Martin ]

> Hi!
> > > > Because that was my question - really always prefer kconfig even there is a
> > > > simple runtime solution? I'd like to have some "rule" like conclusion we can
> > > > point during review.

> > > I think that from a long term view this is going to be simpler solution
> > > than having many different types of checks. The less diverse these
> > > checks are the easier they are to review and maintain. Hence I lean
> > > towards kernel config checks even though they are slower (mostly
> > > unmeasurable on today's harware) than the alternatives.

> > I think I lean opposite way, and rather have a check for right
> > environment to support the test.
> > You can have feature X enabled in kernel config, but still disabled
> > later at boot/runtime
> > (e.g. max_user_namespaces=0), or a module simply not being loaded.

> That is a good catch.

> Maybe the best way forward would be to add hooks for certain config
> options into the LTP kernel config parser that would do additional
> runtime checks. That way we would have both the information on which
> kernel configs should be enabled in test metadata as well as runtime
> checks.

I like the idea: having metadata doc + runtime check is nice.

FYI (I know you all watch GitHub PR but just in case) to document that for some
tests require more things to check, e.g. kconfig + min_kver:
https://github.com/linux-test-project/ltp/pull/1285

Kind regards,
Petr

> What about eventually adding something as:

> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> index 9bcd57721..f6abe6cc7 100644
> --- a/lib/tst_kconfig.c
> +++ b/lib/tst_kconfig.c
> @@ -110,6 +110,18 @@ static void close_kconfig(FILE *fp)
>                 fclose(fp);
>  }

> +static void runtime_check(struct tst_kconfig_var *var)
> +{
> +       if (strstr(var->id, "CONFIG_USER_NS")) {
> +               if (!tst_user_ns_enabled()) {
> +                       tst_res(TINFO, "CONFIG_USER_NS present but runtime is disabled");
> +                       var->val = 'n';
> +               }
> +       } else if (...)
> +               ...
> +       }
> +}
> +
>  static inline int kconfig_parse_line(const char *line,
>                                       struct tst_kconfig_var *vars,
>                                       unsigned int vars_len)
> @@ -183,9 +195,11 @@ out:
>                         switch (val[0]) {
>                         case 'y':
>                                 vars[i].choice = 'y';
> +                               runtime_check(&vars[i]);
>                                 return 1;
>                         case 'm':
>                                 vars[i].choice = 'm';
> +                               runtime_check(&vars[i]);
>                                 return 1;
>                         }
>                 }

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

  reply	other threads:[~2026-01-30  0:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 21:16 [LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs Terry Tritton
2025-12-12 10:20 ` Andrea Cervesato via ltp
2025-12-15 15:53 ` Petr Vorel
2025-12-15 15:59   ` Andrea Cervesato via ltp
2025-12-15 16:13     ` Petr Vorel
2025-12-15 16:23       ` Andrea Cervesato via ltp
2025-12-15 16:52         ` Petr Vorel
2025-12-18  8:18           ` Andrea Cervesato via ltp
2026-01-05 13:50             ` Terry Tritton
2026-01-05 14:11               ` Petr Vorel
2026-01-07 16:00               ` Cyril Hrubis
2026-01-07 16:06                 ` Petr Vorel
2026-01-07 16:16                   ` Cyril Hrubis
2026-01-07 16:18                     ` Petr Vorel
2026-01-08  7:26                     ` Jan Stancek via ltp
2026-01-08 13:31                       ` Petr Vorel
2026-01-28  7:24                         ` Petr Vorel
2026-01-29 15:08                           ` Cyril Hrubis
2026-01-29 23:58                             ` Petr Vorel
2026-01-29 15:06                       ` Cyril Hrubis
2026-01-30  0:27                         ` Petr Vorel [this message]
2026-01-30  0:41                           ` Li Wang 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=20260130002719.GB120546@pevik \
    --to=pvorel@suse.cz \
    --cc=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    --cc=martin.doucha@suse.com \
    --cc=rbranco@suse.com \
    --cc=terry.tritton@linaro.org \
    /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