Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 938523 - kernel-install.eclass: optionally(?) test the built kernel using kernel selftests
Summary: kernel-install.eclass: optionally(?) test the built kernel using kernel selft...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Distribution Kernel Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-26 12:14 UTC by Sam James
Modified: 2024-08-27 05:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-26 12:14:27 UTC
(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?
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-26 12:16:25 UTC
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.").
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-26 12:17:37 UTC
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.
Comment 3 Nowa Ammerlaan gentoo-dev 2024-08-26 12:23:55 UTC
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.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-08-27 05:52:37 UTC
(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.