linux-kselftest-5.5-rc1-kunit

This kselftest update for Linux 5.5-rc1 adds KUnit, 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.

In addition, this Kunit update adds 3 new kunit tests:

- kunit test for proc sysctl from Iurii Zaikin
- kunit test for the 'list' doubly linked list from David Gow
- ext4 kunit test for decoding extended timestamps from Iurii Zaikin

In the future KUnit will be linked to Kselftest framework to provide
a way to trigger KUnit tests from user-space.
lib/list-test: add a test for the 'list' doubly linked list

Add a KUnit test for the kernel doubly linked list implementation in
include/linux/list.h

Each test case (list_test_x) is focused on testing the behaviour of the
list function/macro 'x'. None of the tests pass invalid lists to these
macros, and so should behave identically with DEBUG_LIST enabled and
disabled.

Note that, at present, it only tests the list_ types (not the
singly-linked hlist_), and does not yet test all of the
list_for_each_entry* macros (and some related things like
list_prepare_entry).

Ignoring checkpatch.pl spurious errors related to its handling of for_each
and other list macros. checkpatch.pl expects anything with for_each in its
name to be a loop and expects that the open brace is placed on the same
line as for a for loop. In this case, test case naming scheme includes
name of the macro it is testing, which results in the spurious errors.
Commit message updated by Shuah Khan <skhan@linuxfoundation.org>

Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Tested-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
4 files changed