KUnit: Function Redirection and More
summary
KUnit now implements function redirection with two backends: static stubbing inserts a macro at a function head that at test runtime checks and calls a replacement (example: activate static stub to make add_one call subtract_one), and an ftrace-based stub that redirects without source changes but requires ftrace/livepatch support and cannot intercept inlined functions. KUnit hits about 500 tests, adds init-section testing, UML and Rust doctest support, a defer-like resource API, unit_enable to keep tests out of production runs, and an RFC v2 is available.
AI-written summary · about
chapters (8)
- 0:00Introduction to KUnit
- 1:47Recent KUnit developments
- 3:57Maintenance and Rust support
- 5:45Resource management system
- 8:59Function redirection overview
- 10:45Static stubbing implementation
- 13:13Ftrace-based stubbing
- 14:17Community feedback and Q&A
related talks
45m"KUnit: Past, Present, and Future"
45mKUnit: Past, Present, and Future
44mKUnit - Unit Testing for the Linux Kernel
16mHow do we make KUnit work for us?
30mKernel Testing with KUnit: Bridging the Gap
28mTesting Drivers with KUnit (Does hardware have to be hard?)
24mKUnit Testing Insufficiencies
24mStoring and Outputting Test Information: KUnit Attributes and KTAPv2
