Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: bharathsm@microsoft.com, chenxiaosong@kylinos.cn,
	dhowells@redhat.com, linkinjeon@kernel.org,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <davidgow@google.com>, Rae Moar <raemoar63@gmail.com>,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-cifs@vger.kernel.org, pc@manguebit.org,
	ronniesahlberg@gmail.com, senozhatsky@chromium.org,
	smfrench@gmail.com, sprasad@microsoft.com, tom@talpey.com
Subject: Re: [PATCH v9 1/1] smb/client: introduce KUnit test to check search result of smb2_error_map_table
Date: Tue, 10 Feb 2026 19:03:37 +0800	[thread overview]
Message-ID: <3f24a647-6133-4d45-b71e-6ede06bab02e@linux.dev> (raw)
In-Reply-To: <CAMuHMdXBBCzWK8HPQ8zQYJ1_Pxim3_ku4_2-CnWXm3M4ysnQ+w@mail.gmail.com>

Thanks for your suggestions, these are really helpful. I will make the 
changes as soon as possible.

Thanks,
ChenXiaoSong <chenxiaosong@kylinos.cn>

On 2/10/26 6:38 PM, Geert Uytterhoeven wrote:
> Hi ChenXiaoSong,
> 
> On Tue, 10 Feb 2026 at 10:53, ChenXiaoSong
> <chenxiaosong.chenxiaosong@linux.dev> wrote:
>> The KUnit test cases are only executed when the CONFIG_SMB_KUNIT_TESTS
>> is enabled.
> 
> ... which defaults to KUNIT_ALL_TESTS, so if KUNIT_ALL_TESTS is enabled,
> the test is enabled by default, too.
> 
>> 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.
> 
> There are ways to restrict exported symbols to test modules only,
> see EXPORT_SYMBOL_FOR_TESTS_ONLY(), EXPORT_SYMBOL_FOR_MODULES(),
> and EXPORT_SYMBOL_NS().
> 
> If it is really hard to convert the tests into a separate module,
> you can add a new kernel/module parameter, which needs to be specified
> explicitly to run the test. That would avoid running the tests when just
> (auto)loading cifs.ko.
> 
>> On 2/10/26 4:10 PM, Geert Uytterhoeven wrote:
>>> 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.
> 
> Gr{oetje,eeting}s,
> 
>                          Geert
> 


      reply	other threads:[~2026-02-10 11:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260118091313.1988168-1-chenxiaosong.chenxiaosong@linux.dev>
2026-02-10  8:10 ` [PATCH v9 1/1] smb/client: introduce KUnit test to check search result of smb2_error_map_table Geert Uytterhoeven
2026-02-10  9:53   ` ChenXiaoSong
2026-02-10 10:38     ` Geert Uytterhoeven
2026-02-10 11:03       ` ChenXiaoSong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f24a647-6133-4d45-b71e-6ede06bab02e@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=bharathsm@microsoft.com \
    --cc=brendan.higgins@linux.dev \
    --cc=chenxiaosong@kylinos.cn \
    --cc=davidgow@google.com \
    --cc=dhowells@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=raemoar63@gmail.com \
    --cc=ronniesahlberg@gmail.com \
    --cc=senozhatsky@chromium.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox