Speaker
Description
The kernel testing ecosystem is roughly split into kernelspace tests, commonly implemented using the KUnit framework, and an assortment of userspace tests, the most representative of which are kselftests.
Both types have different goals and are used differently: while KUnit tests are meant to be run in a known scenario on a freshly booted kernel, with little or no interactions and no communication to entities outside the kernel, kselftests are generally more loosely defined and more varied in scope and target, and their interaction with the kernel are mostly restricted to the interfaces provided by it, such as system calls.
In this talk I propose a way to fill in the gap between both test types by providing a simple framework that allows any kernel code to define and register kernelspace tests at runtime, and also publishes an interface that lets userspace query these tests, trigger them and collect their results and logs in a safe way.
This opens new possibilities for kselftests and other userspace tests and lets them perform more specialized and advanced tests by having the kernel run specific code that doesn't have a user interface and by performing pre-defined kernel operations before or after an existing test to exercise specific scenarios.