lib/hashtable_test.c: add test for the hashtable structure

Add a KUnit test for the kernel hashtable implementation in
include/linux/hashtable.h.

Note that this version does not yet test each of the rcu
alternative versions of functions.

Signed-off-by: Rae Moar <rmoar@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Rae Moar
2023-01-25 22:54:49 +00:00
committed by Shuah Khan
parent 9ecc9cdd16
commit 789538c61f
3 changed files with 331 additions and 0 deletions

View File

@@ -2497,6 +2497,19 @@ config LIST_KUNIT_TEST
If unsure, say N.
config HASHTABLE_KUNIT_TEST
tristate "KUnit Test for Kernel Hashtable structures" if !KUNIT_ALL_TESTS
depends on KUNIT
default KUNIT_ALL_TESTS
help
This builds the hashtable KUnit test suite.
It tests the basic functionality of the API defined in
include/linux/hashtable.h. For more information on KUnit and
unit tests in general please refer to the KUnit documentation
in Documentation/dev-tools/kunit/.
If unsure, say N.
config LINEAR_RANGES_TEST
tristate "KUnit test for linear_ranges"
depends on KUNIT