[LTP] [PATCH v5 7/7] lib: Add 2 basic tests for .min_kver && .max_kver

Petr Vorel pvorel@suse.cz
Tue Aug 11 10:49:43 CEST 2026


Hi Andrea,

> Hi Petr,

...
> > +static struct tst_test test = {
> > +	.min_kver = "4.4",
> > +	.max_kver = "7.2",
> > +	.test_all = do_test,
> > +};

> this test is a bit weird, it's system dependent and it will TPASS or
> TCONF according to the kernel version. Is there a way to test this
> in a different way? I know it's hacky, but maybe we can use
> __attribute__((constructor)) and fetch uname() info before running
> the maximum kernel version check.

Although this is an interesting idea, I'm not sure if I find time for it. Feel
free to further improve it. For me is in the end trying to fix fanotify20 :).

The point of the test is to at least run something (kind of minimal testing but
better than nothing, because it's naive to expect anybody who touches library
tests it carefully with the real tests).

Anyway, in CI it will be always the same due using container (TPASS on Ubuntu's
6.17.0-1020-azure).

Kind regards,
Petr


More information about the ltp mailing list