KUnit Slated To Land With The Linux 5.5 Kernel For Expanding Kernel Unit Testing

Written by Michael Larabel in Linux Kernel on 24 November 2019 at 08:12 AM EST. Add A Comment
LINUX KERNEL
As part of the KSelfTest updates sent in early for the Linux 5.5 merge window opening tonight/tomorrow, Google's KUnit is included in this pull request as the basic kernel unit testing framework.

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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week