[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202407150936.C32FE24CA@keescook>
Date: Mon, 15 Jul 2024 09:40:01 -0700
From: Kees Cook <kees@...nel.org>
To: Muhammad Usama Anjum <usama.anjum@...labora.com>
Cc: Shuah Khan <shuah@...nel.org>, davidgow@...gle.com,
"open list : KERNEL SELFTEST FRAMEWORK" <linux-kselftest@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
kunit-dev@...glegroups.com,
"kernel@...labora.com" <kernel@...labora.com>
Subject: Re: Converting kselftest test modules to kunit
On Mon, Jul 15, 2024 at 03:09:24PM +0500, 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
I would say this is a reasonable guide to how these things should
be separated, yes. That said, much of what was kind of ad-hoc kernel
internals testing that was triggered via kselftests is better done via
KUnit these days, but not everything.
> 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.
I would tend to agree, yes. Which stand out to you? I've mainly been
doing the conversions when I find myself wanting to add new tests, etc.
--
Kees Cook
Powered by blists - more mailing lists