~/talk

How to write your first kernel selftest

Talkat linux.conf.au 2021 · 2021-01-23..01-25· [linux-and-operating-systems]
links:none on file
slides:none on file

Kernel selftests are small userspace programs (mostly C, some shell) placed under tools/testing/selftests that exercise the running kernel; they build locally with make install and run through the generated harness run_kselftest which emits TAP output for CI. Examples show meaningful checks in a few dozen lines (getpid+readlink or the 5.8 proc multiple-mount regression). Tests can crash a machine so use a VM, and they simplify merging and backporting fixes alongside code.

AI-written summary · about

  1. 0:00Introduction
  2. 1:12What are kernel selftests
  3. 3:03Where are they kept
  4. 4:09Why kernel selftests
  5. 4:58Benefits
  6. 6:40Build
  7. 8:10Run
  8. 9:32Run all tests
  9. 10:43Simple selftest
  10. 12:37Another small test
  11. 15:37What needs testing
  12. 17:37Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.