[LTP] [PATCH] ioctl_pidfd02-06: Add CONFIG_USER_NS and CONFIG_PID_NS to needs_kconfigs
Cyril Hrubis
chrubis@suse.cz
Wed Jan 7 17:00:09 CET 2026
Hi!
> > > Sure, .needs_kconfigs is used when test request some functionality based on
> > > kconfig. But many tests use /proc or /sys based detection (e.g. ioctl_ns06.c)
> > > or based on certain errno, see include/lapi/syscalls.h or
> > > testcases/kernel/syscalls/fanotify/fanotify.h) because these were
> > > added before LTP supported kconfig. Later, when kconfig was added it was
> > > considering as a last resort (when there was no way to detect dependency
> > > otherwise).
> > >
> > > Have we decide to move everything into kconfig?
> > >
> > > I'm not sure myself. needs_kconfigs is simpler and obvious, but it requires
> > > kernel config. I suppose the speed of parsing config is not an issue.
> > >
> > > It'd be nice to mention the resolution (preferred vs. only if no other way to
> > > detect the support) into
> > > https://linux-test-project.readthedocs.io/en/latest/developers/writing_tests.html
> >
> > Feel free to add this comment, but for me it's obvious that if a
> > feature can't be present in the kernel due to kconfigs we should check
> > kconfig :-)
>
> I've just taken another look at this and it appears the test would still
> fail if the config is not present or if KCONFIG_SKIP_CHECK is set, in
> which case perhaps the run time detection may be preferred as it will
> still work in these cases?
The KCONFIG_SKIP_CHECK is a flag aimed at developers, it shouldn't be
enabled in production testing.
As for the missing config there is 95 testcases that have needs_kconfigs
set at this moment and the number is growing steadily. I would argue
that you cannot run LTP without having config available. And the config
location is autodetected on common distributions as well.
> Would it be better to have the run time detection in tst_kconfig_check
> as a fall back in case the config is not present?
> Then the tests can just define the needs_kconfigs and not have to worry
> about other checks.
I would avoid any complexity that isn't strictly necessary, the less we
do, the less breakage we have to deal with later. In that sense adding
the needs_kconfigs and expect the config to be there is probably the
most straightforward solution.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list