Re: [PATCH v2 2/2] unicode: kunit: change tests filename and path

2024-10-02 Thread David Gow
s "yes", but we may want to update kunit.py at some point to support automatically adding tests/ to the search path for a .kunitconfig if this becomes a common enough pattern. Regardless, let's take this as-is. Reviewed-by: David Gow Cheers, -- David > fs/unicode/Makefil

Re: [PATCH v2 1/2] unicode: kunit: refactor selftest to kunit tests

2024-10-02 Thread David Gow
ts, even if fstests has some unicode tests itself and the code is pretty battle-hardened, as these are a good, quick way to sanity-check any changes during development, and to catch regressions early. Reviewed-by: David Gow Cheers, -- David > fs/unicode/.kunitconfig|

Re: [PATCH v2] lib: math: Move kunit tests into tests/ subdir

2024-10-02 Thread David Gow
s.kernel.org/dev-tools/kunit/style.html [2] > > Signed-off-by: Luis Felipe Hernandez > --- > Changes in v2: Fix cc recipient list inclusion in cover letter > --- Thanks very much for taking care of this. It looks great to me. Reviewed-by: David Gow Cheers, -- David > arch/m

Re: [PATCH v5] lib/math: Add int_pow test suite

2024-09-10 Thread David Gow
case > - Add test case with non-power of two exponent > - Fix module license > --- Looks good to me, thanks! Reviewed-by: David Gow Cheers, -- David smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH v3] lib/math: Add int_pow test suite

2024-09-06 Thread David Gow
ble value to in large_result test case > - Add test case with non-power of two exponent > - Fix module license > --- This looks pretty good to me, thanks! A few very minor nitpicks below, but nothing serious. With those fixed, this is: Reviewed-by: David Gow Cheers, -- David > lib

Re: [PATCH] kunit: Fix kernel-doc for EXPORT_SYMBOL_IF_KUNIT

2024-09-04 Thread David Gow
this header and fix the tool, there will be: > > ../include/kunit/visibility.h:61: warning: Function parameter or > struct member 'symbol' not described in 'EXPORT_SYMBOL_IF_KUNIT' > > Signed-off-by: Michal Wajdeczko > --- > Cc: Rae Moar > Cc: David Gow

Re: [PATCH 3/3] kunit: Improve format of the KUNIT_EXPECT_EQ assertion

2024-08-21 Thread David Gow
[ ] Expected 0 == kstrtobool("dunno", &flag), but > [ ] kstrtobool("dunno", &flag) == -22 (-EINVAL) > > Signed-off-by: Michal Wajdeczko > --- > Cc: David Gow > Cc: Rae Moar > --- I wasn't sure about this at first, but looking at it, I thin

Re: [PATCH 2/3] kunit: Improve format of the PTR_EQ|NE|NULL assertion

2024-08-21 Thread David Gow
(void *)0), but > [ ] ptr1 is -ENOMEM > [ ] ((void *)0) is NULL > > Signed-off-by: Michal Wajdeczko > --- > Cc: David Gow > Cc: Rae Moar > --- I have some mixed feelings about this one. Personally, I'd rather this continue to use '==' rather than '

Re: [PATCH 1/3] kunit: Improve format of the NOT_ERR_OR_NULL assertion

2024-08-21 Thread David Gow
get: > > [ ] Expected myptr is not error, but is: -12 > > but we can improve it by using more friendly error pointer format: > > [ ] Expected myptr is not error, but is -ENOMEM > > Signed-off-by: Michal Wajdeczko > --- > Cc: David Gow > Cc: Rae Moar > ---

Re: [PATCH 4/4] kunit: Add example with alternate function redirection method

2024-08-21 Thread David Gow
res. > > Signed-off-by: Michal Wajdeczko > --- > Cc: David Gow > Cc: Daniel Latypov > Cc: Lucas De Marchi > --- This looks good to me, thanks! Reviewed-by: David Gow Thanks, -- David > lib/kunit/kunit-example-test.c | 63 ++ >

Re: [PATCH 3/4] kunit: Allow function redirection outside of the KUnit thread

2024-08-21 Thread David Gow
r threads, outside of the KUnit test, like from the workqueue. > > Add another set of macros to allow redirection to the replacement > functions, which, unlike the KUNIT_STATIC_STUB_REDIRECT, will > affect all calls done during the test execution. > > Signed-off-by: Michal Wajdeczko

Re: [PATCH 2/4] kunit: Add macro to conditionally expose declarations to tests

2024-08-21 Thread David Gow
o > --- > Cc: Rae Moar > Cc: David Gow > Cc: Lucas De Marchi > --- I like this, thanks! Reviewed-by: David Gow > include/kunit/visibility.h | 8 > 1 file changed, 8 insertions(+) > > diff --git a/include/kunit/visibility.h b/include/kunit/visibility.h >

Re: [PATCH 1/4] kunit: Introduce kunit_is_running()

2024-08-21 Thread David Gow
ned-off-by: Michal Wajdeczko > --- > Cc: Daniel Latypov > Cc: David Gow > Cc: Lucas De Marchi > --- This is a big improvement, thanks! Reviewed-by: David Gow Cheers, -- David > include/kunit/test-bug.h | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) &g

Re: [PATCH] lib/math: Add int_pow test suite

2024-08-15 Thread David Gow
On Thu, 15 Aug 2024 at 10:07, Luis Felipe Hernandez wrote: > > Adds test suite for integer based power function. > > Signed-off-by: Luis Felipe Hernandez > --- Hi Luis, Thanks for your patch. Personally, I'm all in favour of adding it, but there are a few issues which would need to be resolved

[PATCH v2] kunit: Device wrappers should also manage driver name

2024-08-15 Thread David Gow
axime Ripard Reviewed-by: Rae Moar Signed-off-by: David Gow --- This is a combination of the previous version of this patch with the follow-up fix "kunit: Fix kunit_kstrdup_const() with modules". kunit_kstrdup_const() now falls back to kstrdup() if KUnit is built as a module, and i

Re: [PATCH] kunit: Device wrappers should also manage driver name

2024-08-05 Thread David Gow
On Tue, 6 Aug 2024 at 08:23, Nico Pache wrote: > > On Wed, Jul 31, 2024 at 1:02 AM David Gow wrote: > > > > kunit_driver_create() accepts a name for the driver, but does not copy > > it, so if that name is either on the stack, or otherwise freed, we end > > up

[PATCH] kunit: Fix kunit_kstrdup_const() with modules

2024-08-05 Thread David Gow
appers should also manage driver name") Signed-off-by: David Gow --- include/kunit/test.h | 16 +++- lib/kunit/test.c | 19 +++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/include/kunit/test.h b/include/kunit/test.h index da9e84de14c0..5ac

Re: [PATCH v2] kunit: add test duration attribute

2024-08-03 Thread David Gow
ucture KUnit tests in-memory and handle debugfs, alongside the other feature requests we've had for parameterised tests. (Like having explicit context associated with them, or supporting more arbitrary nesting.) Regardless, this is Reviewed-by: David Gow Cheers, -- David > Chang

[PATCH] kunit: Device wrappers should also manage driver name

2024-07-31 Thread David Gow
le. Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") Reported-by: Nico Pache Closes: https://groups.google.com/g/kunit-dev/c/81V9b9QYON0 Signed-off-by: David Gow Reviewed-by: Kees Cook --- There's some more serious changes since the RFC I sent, so please take a closer look.

Re: [PATCH 0/3] bitmap: Convert test_bitmap to kunit test

2024-07-30 Thread David Gow
On Tue, 30 Jul 2024 at 23:49, Shuah Khan wrote: > > On 7/29/24 02:29, Muhammad Usama Anjum wrote: > > On 7/27/24 12:26 AM, Shuah Khan wrote: > >> On 7/26/24 05:06, Muhammad Usama Anjum wrote: > >>> In this series, test_bitmap is being converted to kunit test. Multiple > >>> patches will make the r

Re: [PATCH 0/3] bitmap: Convert test_bitmap to kunit test

2024-07-30 Thread David Gow
On Tue, 30 Jul 2024 at 23:39, Shuah Khan wrote: > > On 7/29/24 02:15, Muhammad Usama Anjum wrote: > > On 7/27/24 11:10 PM, Yury Norov wrote: > >> On Fri, Jul 26, 2024 at 01:26:48PM -0600, Shuah Khan wrote: > >>> On 7/26/24 05:06, Muhammad Usama Anjum wrote: > In this series, test_bitmap is be

Re: [PATCH 2/3] bitmap: Rename module

2024-07-30 Thread David Gow
On Mon, 29 Jul 2024 at 22:09, Randy Dunlap wrote: > > > > On 7/29/24 1:07 AM, Muhammad Usama Anjum wrote: > > On 7/27/24 10:35 PM, Yury Norov wrote: > >> On Fri, Jul 26, 2024 at 04:06:57PM +0500, Muhammad Usama Anjum wrote: > >>> Rename module to bitmap_kunit and rename the configuration option >

Re: Converting kselftest test modules to kunit

2024-07-29 Thread David Gow
On Sat, 27 Jul 2024 at 03:35, 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

Re: [PATCH v3] Documentation: KUnit: Update filename best practices

2024-07-26 Thread David Gow
hat's fine by me. Reviewed-by: David Gow Thanks, -- David smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH] lib: Move KUnit tests into tests/ subdirectory

2024-07-23 Thread David Gow
PCI DEVICES > @@ -12347,7 +12347,7 @@ F: Documentation/trace/kprobes.rst > F: include/asm-generic/kprobes.h > F: include/linux/kprobes.h > F: kernel/kprobes.c > -F: lib/test_kprobes.c > +F: lib/tests/test_kprobes.c > F: samples/kprobes > &

Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-23 Thread David Gow
[1] > Signed-off-by: Kees Cook > --- > Cc: David Gow > Cc: Brendan Higgins > Cc: Rae Moar > Cc: John Hubbard > Cc: Jonathan Corbet > Cc: Linus Torvalds > Cc: linux-kselftest@vger.kernel.org > Cc: kunit-...@googlegroups.com > Cc: linux-...@vger.kernel.org

Re: [PATCH v2] Documentation: KUnit: Update filename best practices

2024-07-23 Thread David Gow
On Mon, 22 Jul 2024 at 17:56, Marco Elver wrote: > > On Sat, Jul 20, 2024 at 09:54AM -0700, Kees Cook wrote: > > Based on feedback from Linus[1] and follow-up discussions, change the > > suggested file naming for KUnit tests. > > > > Link: > > https://lore.kernel.org/lkml/CAHk-=wgim6pNiGTBMhP8Kd3

[PATCH RESEND] x86: checksum: Fix unaligned checksums on < i686

2024-07-19 Thread David Gow
nputs ok 3 test_csum_no_carry_inputs I also tested it on a real 486DX2, with the same results. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: David Gow --- Re-sending this from [1]. While there's an argument that the whole 32-bit checksum code could do with rewrit

Re: KUnit file naming conventions (was Re: [GIT PULL] execve updates for v6.11-rc1)

2024-07-17 Thread David Gow
On Thu, 18 Jul 2024 at 00:49, Kees Cook wrote: > > On Wed, Jul 17, 2024 at 02:28:15PM +0800, David Gow wrote: > > On Wed, 17 Jul 2024 at 11:53, Kees Cook wrote: > > > > > > On Tue, Jul 16, 2024 at 01:10:41PM -0700, Linus Torvalds wrote: > > > > On M

Re: [PATCH] Documentation: KUnit: Update filename best practices

2024-07-17 Thread David Gow
y: Kees Cook > --- > Cc: David Gow > Cc: Brendan Higgins > Cc: Rae Moar > Cc: Jonathan Corbet > Cc: Linus Torvalds > Cc: linux-kselftest@vger.kernel.org > Cc: kunit-...@googlegroups.com > Cc: linux-...@vger.kernel.org > --- Looks good to me. Maybe we could make it cl

Re: [PATCH] Documentation: KUnit: Update filename best practices

2024-07-17 Thread David Gow
; > > Link: > > > https://lore.kernel.org/lkml/CAHk-=wgim6pNiGTBMhP8Kd3tsB7_JTAuvNJ=XYd3wPvvk=o...@mail.gmail.com/ > > > [1] > > > Signed-off-by: Kees Cook > > > --- > > > Cc: David Gow > > > Cc: Brendan Higgins > > > Cc: Ra

Re: KUnit file naming conventions (was Re: [GIT PULL] execve updates for v6.11-rc1)

2024-07-16 Thread David Gow
On Wed, 17 Jul 2024 at 11:53, Kees Cook wrote: > > On Tue, Jul 16, 2024 at 01:10:41PM -0700, Linus Torvalds wrote: > > On Mon, 15 Jul 2024 at 09:21, Kees Cook wrote: > > > > > > fs/exec.c | 49 -- > > > fs/exec_test.c | 141

Re: Converting kselftest test modules to kunit

2024-07-16 Thread David Gow
On Mon, 15 Jul 2024 at 18: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 us

Re: [PATCH v2 3/3] kunit: Introduce KUNIT_ASSERT_MEMEQ and KUNIT_ASSERT_MEMNEQ macros

2024-07-11 Thread David Gow
macros ensures that assertions > can also be used for memory comparisons, enhancing the consistency and > completeness of the kunit framework. > > Signed-off-by: Eric Chan > --- Reviewed-by: David Gow Cheers, -- David > include/kunit/test.h | 54 +

Re: [PATCH v2 2/3] kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_FAIL_AND_ABORT for readability

2024-07-11 Thread David Gow
igned-off-by: Eric Chan > --- I like this much better, thanks. Reviewed-by: David Gow Cheers, -- David > drivers/input/tests/input_test.c | 2 +- > include/kunit/assert.h | 2 +- > include/kunit/test.h | 13 - > 3 files changed, 14 insert

Re: [PATCH v2 1/3] kunit: Fix the comment of KUNIT_ASSERT_STRNEQ as assertion

2024-07-11 Thread David Gow
On Fri, 12 Jul 2024 at 03:39, Eric Chan wrote: > > The current comment for KUNIT_ASSERT_STRNEQ incorrectly describes it as > an expectation. Since KUNIT_ASSERT_STRNEQ is an assertion, updates the > comment to correctly refer to it as such. > > Signed-off-by: Eric Chan > --

Re: [PATCH] kunit: executor: Simplify string allocation handling

2024-07-10 Thread David Gow
; > Link: https://github.com/KSPP/linux/issues/90 [1] > Signed-off-by: Kees Cook > --- > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: linux-kselftest@vger.kernel.org > Cc: kunit-...@googlegroups.com > --- Looks good apart from the strscpy() change, which i

Re: [PATCH 3/3] kunit: Introduce KUNIT_ASSERT_MEMEQ and KUNIT_ASSERT_MEMNEQ macros

2024-07-10 Thread David Gow
macros ensures that assertions > can also be used for memory comparisons, enhancing the consistency and > completeness of the kunit framework. > > Signed-off-by: Eric Chan > --- Nice catch, thanks! Reviewed-by: David Gow Cheers, -- David

Re: [PATCH 2/3] kunit: Rename KUNIT_ASSERT_FAILURE to KUNIT_ASSERT for readability

2024-07-10 Thread David Gow
On Thu, 11 Jul 2024 at 01:06, Eric Chan wrote: > > Both KUNIT_FAIL and KUNIT_ASSERT_FAILURE defined to KUNIT_FAIL_ASSERTION > with different tpye of kunit_assert_type. The current naming of > KUNIT_ASSERT_FAILURE and KUNIT_FAIL_ASSERTION is confusing due to their > similarities. To improve readabi

Re: [PATCH 1/3] kunit: Fix the comment of KUNIT_ASSERT_STRNEQ as assertion

2024-07-10 Thread David Gow
- Nice catch -- copy-and-paste strikes again! Reviewed-by: David Gow Cheers, -- David > include/kunit/test.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/kunit/test.h b/include/kunit/test.h > index 61637ef32302..87a232421089 100644 > ---

Re: [PATCH v6 5/8] platform: Add test managed platform_device/driver APIs

2024-07-06 Thread David Gow
s automatically be unregistered when the test is done. > > This makes test setup code simpler when a platform driver or platform > device is needed. Add a few test cases at the same time to make sure the > APIs work as intended. > > Cc: Brendan Higgins > Reviewed-by: David Gow

Re: [PATCH] kunit/usercopy: Add missing MODULE_DESCRIPTION()

2024-07-01 Thread David Gow
Johnson > Signed-off-by: Kees Cook > --- > At Jeff's reminder, I've split this out of: > https://lore.kernel.org/all/20240601-md-lib-test-v1-1-a728620e3...@quicinc.com/ > since the file got renamed. > --- > Cc: Shuah Khan > Cc: Jeff Johnson > Cc: Brendan Hig

Re: [PATCH v2] kunit/usercopy: Disable testing on !CONFIG_MMU

2024-07-01 Thread David Gow
Signed-off-by: Kees Cook > --- > Resending as v2 with Shuah in To: > --- > Cc: Shuah Khan > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: "Gustavo A. R. Silva" > Cc: Andrew Morton > Cc: linux-kselftest@vger.kernel.org > Cc: kunit-...

Re: [PATCH v5 11/11] clk: Add KUnit tests for clks registered with struct clk_parent_data

2024-06-13 Thread David Gow
On Tue, 4 Jun 2024 at 06:38, Stephen Boyd wrote: > > Test that clks registered with 'struct clk_parent_data' work as > intended and can find their parents. > > Cc: Christian Marangi > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Signed-off-by: St

Re: [PATCH v5 06/11] platform: Add test managed platform_device/driver APIs

2024-06-13 Thread David Gow
s automatically be unregistered when the test is done. > > This makes test setup code simpler when a platform driver or platform > device is needed. Add a few test cases at the same time to make sure the > APIs work as intended. > > Cc: Brendan Higgins > Cc: David Gow >

Re: [PATCH v5 05/11] of: Add a KUnit test for overlays and test managed APIs

2024-06-13 Thread David Gow
h fake platform devices and device nodes via overlays compiled into > the kernel image. > > Cc: Rob Herring > Cc: Saravana Kannan > Cc: Daniel Latypov > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Reviewed-by: Rob Herring (Arm) > Signed-off-by: Stephen Bo

Re: [PATCH v5 02/11] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-06-13 Thread David Gow
is more clear, too. So, no actual problems. (Assuming you don't want to put the documentation under the devicetree rather than under KUnit -- it can go either way.) Reviewed-by: David Gow Thanks, -- David > Documentation/dev-tools/kunit/api/index.rst | 11 ++ > Document

Re: [PATCH v3 0/2] usercopy: Convert test_user_copy to KUnit test

2024-06-12 Thread David Gow
On Thu, 13 Jun 2024 at 03:59, Kees Cook wrote: > > Hi, > > This builds on the proposal[1] from Mark and lets me convert the > existing usercopy selftest to KUnit. Besides adding this basic test to > the KUnit collection, it also opens the door for execve testing (which > depends on having a functi

Re: [PATCH v2 2/2] usercopy: Convert test_user_copy to KUnit test

2024-06-12 Thread David Gow
er. One other (set of) notes below about using KUNIT_EXPECT_MEMEQ_MSG(), otherwise (assuming the m68k stuff isn't actually a regression, which I haven't tested but I imagine is unlikely), Reviewed-by: David Gow Thanks, -- David > MAINTAINERS| 1 + > lib/

Re: [PATCH v2 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-06-12 Thread David Gow
ood to me, at least on the KUnit side of things. Reviewed-by: David Gow Cheers, -- David > include/kunit/test.h | 17 +++ > lib/kunit/Makefile | 1 + > lib/kunit/user_alloc.c | 111 + > 3 files changed, 129 insertions(+) > crea

Re: [PATCH 5/5] kunit: Merge assertion test into kunit-test.c

2024-06-08 Thread David Gow
On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote: > > Since assert_test covers the part of the KUnit core (the assertion > formatting functions), I believe it would be better to have it merged > into kunit-test (as it is done for other tests for the KUnit core). > > Signed-off-by: Ivan Orlov > ---

Re: [PATCH 4/5] kunit: assert: export non-static functions

2024-06-08 Thread David Gow
On Tue, 4 Jun 2024 at 20:32, Ivan Orlov wrote: > > Export non-static functions from the assert.c file into the KUnit > namespace in order to be able to access them from the tests if > they are compiled as modules. > > Signed-off-by: Ivan Orlov > --- I think this could be merged with patch 5, as

Re: [PATCH 3/5] kunit: string-stream-test: Make it a separate module

2024-06-08 Thread David Gow
rsonally can't think if what else to sensibly add. Reviewed-by: David Gow Cheers, -- David > lib/kunit/Kconfig | 8 > lib/kunit/Makefile | 2 +- > lib/kunit/string-stream-test.c | 2 ++ > 3 files changed, 11 insertions(+), 1 deletion(-) >

Re: [PATCH 2/5] kunit: kunit-test: Remove stub for log tests

2024-06-08 Thread David Gow
mport the KUnit namespace in the test. > > Signed-off-by: Ivan Orlov > --- Nice to see these finally work for modules! Reviewed-by: David Gow Cheers, -- David > lib/kunit/kunit-test.c | 18 +- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff

Re: [PATCH 1/5] kunit: string-stream: export non-static functions

2024-06-08 Thread David Gow
ks good to me, thanks. It's very slightly hilarious to use EXPORT_SYMBOL_IF_KUNIT() here, because _of course_ KUnit is enabled, but I think it's the right idea nevertheless. Reviewed-by: David Gow Cheers, -- David > lib/kunit/string-stream.c | 12 +++- > 1 file

Re: [PATCH 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-06-08 Thread David Gow
small questions below, but nothing essential. There are a couple of test failures/hangs for the usercopy test (on i386 and m68k), which may have origins here: I've mentioned them there. Reviewed-by: David Gow Cheers, -- David > include/kunit/test.h | 17 ++ > lib/kunit/test.c

Re: [PATCH 2/2] usercopy: Convert test_user_copy to KUnit test

2024-06-08 Thread David Gow
ore detailed progress is nice). With those architecture-specific hangs either fixed, or documented (if they're actual problems, not issues with the test), this is: Reviewed-by: David Gow Cheers, -- David > MAINTAINERS| 1 + > lib/Kconfig.d

Re: [PATCH] kunit: add missing MODULE_DESCRIPTION() macros to core modules

2024-06-07 Thread David Gow
RNING: modpost: missing MODULE_DESCRIPTION() in > lib/kunit/kunit-example-test.o > > Add the missing invocations of the MODULE_DESCRIPTION() macro. > > Signed-off-by: Jeff Johnson > --- Reviewed-by: David Gow Cheers, -- David smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH] list: test: add the missing MODULE_DESCRIPTION() macro

2024-06-07 Thread David Gow
on > --- Nice catch, thanks. Reviewed-by: David Gow Cheers, -- David smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH] list: test: remove unused struct 'klist_test_struct'

2024-05-31 Thread David Gow
id Alan Gilbert > --- Nice catch, thanks! That's what I get for copy-patste, I guess! :-) (I agree that this is better without the Fixes tag, too.) Reviewed-by: David Gow Cheers, -- David > lib/list-test.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/lib/li

Re: [PATCH v5] kunit: Cover 'assert.c' with tests

2024-05-29 Thread David Gow
RNING: Using vsprintf specifier '%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '%p'. #427: FILE: lib/kunit/assert_test.c:251: + snprintf(addr_var_b, TEST_PTR_EXPECTED_BUF_SIZE, "%px", var_b); T

Re: First Contributions for KUnit

2024-05-22 Thread David Gow
On Mon, 20 May 2024 at 23:09, Artur A C de Barros wrote: > > Hi all, > > We are students from the State University of Campinas with an interest in > contributing to the kernel. We are part of LKCAMP, a student group that > focuses on researching and contributing to open source software. Our grou

Re: [PATCH] Documentation: kunit: Clarify test filter format

2024-05-14 Thread David Gow
or the delay. Reviewed-by: David Gow Cheers, -- David smime.p7s Description: S/MIME Cryptographic Signature

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-04 Thread David Gow
On Fri, 3 May 2024 at 09:04, Stephen Boyd wrote: > > Quoting David Gow (2024-05-01 00:55:46) > > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > > diff --git a/Documentation/dev-tools/kunit/api/platformdevice.rst > > > b/Documentation/dev-tools/kunit/api/pla

Re: [PATCH v4 01/10] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-05-04 Thread David Gow
On Fri, 3 May 2024 at 08:36, Stephen Boyd wrote: > > Quoting David Gow (2024-05-01 00:55:10) > > On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > > diff --git a/Documentation/dev-tools/kunit/api/index.rst > > > b/Documentation/dev-tools/kunit/api/inde

Re: [PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test

2024-05-01 Thread David Gow
On Tue, 30 Apr 2024 at 21:58, Scott Mayhew wrote: > > On Sat, 23 Mar 2024, David Gow wrote: > > > On Thu, 21 Mar 2024 at 22:32, Scott Mayhew wrote: > > > > > > Commit c72a870926c2 added a mutex to prevent kunit tests from running > > > concurrently. U

Re: [PATCH v4 00/10] clk: Add kunit tests for fixed rate and parent data

2024-05-01 Thread David Gow
On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > This patch series adds unit tests for the clk fixed rate basic type and > the clk registration functions that use struct clk_parent_data. To get > there, we add support for loading device tree overlays onto the live DTB > along with probing pla

Re: [PATCH v4 05/10] platform: Add test managed platform_device/driver APIs

2024-05-01 Thread David Gow
drivers/devices automatically be unregistered when the test is done. > > This makes test setup code simpler when a platform driver or platform > device is needed. Add a few test cases at the same time to make sure the > APIs work as intended. > > Cc: Brendan Higgins > Cc: David Gow >

Re: [PATCH v4 03/10] dt-bindings: test: Add KUnit empty node binding

2024-05-01 Thread David Gow
On Tue, 23 Apr 2024 at 07:24, Stephen Boyd wrote: > > Describe a binding for an empty device node used by KUnit tests to > confirm overlays load properly. > > Reviewed-by: Rob Herring > Cc: Krzysztof Kozlowski > Cc: Conor Dooley > Cc: Brendan Higgins > Cc: David Go

Re: [PATCH v4 02/10] dt-bindings: vendor-prefixes: Add "test" vendor for KUnit and friends

2024-05-01 Thread David Gow
viewed-by: Rob Herring > Cc: Krzysztof Kozlowski > Cc: Conor Dooley > Signed-off-by: Stephen Boyd > --- Reviewed-by: David Gow Cheers, -- David > Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documen

Re: [PATCH v4 01/10] of: Add test managed wrappers for of_overlay_apply()/of_node_put()

2024-05-01 Thread David Gow
n > Signed-off-by: Stephen Boyd > --- This looks good to me. I'm not an expert on Device Tree Overlays, so can't guarantee it's perfect and/or the most ergonomic solution for any given use-case, but I definitely like the look of it from a KUnit point of view. A few minor nam

Re: [PATCH] kunit: string-stream-test: use KUNIT_DEFINE_ACTION_WRAPPER

2024-04-23 Thread David Gow
On Wed, 24 Apr 2024 at 02:27, Ivan Orlov wrote: > > Use KUNIT_DEFINE_ACTION_WRAPPER macro to define the 'kfree' and > 'string_stream_destroy' wrappers for kunit_add_action. > > Signed-off-by: Ivan Orlov > --- Acked-by: David Gow Thanks, -- David smime

[PATCH] kunit: test: Move fault tests behind KUNIT_FAULT_TEST Kconfig option

2024-04-23 Thread David Gow
rg/all/928249cc-e027-4f7f-b43f-502f99a1e...@roeck-us.net/ Fixes: 82b0beff3497 ("kunit: Add tests for fault") Signed-off-by: David Gow --- lib/kunit/Kconfig | 11 +++ lib/kunit/kunit-test.c | 8 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/ku

Re: [PATCH v4 2/2] kunit: avoid memory leak on device register error

2024-04-23 Thread David Gow
On Fri, 19 Apr 2024 at 22:11, Wander Lairson Costa wrote: > > On Fri, Apr 19, 2024 at 11:03 AM Greg Kroah-Hartman > wrote: > > > > On Fri, Apr 19, 2024 at 10:25:02AM -0300, Wander Lairson Costa wrote: > > > If the device register fails, free the allocated memory before > > > returning. > > > > >

Re: [PATCH v3 2/2] kunit: avoid memory leak on device register error

2024-04-18 Thread David Gow
On Fri, 19 Apr 2024 at 05:02, Wander Lairson Costa wrote: > > If the device register fails, free the allocated memory before > returning. > > Signed-off-by: Wander Lairson Costa > Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") > --- Thanks. I'm not sure this is correct, though...

Re: [PATCH v3 1/2] kunit: unregister the device on error

2024-04-18 Thread David Gow
> Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") > --- Nice catch! Reviewed-by: David Gow Cheers, -- David > lib/kunit/device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/kunit/device.c b/lib/kunit/device.c > index

[PATCH] kunit: Fix race condition in try-catch completion

2024-04-11 Thread David Gow
ctional Testing Acked-by: Mickaël Salaün Signed-off-by: David Gow --- lib/kunit/try-catch.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/kunit/try-catch.c b/lib/kunit/try-catch.c index fa687278ccc9..6bbe0025b079 100644 --- a/lib/kunit/try-catch.c +++ b/lib/ku

Re: [PATCH v3 04/15] kunit: Add documentation for warning backtrace suppression API

2024-04-09 Thread David Gow
hat might overcomplicate it a bit. It also might be nice to document the individual macros with kerneldoc comments. (Though, that could equally fit in patch #1). Still, this is the most important bit, so I'm happy to have it as-is. Reviewed-by: David Gow Cheers, -- David > v2: > -

Re: [PATCH v3 03/15] kunit: Add test cases for backtrace warning suppression

2024-04-09 Thread David Gow
On Wed, 3 Apr 2024 at 21:19, Guenter Roeck wrote: > > Add unit tests to verify that warning backtrace suppression works. > > If backtrace suppression does _not_ work, the unit tests will likely > trigger unsuppressed backtraces, which should actually help to get > the affected architectures / plat

Re: [PATCH v3 02/15] kunit: bug: Count suppressed warning backtraces

2024-04-09 Thread David Gow
gt; architectures due to include file recursion, so use a plain integer > for now. > > Acked-by: Dan Carpenter > Reviewed-by: Kees Cook > Tested-by: Linux Kernel Functional Testing > Signed-off-by: Guenter Roeck > --- Looks good to me, thanks. Reviewed-by: David Gow Ch

Re: [PATCH v3 01/15] bug/kunit: Core support for suppressing warning backtraces

2024-04-09 Thread David Gow
On Wed, 3 Apr 2024 at 21:19, Guenter Roeck wrote: > > Some unit tests intentionally trigger warning backtraces by passing > bad parameters to API functions. Such unit tests typically check the > return value from those calls, not the existence of the warning backtrace. > > Such intentionally gener

Re: kunit alltests runs broken in mainline

2024-03-26 Thread David Gow
On Tue, 26 Mar 2024 at 15:55, Johannes Berg wrote: > > On Tue, 2024-03-26 at 01:52 +, Jakub Kicinski wrote: > > > > I'm late to the party, but FWIW I had to toss this into netdev testing > > tree as a local patch: > > > > CONFIG_NETDEVICES=y > > CONFIG_WLAN=y > > I'll send this in the next wir

[PATCH] kunit: configs: Enable CONFIG_DAMON_DBGFS_DEPRECATED for --alltests

2024-03-26 Thread David Gow
This is required, as CONFIG_DAMON_DEBUGFS is enabled, and --alltests UML builds will fail due to the missing config option otherwise. Fixes: f4cba4bf6777 ("mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED") Signed-off-by: David Gow --- This is breaking all UML alltests

Re: [PATCH] kunit: bail out early in __kunit_test_suites_init() if there are no suites to test

2024-03-22 Thread David Gow
run tests after boot using > debugfs") > Reported-by: Nico Pache > Signed-off-by: Scott Mayhew > --- Thanks, this works well here, and is a good idea anyway. Reviewed-by: David Gow Cheers, -- David > lib/kunit/test.c | 3 +++ > 1 file changed, 3 insertions(+) > > di

Re: [PATCH] Documentation: kunit: correct KUNIT_VERY_SLOW to KUNIT_SPEED_VERY_SLOW

2024-03-21 Thread David Gow
On Wed, 20 Mar 2024 at 16:18, Kemeng Shi wrote: > > There is no KUNIT_VERY_SLOW, I guess we mean KUNIT_SPEED_VERY_SLOW. > > Signed-off-by: Kemeng Shi > --- Nice catch, thanks! Reviewed-by: David Gow Cheers, -- David > Documentation/dev-tools/kunit/running_tips.rst

Re: lock warnings in dev_addr_lists test

2024-02-29 Thread David Gow
On Thu, 29 Feb 2024 at 03:45, Guenter Roeck wrote: > > Hi, > > when running the dev_addr_lists unit test with lock debugging enabled, > I always get the following lockdep warning. > > [7.031327] > [7.031393] WARNING: kunit_try_catch/1886 still has locks

Re: [PATCH v10] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests

2024-02-29 Thread David Gow
On Wed, 28 Feb 2024 at 23:40, Guenter Roeck wrote: > > On 2/28/24 02:15, Geert Uytterhoeven wrote: > > CC testing > > > > On Wed, Feb 28, 2024 at 8:59 AM Guenter Roeck wrote: > >> On 2/27/24 23:25, Christophe Leroy wrote: > >> [ ... ] > > This test case is supposed to be as true to the

[PATCH v2] drm: tests: Fix invalid printf format specifiers in KUnit tests

2024-02-27 Thread David Gow
_mm selftest to KUnit") Reviewed-by: Matthew Auld Acked-by: Christian König Tested-by: Guenter Roeck Reviewed-by: Justin Stitt Signed-off-by: David Gow --- Changes since v1: https://lore.kernel.org/linux-kselftest/20240221092728.1281499-8-david...@google.com/ - Split this patch out, as

Re: [PATCH] kunit: Setup DMA masks on the kunit device

2024-02-26 Thread David Gow
m/ttm/tests/ While I suspect there's probably a discussion to have around what things KUnit devices should set up (and how much flexibility users should have there), I think this is definitely a fix worth having in the meantime. Reviewed-by: David Gow Cheers, -- David > lib/kunit/device.c

Re: [PATCH 2/9] lib/cmdline: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
On Thu, 22 Feb 2024 at 04:10, 'Justin Stitt' via KUnit Development wrote: > > Hi, > > On Wed, Feb 21, 2024 at 05:27:15PM +0800, David Gow wrote: > > The correct format specifier for p - n (both p and n are pointers) is > > %td, as the type should be ptrdi

[PATCH 9/9] kunit: Annotate _MSG assertion variants with gnu printf specifiers

2024-02-21 Thread David Gow
d not have the __printf attribute, so gcc couldn't warn on incorrect agruments. It turns out there were quite a few tests with such incorrect arguments. Add the __printf() specifier now that we've fixed these errors, to prevent them from recurring. Suggested-by: Linus Torvalds Signed-of

[PATCH 8/9] drm/xe/tests: Fix printf format specifiers in xe_migrate test

2024-02-21 Thread David Gow
an error pointer, just use '%pe', instead of extracting the error code manually with PTR_ERR(). (This also results in a nicer output when the error code is known.) Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: David Gow --- driver

[PATCH 7/9] drm: tests: Fix invalid printf format specifiers in KUnit tests

2024-02-21 Thread David Gow
hese some more detailed error messages, which should be more useful anyway. Fixes: a64056bb5a32 ("drm/tests/drm_buddy: add alloc_contiguous test") Fixes: fca7526b7d89 ("drm/tests/drm_buddy: fix build failure on 32-bit targets") Fixes: fc8d29e298cf ("drm: selftest: convert

[PATCH 6/9] net: test: Fix printf format specifier in skb_segment kunit test

2024-02-21 Thread David Gow
rather than a number if available, which should make the output more readable, too). Fixes: b3098d32ed6e ("net: add skb_segment kunit test") Signed-off-by: David Gow --- net/core/gso_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/gso_test.c

[PATCH 5/9] rtc: test: Fix invalid format specifier.

2024-02-21 Thread David Gow
'days' is a s64 (from div_s64), and so should use a %lld specifier. This was found by extending KUnit's assertion macros to use gcc's __printf attribute. Fixes: 1d1bb12a8b18 ("rtc: Improve performance of rtc_time64_to_tm(). Add tests.") Signed-off-by: David Gow -

[PATCH 4/9] time: test: Fix incorrect format specifier

2024-02-21 Thread David Gow
'days' is a s64 (from div_s64), and so should use a %lld specifier. This was found by extending KUnit's assertion macros to use gcc's __printf attribute. Fixes: 276010551664 ("time: Improve performance of time64_to_tm()") Signed-off-by: David Gow --- kernel/t

[PATCH 3/9] lib: memcpy_kunit: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
The 'i' passed as an assertion message is a size_t, so should use '%zu', not '%d'. This was found by annotating the _MSG() variants of KUnit's assertions to let gcc validate the format strings. Fixes: bb95ebbe89a7 ("lib: Introduce CONFIG_MEMCPY_KUNIT_T

[PATCH 2/9] lib/cmdline: Fix an invalid format specifier in an assertion msg

2024-02-21 Thread David Gow
f the architecture being built). Fixes: 0ea09083116d ("lib/cmdline: Allow get_options() to take 0 to validate the input") Signed-off-by: David Gow --- lib/cmdline_kunit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmdline_kunit.c b/lib/cmdline_kunit.c ind

[PATCH 1/9] kunit: test: Log the correct filter string in executor_test

2024-02-21 Thread David Gow
filtering attributes") Signed-off-by: David Gow --- lib/kunit/executor_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/kunit/executor_test.c b/lib/kunit/executor_test.c index 22d4ee86dbed..3f7f967e3688 100644 --- a/lib/kunit/executor_test.c +++ b/lib/kunit/executor_t

[PATCH 0/9] kunit: Fix printf format specifier issues in KUnit assertions

2024-02-21 Thread David Gow
o get these (or equivalent) in for 6.9 if possible, so please do take a look if possible. Thanks, -- David Reported-by: Linus Torvalds Closes: https://lore.kernel.org/linux-kselftest/CAHk-=wgjmoqudo5f8shh1f4rzzwzapnvcw643m5-yj+bfsf...@mail.gmail.com/ David Gow (9): kunit: test: Log the correct f

  1   2   >