KUnit Slated To Land With The Linux 5.5 Kernel For Expanding Kernel Unit Testing
Shuah Khan summed up KUnit in the pull request as "a lightweight unit testing and mocking framework for the Linux kernel from Brendan Higgins. KUnit is not an end-to-end testing framework. It is currently supported on UML and sub-systems can write unit tests and run them in UML env. KUnit documentation is included in this update."
With this debut of KUnit there is a test for the proc sysctl, for the 'list' doubly linked list, and for decoding extended timestamps in EXT4. KUnit is still a work-in-progress and expect more tests to land in coming cycles.
KUnit was originally proposed more than one year ago and was inspired by JUnit and Googletest in developing it. KUnit was revised over the months and now appears to be in good enough shape for making its debut in Linux 5.5.
At this point there is a Python script included in the tree for running KUnit tests but better user-space work is planned moving forward. More information on KUnit can be found via the documentation.