]> git.ipfire.org Git - thirdparty/linux.git/commit
smb/client: introduce KUnit test to check search result of smb2_error_map_table
authorChenXiaoSong <chenxiaosong@kylinos.cn>
Sun, 18 Jan 2026 09:13:13 +0000 (17:13 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 9 Feb 2026 03:24:41 +0000 (21:24 -0600)
commit480afcb19b61385dfe64840d87c355293a5fa698
treebd4eee057a12ae063326612d3a64086872112c2d
parent75563adbb91d9d199b33f8b9a2fe4e9cafea6a69
smb/client: introduce KUnit test to check search result of smb2_error_map_table

The KUnit test are executed when cifs.ko is loaded.

Just like `fs/ext4/mballoc.c` includes `fs/ext4/mballoc-test.c`.
`smb2maperror.c` also includes `smb2maperror_test.c`, allowing KUnit
tests to access any functions and variables in `smb2maperror.c`.

The maperror_test_check_search() checks whether all elements can be
correctly found in the array.

Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/Kconfig
fs/smb/client/smb2maperror.c
fs/smb/client/smb2maperror_test.c [new file with mode: 0644]