[LTP] Split some fanotify tests

Amir Goldstein amir73il@gmail.com
Fri Jan 24 11:21:55 CET 2025


On Fri, Jan 24, 2025 at 11:02 AM Petr Vorel <pvorel@suse.cz> wrote:
>
> Hi Amir,
>
> FYI we were thinking with Martin about splitting some of the fanotify tests.
> Why?
>
> Some of the fanotify tests are hard to review (e.g. fanotify{10,13,14}.c,),
> because the have a lot of results.

I assume you are referring to test cases that are declared as regression
tests for a fix commit.
Do you intend to split every such test case into its own test?

I agree that the FAN_DELETE_SELF test case is a good candidate
for splitting, if not for anything else, because the ugliness of requiring this
test case to be the last test case.

>
> Also other problem is that some enterprise kernels does not backport minor fixes
> and the usual approach is to whitelist the issue based on exit code. But this
> cannot be done on the test which has many results. We could workaround it with
> tst_kvercmp2(), but that's kind of a last result.

As a general rule, not testing a know bug because it is not backported
sounds bad to me, although I do agree that there could be exceptions, like:

        if (tc->ignored_flags & FAN_EVENT_ON_CHILD && tst_kvercmp(5,
9, 0) < 0) {
                tst_res(TCONF, "ignored mask in combination with flag
FAN_EVENT_ON_CHILD"
                                " has undefined behavior on kernel < 5.9");

If the test runner whitelists a test it's up to them.
It would be nice if LTP could add the ability to whitelist a test case/variant
or even a specific filesystem for a specific all_filesystems test, but
it's up to
you guys to decide if it is worth it.

The reason I tend to add test cases is to save code duplication between tests,
because there is a lot of boilerplate code for event verification, which often
has bugs and needs fixing in multiple tests.
There is another solution for code duplication - to write generic fanotify event
verification helpers.

It's up to you to decide if there is room for some helpers for fanotify event
verification or if you want to fork the tests with code duplication.
WDYT?

Thanks,
Amir.


More information about the ltp mailing list