(mgorny IIRC brought this up on IRC a little while ago.) There's a few forms of tests for the kernel upstream: 1) kselftests (https://docs.kernel.org/dev-tools/kselftest.html) 2) linux test project (LTP, https://linux-test-project.readthedocs.io/en/latest/) The latter is AFAIK more flaky and more time-consuming but I might be wrong. Right now, kernel-install.eclass has a src_test which checks the just-built kernel is bootable. This is good, but we should consider optionally(?) doing more, like kselftests. kselftests AFAIK are small tests which should clearly indicate if something is broken while being more representative of real use vs. just booting a trivial userspace binary. The downside is, I think we'd need to ship or acquire a far bigger image to boot into?
kselftests are run in the kernel source tree (https://docs.kernel.org/dev-tools/kselftest.html#running-the-selftests-hotplug-tests-are-run-in-limited-mode). But note that this is *once the new kernel is booted* ("Tests are intended to be run after building, installing and booting a kernel.").
See also bug 402581 for the idea of running them on the live system (kselftests would be ok here AFAIK, but not the linux test project). But this is separate from the idea of doing it in dist-kernel's src_test.
Related to this: Currently the to-be-installed kernel is tested with a non-systemd initramfs because including the systemd module causes the initramfs to refuse to switch root (likely because our fake root is missing some things that systemd thinks should be there). If we make a bigger testing root image anyway, then maybe we can fix this issue at the same time.
(In reply to Sam James from comment #1) > kselftests are run in the kernel source tree > (https://docs.kernel.org/dev-tools/kselftest.html#running-the-selftests- > hotplug-tests-are-run-in-limited-mode). > > But note that this is *once the new kernel is booted* ("Tests are intended > to be run after building, installing and booting a kernel."). Apparently they support building out-of-tree -- so I think we don't need most of the kernel build tree.