Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it feasible to unit test kernel module code ?

If so what technique should I use ? I am thinking about using hippomock as they can be used to mock "C" methods. Are there any better approaches ? If so can anyone give an advice, or do you think unit test for kernel is an overkill ?

like image 998
Marek Waszkiewicz Avatar asked Nov 05 '15 17:11

Marek Waszkiewicz


1 Answers

Since Linux kernel version 5.5 KUnit is available. It's a lightweight unit test framework for the kernel.

For more details have a look at

  • https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html
  • https://kunit.dev/
  • https://lwn.net/Articles/780985/
like image 128
MarcusS Avatar answered Oct 15 '22 05:10

MarcusS