"How to write your first kernel selftest"
summary
Short primer that explains what kernel selftests are, how to build and run them, and how to add one upstream. Describes tests as small userspace C or shell programs (some use modules), explains build with make install, running and filtering with run_kselftest which emits TAP, and the tiny Makefile pattern plus lib.mk. Notes kernel has 300+ syscalls with many untested cases, shows real 20-line examples that caught behavior changes, and points to get_maintainer.pl and the kselftest mailing list for submission and help.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:12What are kernel selftests
- 3:03Where are they kept
- 4:09Why kernel selftests
- 4:58Benefits
- 6:40Build
- 8:10Run
- 9:32Run all tests
- 10:43Simple selftest
- 12:37Another small test
- 15:37What needs testing
- 17:37Summary
related talks
20mHow to write your first kernel selftest
30mKernel Testing with KUnit: Bridging the Gap
23mExperiences and lessons we learned using kselftest and pote
43mGetting to Know the Linux Kernel: A Beginner's Guide
36mLinux Kernel Developer Panel
44mKUnit - Unit Testing for the Linux Kernel
19mUpstream kernel CI using patchew and TDC
26mGetting Started With Kernel Programming: The Linux Kernel Mentorship Program
