Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Muhammad Usama Anjum <usama.anjum@collabora.com>,
	Kees Cook <keescook@chromium.org>,
	davidgow@google.com
Cc: "open list : KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	kunit-dev@googlegroups.com,
	"kernel@collabora.com" <kernel@collabora.com>,
	Shuah Khan <shuah@kernel.org>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: Converting kselftest test modules to kunit
Date: Tue, 30 Jul 2024 16:55:00 -0600	[thread overview]
Message-ID: <f1a6d13b-a5b8-45c2-bd45-b44b5b70a25d@linuxfoundation.org> (raw)
In-Reply-To: <a3083ad4-e9dc-40da-bf57-8391bcd96a6c@collabora.com>

On 7/29/24 01:55, Muhammad Usama Anjum wrote:
> On 7/27/24 12:35 AM, Shuah Khan wrote:
>> On 7/15/24 04:09, Muhammad Usama Anjum wrote:
>>> Hi Kees and All,
>>>
>>> There are several tests in kselftest subsystem which load modules to tests
>>> the internals of the kernel. Most of these test modules are just loaded by
>>> the kselftest, their status isn't read and reported to the user logs. Hence
>>> they don't provide benefit of executing those tests.
>>>
>>> I've found patches from Kees where he has been converting such kselftests
>>> to kunit tests [1]. The probable motivation is to move tests output of
>>> kselftest subsystem which only triggers tests without correctly reporting
>>> the results. On the other hand, kunit is there to test the kernel's
>>> internal functions which can't be done by userspace.
>>>
>>> Kselftest:    Test user facing APIs from userspace
>>> Kunit:        Test kernel's internal functions from kernelspace
>>>
>>> This brings me to conclusion that kselftest which are loading modules to
>>> test kernelspace should be converted to kunit tests. I've noted several
>>> such kselftests.
>>>
>>> This is just my understanding. Please mention if I'm correct above or more
>>> reasons to support kselftest test modules transformation into kunit test.
>>>
>>> [1] https://lore.kernel.org/all/20221018082824.never.845-kees@kernel.org/
>>>
>>
>> Please make sure you aren't taking away the ability to run these tests during
>> boot.
> The kunit tests are usually run at boot time. They can be run later as
> well. So I'm not trying to remove any functionality. Rather adding a way
> where failures would actually be detected.
> 
>> It doesn't make sense to convert every single test especially when it
>> is intended to be run during boot without dependencies - not as a kunit test
>> but a regression test during boot.
> I started investigating when these lib kselftests were just loading the
> test module without checking if test actually passed/failed (which proves
> that this type of kselftests can never detect regression as it doesn't
> process the results). It was strange. Hence I found out the conversion of
> such kselftests to kunit tests done by Kees and started this thread for
> discussion before doing actual work and sending patches.
> 
>>

I explained this on two other threads. If you don't know how this test
is used why are you making this change?

>> bitmap is one example - pay attention to the config help test - bitmap
>> one clearly states it runs regression testing during boot. Any test that
>> says that isn't a candidate for conversion.
> Please can you explain what do you mean by bitmap testing during boot? As
> far as I understand, the kselftests are usespace tests and are run after
> kernel has booted completely and userspace has started. It cannot be
> regarded as testing during boot.
> 

I responded to David - let me know you would like me to repeat it.

thanks,
-- Shuah


  reply	other threads:[~2024-07-30 22:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 10:09 Converting kselftest test modules to kunit Muhammad Usama Anjum
2024-07-15 16:40 ` Kees Cook
2024-07-16  8:11   ` Muhammad Usama Anjum
2024-07-16 17:59     ` Kees Cook
2024-07-16 18:04       ` John Hubbard
2024-07-16 18:26         ` Kees Cook
2024-07-17 21:11           ` John Hubbard
2024-07-17 10:55       ` Muhammad Usama Anjum
2024-07-16  7:33 ` David Gow
2024-07-17 10:47   ` Muhammad Usama Anjum
2024-07-17 21:44     ` John Hubbard
2024-07-26 19:35 ` Shuah Khan
2024-07-29  7:55   ` Muhammad Usama Anjum
2024-07-30 22:55     ` Shuah Khan [this message]
2024-07-30  5:23   ` David Gow
2024-07-30 22:53     ` Shuah Khan

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=f1a6d13b-a5b8-45c2-bd45-b44b5b70a25d@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=davidgow@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=usama.anjum@collabora.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