Re: [PATCH v2] kunit: Taint kernel if any tests run

From: Luis Chamberlain
Date: Wed May 04 2022 - 14:46:12 EST


On Wed, May 04, 2022 at 11:25:14AM -0500, Daniel Latypov wrote:
> On Wed, May 4, 2022 at 9:51 AM Luis Chamberlain <mcgrof@xxxxxxxxxx> wrote:
> > selftests has modules, although I am not sure if there are selftests
> > which do not load modules. Shuah?
>
> I'm not Shuah, but there are indeed selftests that don't load modules.
>
> I went looking for an example and found
> tools/testing/selftests/bpf/test_doc_build.sh, which runs entirely in
> userspace (basically just `make docs`).

OK so, we can just skip tainting considerations for selftests which
don't use modules for now. There may be selftests which do wonky
things in userspace but indeed I agree the userspace taint would
be better for those but I don't think it may be worth bother
worrying about those at this point in time.

But my point in that sharing a taint between kunit / selftests modules
does make sense and is easily possible. The unfortunate aspect is just
that selftests don't have a centralized runner, because I can just
run tools/testing/selftests/sysctl/sysctl.sh for example and that's it.
So I think we have no other option but to just add the module info
manually for selftests at this time.

Luis