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

2024-06-03 Thread Rae Moar
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 Hello! This looks good to me. Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/kunit-example-test.c

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

2024-05-20 Thread Rae Moar
for the string stream test. > > Signed-off-by: Ivan Orlov Hi! This looks great to me! Reviewed-by: Rae Moar Thanks! -Rae > --- > V1 -> V2: > - Check the output from the string stream for containing the key parts > instead of comparing the results with expected strings char by c

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

2024-05-16 Thread Rae Moar
for the string stream test. > > Signed-off-by: Ivan Orlov > --- > V1 -> V2: > - Check the output from the string stream for containing the key parts > instead of comparing the results with expected strings char by char, as > it was suggested by Rae Moar . Define two macros to &

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

2024-05-14 Thread Rae Moar
On Tue, May 14, 2024 at 10:31 AM Ivan Orlov wrote: > > On 5/14/24 01:17, Rae Moar wrote: > > On Thu, May 9, 2024 at 5:05 AM Ivan Orlov wrote: > >> > >> There are multiple assertion formatting functions in the `assert.c` > >> file, which are not covered w

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

2024-05-13 Thread Rae Moar
string stream for containing the key parts > instead of comparing the results with expected strings char by char, as > it was suggested by Rae Moar . Define two macros to > make it possible (ASSERT_TEST_EXPECT_CONTAIN and > ASSERT_TEST_EXPECT_NCONTAIN). > - Mark the static functions in `ass

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

2024-05-01 Thread Rae Moar
On Sat, Apr 27, 2024 at 6:04 PM Ivan Orlov wrote: > > There are multiple assertion formatting functions in the `assert.c` > file, which are not covered with tests yet. Implement the KUnit test > for these functions. > > The test consists of 11 test cases for the following functions: > > 1)

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

2024-04-29 Thread Rae Moar
ell, so we have to import the test source in the > `assert.c` file in order to be able to call and validate them. > > Signed-off-by: Ivan Orlov Hello, I'll give this a full review tomorrow. But with a quick glance and test, this is looking good to me. Tested-by: Rae Moar Thanks! -Rae

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

2024-04-23 Thread Rae Moar
On Tue, Apr 23, 2024 at 2:27 PM 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 Hello! This looks like a good use of the macro. Thanks! Reviewed-by: Ra

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

2024-04-23 Thread Rae Moar
ncy on !UML for our new option. > > Suggested-by: Guenter Roeck > Link: > https://lore.kernel.org/all/928249cc-e027-4f7f-b43f-502f99a1e...@roeck-us.net/ > Fixes: 82b0beff3497 ("kunit: Add tests for fault") > Signed-off-by: David Gow Hello! This looks good to me. Very

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

2024-04-12 Thread Rae Moar
previous patch series I am happy. Thanks! -Rae Reviewed-by: Rae Moar > --- > 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 > ---

[KTAP V2 PATCH v4] ktap_v2: add test metadata

2024-04-03 Thread Rae Moar
The changes to the KTAP specification outline the format, location, and different types of metadata. Reviewed-by: Kees Cook Reviewed-by: David Gow Signed-off-by: Rae Moar --- Note this version is in reponse to comments made off the list asking for more explanation on inheritance and edge cases

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

2024-03-27 Thread Rae Moar
PRECATED") > Signed-off-by: David Gow Hello! This looks good to me. And it takes away the issue with CONFIG_DAMON_DBGFS. But since this is deprecated now, should we move to the DAMON sysfs tests instead in the future? No need to let that stall this patch though. Revie

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

2024-03-21 Thread Rae Moar
run tests after boot using > debugfs") > Reported-by: Nico Pache > Signed-off-by: Scott Mayhew Hi! Sorry about this bug. Thanks for the patch! We should definitely add this check. Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/test.c | 3 +++ > 1 file changed,

[PATCH v4] kunit: tool: add ability to parse multiple files

2024-03-18 Thread Rae Moar
/test_data/ directory. Signed-off-by: Rae Moar --- Changes since v3: - Changing from input() to stdin - Add checking for non-regular files - Spacing fix - Small printing fix tools/testing/kunit/kunit.py | 54 +--- 1 file changed, 38 insertions(+), 16 deletions

Re: [PATCH v3] kunit: tool: add ability to parse multiple files

2024-03-18 Thread Rae Moar
On Fri, Mar 15, 2024 at 7:16 PM Daniel Latypov wrote: > > On Thu, Mar 7, 2024 at 2:29 PM Rae Moar wrote: > > > > Add ability to parse multiple files. Additionally add the > > ability to parse all results in the KUnit debugfs repository. > > > > How to p

[PATCH v3] kunit: tool: add ability to parse multiple files

2024-03-07 Thread Rae Moar
/test_data/ directory. Signed-off-by: Rae Moar --- Changes since v2: - Fixed bug with input from command line. I changed this to use input(). Daniel, let me know if this works for you. - Add more specific warning messages tools/testing/kunit/kunit.py | 56

[PATCH v2] kunit: tool: add ability to parse multiple files

2024-03-06 Thread Rae Moar
/test_data/ directory. Signed-off-by: Rae Moar --- Changes since v1: - Annotate type of parsed_files - Add ability to input file name from stdin again - Make for loops a bit terser - Add no output warning - Change feature to take in multiple fields rather than a directory. Currently nonrecursive

Re: [PATCH] kunit: tool: add parsing of all files in directory

2024-02-27 Thread Rae Moar
On Thu, Feb 22, 2024 at 6:37 PM Daniel Latypov wrote: > > On Thu, Feb 22, 2024 at 2:18 PM Rae Moar wrote: > > > > Add ability to parse all files within a directory. Additionally add the > > ability to parse all results in the KUnit debugfs repository. > > Nice, I'

[PATCH] kunit: tool: add parsing of all files in directory

2024-02-22 Thread Rae Moar
parse debugfs For each file, the parser outputs the file name, results, and test summary. At the end of all parsing, the parser outputs a total summary line. This feature can be easily tested on the tools/testing/kunit/test_data/ directory. Signed-off-by: Rae Moar --- tools/testing/kunit

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

2024-02-22 Thread Rae Moar
idate > the format string. > > Fixes: 76066f93f1df ("kunit: add tests for filtering attributes") > Signed-off-by: David Gow Hello! This change looks good to me. Thanks for fixing this mistake. Thanks! -Rae Reviewed-by: Rae Moar > --- > lib/kunit/executor_test.c | 2 +-

[KTAP V2 PATCH v3] ktap_v2: add test metadata

2024-02-15 Thread Rae Moar
The changes to the KTAP specification outline the format, location, and different types of metadata. Reviewed-by: David Gow Signed-off-by: Rae Moar --- Changes since v2: - Change format of metadata line from "# prefix_type: value" to "#:prefix_type: value". - Add ex

Re: [PATCH] kunit: device: Unregister the kunit_bus on shutdown

2024-02-07 Thread Rae Moar
On Wed, Feb 7, 2024 at 8:36 AM Jani Nikula wrote: > > On Fri, 02 Feb 2024, Rae Moar wrote: > > On Thu, Feb 1, 2024 at 1:06 AM David Gow wrote: > >> > >> If KUnit is built as a module, and it's unloaded, the kunit_bus is not > >> unregistered. This cause

Re: [KTAP V2 PATCH v2] ktap_v2: add test metadata

2024-02-05 Thread Rae Moar
On Sun, Feb 4, 2024 at 8:03 AM Kees Cook wrote: > > > > On January 26, 2024 11:14:26 PM GMT+01:00, Rae Moar wrote: > > KTAP version 2 > > # ktap_test: main > > # ktap_arch: uml > > 1..1 > > KTAP version 2 > > # ktap_test: suite_1 > >

Re: [KTAP V2 PATCH v2] ktap_v2: add test metadata

2024-02-05 Thread Rae Moar
On Sat, Feb 3, 2024 at 1:50 AM David Gow wrote: > > On Sat, 27 Jan 2024 at 06:15, Rae Moar wrote: > > > > Add specification for test metadata to the KTAP v2 spec. > > > > KTAP v1 only specifies the output format of very basic test information: > > test resul

Re: [KTAP V2 PATCH v2] ktap_v2: add test metadata

2024-02-05 Thread Rae Moar
On Wed, Jan 31, 2024 at 5:22 PM Bird, Tim wrote: > > > > > -Original Message----- > > From: Rae Moar > > Add specification for test metadata to the KTAP v2 spec. > > > > KTAP v1 only specifies the output format of very basic test information: > &

Re: [PATCH] kunit: device: Unregister the kunit_bus on shutdown

2024-02-02 Thread Rae Moar
03c720e03bd ("kunit: Add APIs for managing devices") > Signed-off-by: David Gow Hello, I have tested this with modules and it looks good to me! Thanks! -Rae Reviewed-by: Rae Moar > --- > > This will hopefully resolve some of the issues linked to from: > https://lore.kernel

[KTAP V2 PATCH v2] ktap_v2: add test metadata

2024-01-26 Thread Rae Moar
-off-by: Rae Moar --- Documentation/dev-tools/ktap.rst | 163 ++- 1 file changed, 159 insertions(+), 4 deletions(-) diff --git a/Documentation/dev-tools/ktap.rst b/Documentation/dev-tools/ktap.rst index ff77f4aaa6ef..4480eaf5bbc3 100644 --- a/Documentation/dev-tools

Re: [PATCH] kunit: Mark filter_glob param as rw

2024-01-18 Thread Rae Moar
the other module parameters (filter, filter_action). It did worry me to make filter_glob writable due to the recent patch that requires the output of filtering to be a valid virtual address but I think there is a sufficient amount of checking of filter_glob. Thanks! -Rae Reviewed-by: Rae Moar

Re: [PATCH] MAINTAINERS: kunit: Add Rae Moar as a reviewer

2024-01-16 Thread Rae Moar
On Thu, Jan 11, 2024 at 6:50 PM David Gow wrote: > > Rae has been shouldering a lot of the KUnit review burden for the last > year, and will continue to do so in the future. Thanks! Thanks David! Happy to review this one! Reviewed-by: Rae Moar > > Signed-of

Re: [PATCH] kunit: device: Fix a NULL vs IS_ERR() check in init()

2024-01-10 Thread Rae Moar
This change looks good to me! We could check for IS_ERR_OR_NULL instead but this change is more correct and is also how others check root_device_register(). Reviewed-by: Rae Moar Thanks! Rae > --- > lib/kunit/device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

Re: [PATCH] kunit: Fix a NULL vs IS_ERR() bug

2024-01-10 Thread Rae Moar
") > Signed-off-by: Dan Carpenter This change looks good to me! Thanks! -Rae Reviewed-by: Rae Moar > --- > It's a pity that there isn't a KUNIT_ASSERT_NOT_ERR_PTR() macro... > > lib/kunit/kunit-test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > d

Re: [PATCH v3] kunit: run test suites only after module initialization completes

2024-01-05 Thread Rae Moar
looking up the > .kunit_test_suites section of the module, then the loading phase has > failed and there's no memory to be freed. > Hello, I have tested this change and it looks good to me! Although, it no longer applies cleanly on the kselftest/kunit branch so it will need to be rebase

Re: [PATCH 2/2] kunit: Add example of kunit_activate_static_stub() with pointer-to-function

2023-12-19 Thread Rae Moar
On Mon, Dec 18, 2023 at 11:10 AM Richard Fitzgerald wrote: > > Adds a variant of example_static_stub_test() that shows use of a > pointer-to-function with kunit_activate_static_stub(). > > A const pointer to the add_one() function is declared. This > pointer-to-function is passed to

Re: [PATCH 1/2] kunit: Allow passing function pointer to kunit_activate_static_stub()

2023-12-19 Thread Rae Moar
> in the second case the RHS is already a pointer to the same type. > > Signed-off-by: Richard Fitzgerald Hello! This seems fine to me. I have tested it and the reasoning behind this seems sensible. However, let's see what David thinks when he returns to office as he is the expert on static stub

Re: [PATCH] kunit: Fix NULL-dereference in kunit_init_suite() if suite->log is NULL

2023-12-19 Thread Rae Moar
d696c4695c5 ("kunit: add ability to run tests after boot using > debugfs") Hello! This looks good! Thanks! Sorry I did not catch this earlier. Reviewed-by: Rae Moar -Rae > --- > lib/kunit/test.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff

Re: [PATCH v4 5/5] drm/tests: Switch to kunit devices

2023-12-15 Thread Rae Moar
On Fri, Dec 15, 2023 at 2:39 AM wrote: > > From: Maxime Ripard > > Kunit recently gained helpers to create test managed devices. This means > that we no longer have to roll our own helpers in KMS and we can reuse > them. Hello! This looks good to me. Thanks! Reviewed-b

[PATCH v5 6/6] Documentation: Add debugfs docs with run after boot

2023-12-13 Thread Rae Moar
Expand the documentation on the KUnit debugfs filesystem on the run_manual.rst page. Add section describing how to access results using debugfs. Add section describing how to run tests after boot using debugfs. Reviewed-by: David Gow Signed-off-by: Rae Moar --- Documentation/dev-tools/kunit

[PATCH v5 5/6] kunit: add ability to run tests after boot using debugfs

2023-12-13 Thread Rae Moar
tionality could be used to design a parameter injection feature in the future. Reviewed-by: David Gow Signed-off-by: Rae Moar --- lib/kunit/debugfs.c | 68 + lib/kunit/test.c| 10 +++ 2 files changed, 78 insertions(+) diff --git a/lib/kuni

[PATCH v5 2/6] kunit: add KUNIT_INIT_TABLE to init linker section

2023-12-13 Thread Rae Moar
Add KUNIT_INIT_TABLE to the INIT_DATA linker section. Alter the KUnit macros to create init tests: kunit_test_init_section_suites Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and KUNIT_INIT_TABLE. Reviewed-by: David Gow Signed-off-by: Rae Moar --- include/asm-generic

[PATCH v5 4/6] kunit: add is_init test attribute

2023-12-13 Thread Rae Moar
Add is_init test attribute of type bool. Add to_string, get, and filter methods to lib/kunit/attributes.c. Mark each of the tests in the init section with the is_init=true attribute. Add is_init to the attributes documentation. Reviewed-by: David Gow Signed-off-by: Rae Moar --- .../dev-tools

[PATCH v5 3/6] kunit: add example suite to test init suites

2023-12-13 Thread Rae Moar
patch. Signed-off-by: Rae Moar --- Changes since v4: - Mark test as __init and then set cases as __refdata to supress modpost warnings lib/kunit/kunit-example-test.c | 37 ++ 1 file changed, 37 insertions(+) diff --git a/lib/kunit/kunit-example-test.c b/lib/kunit

[PATCH v5 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-13 Thread Rae Moar
in the next patch for KUnit tests that test init data/functions. Reviewed-by: David Gow Signed-off-by: Rae Moar --- include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h

[PATCH v4 6/6] Documentation: Add debugfs docs with run after boot

2023-12-12 Thread Rae Moar
Expand the documentation on the KUnit debugfs filesystem on the run_manual.rst page. Add section describing how to access results using debugfs. Add section describing how to run tests after boot using debugfs. Signed-off-by: Rae Moar --- Changes since v3: - Change the introduction

[PATCH v4 5/6] kunit: add ability to run tests after boot using debugfs

2023-12-12 Thread Rae Moar
tionality could be used to design a parameter injection feature in the future. Signed-off-by: Rae Moar --- Changes since v4: - Rebased series causing a few small changes in debugfs.c in this patch lib/kunit/debugfs.c | 68 + lib/kunit/test.c| 10 +

[PATCH v4 4/6] kunit: add is_init test attribute

2023-12-12 Thread Rae Moar
Add is_init test attribute of type bool. Add to_string, get, and filter methods to lib/kunit/attributes.c. Mark each of the tests in the init section with the is_init=true attribute. Add is_init to the attributes documentation. Signed-off-by: Rae Moar --- Changes since v3: - Move the attribute

[PATCH v4 2/6] kunit: add KUNIT_INIT_TABLE to init linker section

2023-12-12 Thread Rae Moar
Add KUNIT_INIT_TABLE to the INIT_DATA linker section. Alter the KUnit macros to create init tests: kunit_test_init_section_suites Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and KUNIT_INIT_TABLE. Signed-off-by: Rae Moar --- Changes since v3: - Add to comments in test.h

[PATCH v4 3/6] kunit: add example suite to test init suites

2023-12-12 Thread Rae Moar
patch. Signed-off-by: Rae Moar --- Changes since v3: - I ended up not changing anything as adding __init to the test gave a build warning. It did still work so I could add it back if wanted. lib/kunit/kunit-example-test.c | 37 ++ 1 file changed, 37 insertions

[PATCH v4 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-12 Thread Rae Moar
in the next patch for KUnit tests that test init data/functions. Signed-off-by: Rae Moar --- Changes since v3: - No changes include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic

Re: [PATCH v3 4/6] kunit: add is_init test attribute

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:57 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Add is_init test attribute of type bool. Add to_string, get, and filter > > methods to lib/kunit/attributes.c. > > > > Mark each of the tests in th

Re: [PATCH v3 6/6] Documentation: Add debugfs docs with run after boot

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:58 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Expand the documentation on the KUnit debugfs filesystem on the > > run_manual.rst page. > > > > Add section describing how to access results using debugfs

Re: [PATCH v3 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-11 Thread Rae Moar
On Sat, Dec 9, 2023 at 2:48 AM David Gow wrote: > > On Tue, 5 Dec 2023 at 06:19, Rae Moar wrote: > > > > Alter the linker section of KUNIT_TABLE to move it out of INIT_DATA and > > into DATA_DATA. > > > > Data for KUnit tests does not need to be in the init se

Re: [PATCH] kunit: test: Use an action wrapper instead of a cast

2023-12-08 Thread Rae Moar
ff-by: David Gow Hello! This looks good to me. All ready to go. Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/kunit-test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/kunit/kunit-test.c b/lib/kunit/kunit-test.c > index 3e9c5192d095..e

[PATCH v3 2/2] kunit: tool: add test for parsing attributes

2023-12-08 Thread Rae Moar
parsed. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_tool_test.py | 16 .../kunit/test_data/test_parse_attributes.log| 9 + 2 files changed, 25 insertions(+) create mode 100644 tools/testing/kunit/test_data/test_parse_attributes.log diff --git

[PATCH v3 1/2] kunit: tool: fix parsing of test attributes

2023-12-08 Thread Rae Moar
in the suite log rather than the first test case log. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index 79d8832c862a..ce34be15c929

[PATCH v2 1/2] kunit: tool: fix parsing of test attributes

2023-12-07 Thread Rae Moar
in the suite log rather than the first test case log. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index 79d8832c862a..ce34be15c929

[PATCH v2 2/2] kunit: tool: add test for parsing attributes

2023-12-07 Thread Rae Moar
parsed. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_tool_test.py | 16 .../kunit/test_data/test_parse_attributes.log| 9 + 2 files changed, 25 insertions(+) create mode 100644 tools/testing/kunit/test_data/test_parse_attributes.log diff --git

[PATCH] kunit: tool: fix parsing of test attributes

2023-12-05 Thread Rae Moar
in the suite log rather than the first test case log. Signed-off-by: Rae Moar --- Note this patch is a resend but I removed the second patch in the series so now it is a standalone patch. tools/testing/kunit/kunit_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v3 5/6] kunit: add ability to run tests after boot using debugfs

2023-12-04 Thread Rae Moar
tionality could be used to design a parameter injection feature in the future. Signed-off-by: Rae Moar --- Changes since v2: - Move resetting the log to test.c - Add is_init attribute and patches to change linker sections to avoid re-running tests that use init data and functions l

[PATCH v3 6/6] Documentation: Add debugfs docs with run after boot

2023-12-04 Thread Rae Moar
Expand the documentation on the KUnit debugfs filesystem on the run_manual.rst page. Add section describing how to access results using debugfs. Add section describing how to run tests after boot using debugfs. Signed-off-by: Rae Moar --- Changes since v2: - Add info to documentation about

[PATCH v3 3/6] kunit: add example suite to test init suites

2023-12-04 Thread Rae Moar
patch. Signed-off-by: Rae Moar --- lib/kunit/kunit-example-test.c | 29 + 1 file changed, 29 insertions(+) diff --git a/lib/kunit/kunit-example-test.c b/lib/kunit/kunit-example-test.c index 6bb5c2ef6696..262a68a59800 100644 --- a/lib/kunit/kunit-example-test.c +++ b/lib

[PATCH v3 2/6] kunit: add KUNIT_INIT_TABLE to init linker section

2023-12-04 Thread Rae Moar
Add KUNIT_INIT_TABLE to the INIT_DATA linker section. Alter the KUnit macros to create init tests: kunit_test_init_section_suites Update lib/kunit/executor.c to run both the suites in KUNIT_TABLE and KUNIT_INIT_TABLE. Signed-off-by: Rae Moar --- include/asm-generic/vmlinux.lds.h | 9

[PATCH v3 4/6] kunit: add is_init test attribute

2023-12-04 Thread Rae Moar
Add is_init test attribute of type bool. Add to_string, get, and filter methods to lib/kunit/attributes.c. Mark each of the tests in the init section with the is_init=true attribute. Add is_init to the attributes documentation. Signed-off-by: Rae Moar --- .../dev-tools/kunit/running_tips.rst

[PATCH v3 1/6] kunit: move KUNIT_TABLE out of INIT_DATA

2023-12-04 Thread Rae Moar
in the next patch for KUnit tests that test init data/functions. Signed-off-by: Rae Moar --- include/asm-generic/vmlinux.lds.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bae0fe4d499b

Re: [PATCH v2 RESEND] kunit: debugfs: Handle errors from alloc_string_stream()

2023-11-30 Thread Rae Moar
reate_suite() error: 'test_case->log' > dereferencing possible ERR_PTR() Hello! Thanks for sending the re-sends of these patches! This patch also looks good to me! I have one comment below but I would still be happy with the patch as is. Reviewed-by: Rae Moar Thanks! -Rae > > Signe

Re: [PATCH RESEND] kunit: debugfs: Fix unchecked dereference in debugfs_print_results()

2023-11-30 Thread Rae Moar
nced before check 'suite' (see line 63) > > Signed-off-by: Richard Fitzgerald > Reported-by: Dan Carpenter > Fixes: 38289a26e1b8 ("kunit: fix debugfs code to use enum kunit_status, not > bool") Hello! This patch looks good to me! Thanks for fixing this! Reviewed-by:

Re: [PATCH RESEND] kunit: string-stream: Allow ERR_PTR to be passed to string_stream_destroy()

2023-11-30 Thread Rae Moar
gned-off-by: Richard Fitzgerald Hello! Sorry for the delay in reviewing this patch but this looks good to me! Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/string-stream.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/kunit/string-str

Re: [PATCH] kunit: string-stream-test: Avoid cast warning when testing gfp_t flags

2023-11-29 Thread Rae Moar
tzgerald > Fixes: d1a0d699bfc0 ("kunit: string-stream: Add tests for freeing > resource-managed string_stream") > Reported-by: kernel test robot > Closes: > https://lore.kernel.org/oe-kbuild-all/202311181918.0mpcu2xh-...@intel.com/ Hello! This looks good to me. Thanks fo

Re: [PATCH v2] kunit: Warn if tests are slow

2023-10-24 Thread Rae Moar
s as mentioned before. But I am happy to approach that in a future patch. And I do still have concerns with this being annoying for those on slower architectures but again that would depend on how we deal with KUnit warnings. Thanks! -Rae > --- > > To: Brendan Higgins > To: David Gow > Cc: Ja

Re: [PATCH v2 2/2] Documentation: Add debugfs docs with run after boot

2023-10-04 Thread Rae Moar
On Thu, Sep 14, 2023 at 5:06 AM David Gow wrote: > > On Sat, 9 Sept 2023 at 05:32, Rae Moar wrote: > > > > Expand the documentation on the KUnit debugfs filesystem on the > > run_manual.rst page. > > > > Add section describing how to access results using deb

Re: [PATCH v2 1/2] kunit: add ability to run tests after boot using debugfs

2023-10-04 Thread Rae Moar
On Thu, Sep 14, 2023 at 5:06 AM David Gow wrote: > > On Sat, 9 Sept 2023 at 05:31, Rae Moar wrote: > > > > Add functionality to run built-in tests after boot by writing to a > > debugfs file. > > > > Add a new debugfs file labeled "run" f

Re: [PATCH 3/4] kunit: Fix indentation of parameterized tests messages

2023-10-03 Thread Rae Moar
On Mon, Oct 2, 2023 at 9:43 AM Michal Wajdeczko wrote: > > > > On 28.09.2023 22:53, Rae Moar wrote: > > On Mon, Sep 25, 2023 at 1:58 PM Michal Wajdeczko > > wrote: > >> > >> When running parametrized test cases, diagnostic messages > >>

Re: [PATCH 2/2] kunit: Allow to filter entries from zero terminated arrays

2023-09-29 Thread Rae Moar
] [PASSED] example value 1 > [ ] === [PASSED] example_params_test === > [ ] = [PASSED] example = > [ ] > [ ] Testing complete. Ran 9 tests: passed: 6, skipped: 3 > > Signed-off-by:

Re: [PATCH 1/2] kunit: Add param generator macro for zero terminated arrays

2023-09-29 Thread Rae Moar
== > [ ] Testing complete. Ran 7 tests: passed: 4, skipped: 3 > > Signed-off-by: Michal Wajdeczko > Cc: David Gow > Cc: Rae Moar > --- > include/kunit/test.h | 22 ++ > lib/kunit/kunit-example-test.c | 2 ++ > 2 files changed, 24 in

Re: [PATCH 4/4] kunit: Prepare test plan for parameterized subtests

2023-09-28 Thread Rae Moar
: Michal Wajdeczko > Cc: David Gow > Cc: Rae Moar > --- > lib/kunit/test.c | 16 > 1 file changed, 16 insertions(+) > > diff --git a/lib/kunit/test.c b/lib/kunit/test.c > index 43c3efc286e4..55eabb324f39 100644 > --- a/lib/kunit/test.c > +++

Re: [PATCH 3/4] kunit: Fix indentation of parameterized tests messages

2023-09-28 Thread Rae Moar
SKIP unsupported param value 0 > # example_params_test: pass:2 fail:0 skip:2 total:4 > ok 1 example_params_test > # example: exiting suite > # Totals: pass:2 fail:0 skip:2 total:4 > ok 1 example > > Signed-off-by: Mi

Re: [PATCH 2/4] kunit: Fix indentation level of suite messages

2023-09-28 Thread Rae Moar
leaning up > ok 1 example_simple_test > # example: exiting suite > ok 1 example Hi! I am happy to see this change to improve the indentation of parameterized tests. It has been bugging me for a bit. This seems to be working well but I just had a few co

Re: [PATCH 1/4] kunit: Drop redundant text from suite init failure message

2023-09-28 Thread Rae Moar
# example: initializing suite > # example: failed to initialize (-ENODEV) > not ok 1 example > > Signed-off-by: Michal Wajdeczko > Cc: David Gow > Cc: Rae Moar Hello! This change looks good to me. Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/tes

Re: [PATCH] kunit: debugfs: Handle errors from alloc_string_stream()

2023-09-27 Thread Rae Moar
9 kunit_debugfs_create_suite() error: 'test_case->log' > dereferencing possible ERR_PTR() > > Signed-off-by: Richard Fitzgerald > Reported-by: Dan Carpenter > Fixes: 05e2006ce493 ("kunit: Use string_stream for test log") Hi! I've tested this and this all looks good

Re: [PATCH v2 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-21 Thread Rae Moar
On Wed, Sep 20, 2023 at 9:41 PM 'Jinjie Ruan' via KUnit Development wrote: > > When CONFIG_KUNIT_ALL_TESTS=y, making CONFIG_DEBUG_KMEMLEAK=y and > CONFIG_DEBUG_KMEMLEAK_AUTO_SCAN=y, the below memory leak is detected. > > If kunit_filter_suites() succeeds, not only copy but also filtered_suite >

Re: [PATCH 4/4] kunit: test: Fix the possible memory leak in executor_test

2023-09-19 Thread Rae Moar
On Thu, Sep 14, 2023 at 7:47 AM 'Jinjie Ruan' via KUnit Development wrote: > > If kunit_filter_suites() succeeds, not only copy but also filtered_suite > and filtered_suite->test_cases should be freed. > > So use kunit_free_suite_set() to free the filtered_suite, > filtered_suite->test_cases and

Re: [PATCH 3/4] kunit: Fix possible memory leak in kunit_filter_suites()

2023-09-19 Thread Rae Moar
d kunit.filter_glob cmdline option to filter > suites") > Fixes: 529534e8cba3 ("kunit: Add ability to filter attributes") > Signed-off-by: Jinjie Ruan Hello! This looks good to me. I just have one comment below. Reviewed-by: Rae Moar Thanks! -Rae > --- > li

Re: [PATCH 2/4] kunit: Fix the wrong kfree of copy for kunit_filter_suites()

2023-09-19 Thread Rae Moar
ixes: abbf73816b6f ("kunit: fix possible memory leak in > kunit_filter_suites()") > Signed-off-by: Jinjie Ruan Hello! This looks good to me as well. Reviewed-by: Rae Moar Thanks! -Rae > --- > lib/kunit/executor.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [PATCH 1/4] kunit: Fix missed memory release in kunit_free_suite_set()

2023-09-19 Thread Rae Moar
;] do_el0_svc+0x1c/0x28 > [<5b83c607>] el0_svc+0x3c/0xc4 > > Fixes: e5857d396f35 ("kunit: flatten kunit_suite*** to kunit_suite** in > .kunit_test_suites") > Fixes: b67abaad4d25 ("kunit: Allow kunit test modules to use test filtering") > Sign

Re: [PATCH 1/2] kunit: Warn if tests are slow

2023-09-19 Thread Rae Moar
On Mon, Sep 11, 2023 at 5:51 AM Maxime Ripard wrote: > > Kunit recently gained support to setup attributes, the first one being > the speed of a given test, then allowing to filter out slow tests. > > A slow test is defined in the documentation as taking more than one > second. There's an another

Re: [PATCH] kunit: Check for kunit_parse_glob_filter() failure

2023-09-19 Thread Rae Moar
On Fri, Sep 15, 2023 at 8:58 AM Dan Carpenter wrote: > > Smatch complains that the missing error checks would lead to a crash: > > lib/kunit/executor_test.c:40 parse_filter_test() > error: double free of 'filter.test_glob' > > We may as well do it right... > > Fixes: a127b154a8f2 ("kunit:

[PATCH 2/2] kunit: tool: add attributes output to kunit.py

2023-09-14 Thread Rae Moar
saved prior to the creation of the associated test object. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_parser.py | 31 + 1 file changed, 31 insertions(+) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit/kunit_parser.py index

[PATCH 1/2] kunit: tool: add parsing of test attributes

2023-09-14 Thread Rae Moar
in the suite log rather than the first test log. This could be changed to do the opposite if preferred. Signed-off-by: Rae Moar --- tools/testing/kunit/kunit_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/kunit/kunit_parser.py b/tools/testing/kunit