Hi Geert,

Thank you for reviewing this patch.

The KUnit test cases are only executed when the CONFIG_SMB_KUNIT_TESTS is enabled.

Making it a separate test module would require exporting local variables and functions so that the test code can access them. However, exporting local variables and functions would likely make the code much uglier, as it would require adding "#if" conditionals into the production code to isolate the test code.

Geert, please let me know if you have a better idea.

I am also discussing this with the ext4 community, and we all hope to find a way to make the tests a separate module.

Thanks,
ChenXiaoSong <[email protected]>

On 2/10/26 4:10 PM, Geert Uytterhoeven wrote:
        Hi ChenXiaoSong,

Thanks for your patch, which is now commit 480afcb19b61385d
("smb/client: introduce KUnit test to check search result of
smb2_error_map_table") in linus/master

The KUnit test are executed when cifs.ko is loaded.
This means the tests are_always_ executed when cifs.ko is loaded,
which is different from how most other test modules work.
Please make it a separate test module, so it can be loaded independently
of the main cifs module.  That way people can enable all tests in
production kernels, without affecting the system unless a test module
is actually loaded.


Reply via email to