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

2024-09-06 Thread Rae Moar
On Thu, Aug 29, 2024 at 4:28 PM Michal Wajdeczko wrote: > > > > On 29.08.2024 20:58, Rae Moar wrote: > > On Thu, Aug 29, 2024 at 11:32 AM Michal Wajdeczko > > wrote: > >> > >> While kunit/visibility.h is today not included in any generated > >>

Re: [PATCH v3 6/6] kunit: Add some selftests for global stub redirection macros

2024-09-06 Thread Rae Moar
all thing: I find "selftests" in the title of the patch a bit confusing due to the other main Kernel tests being kselftests. I think I would replace "selftests" with just "tests". > --- > Cc: Rae Moar > Cc: David Gow > Cc: Lucas De Marchi > --- >

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

2024-08-29 Thread Rae Moar
ng this. We will need to do a patch on making this recognized as a kernel-doc at some point. Reviewed-by: Rae Moar Thanks! -Rae > --- > Cc: Rae Moar > Cc: David Gow > --- > include/kunit/visibility.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/in

Re: [PATCH v2 3/6] kunit: Add macro to conditionally expose expressions to tests

2024-08-27 Thread Rae Moar
ding this macro without being used as long as examples on how and why to use it are clearly documented. Thanks! -Rae > --- > Cc: Rae Moar > Cc: David Gow > Cc: Lucas De Marchi > --- > include/kunit/visibility.h | 8 > 1 file changed, 8 insertions(+) > > diff

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

2024-08-22 Thread Rae Moar
On Wed, Aug 21, 2024 at 6:00 PM Michal Wajdeczko wrote: > > > > On 21.08.2024 23:22, Rae Moar wrote: > > On Wed, Aug 21, 2024 at 10:43 AM Michal Wajdeczko > > wrote: > >> > >> Add example how to use KUNIT_FIXED_STUB_REDIRECT and compare its > >&

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

2024-08-21 Thread Rae Moar
On Wed, Aug 21, 2024 at 10:43 AM Michal Wajdeczko wrote: > Hello! This is looking good and seems to be working well. I just had some questions below. Thanks! -Rae > Currently, the 'static stub' API only allows function redirection > for calls made from the kthread of the current test, which pre

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

2024-08-21 Thread Rae Moar
data structures. > > Signed-off-by: Michal Wajdeczko Hello! I really like this test. It provides a great overview of this patch series. I just have a couple comments below. Otherwise, Reviewed-by: Rae Moar Thanks! -Rae > --- > Cc: David Gow > Cc: Daniel Latypov > Cc: Lucas De

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

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

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

2024-08-21 Thread Rae Moar
ned-off-by: Michal Wajdeczko Hello! I am good with this. It is definitely a prettier way to access kunit_running. Reviewed-by: Rae Moar Thanks! -Rae > --- > Cc: Daniel Latypov > Cc: David Gow > Cc: Lucas De Marchi > --- > include/kunit/test-bug.h | 12 ++-- &g

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

2024-08-20 Thread Rae Moar
gt; Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") > Reported-by: Nico Pache > Closes: https://groups.google.com/g/kunit-dev/c/81V9b9QYON0 > Reviewed-by: Kees Cook > Reviewed-by: Maxime Ripard > Reviewed-by: Rae Moar > Signed-off-by: David Gow > -

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

2024-08-02 Thread Rae Moar
: David Gow > Reviewed-by: Kees Cook > --- > > There's some more serious changes since the RFC I sent, so please take a > closer look. > > Thanks, > -- David > Hello! These changes look good to me. Fun patch to review! Only comment is that we could potentially a

[PATCH v2] kunit: add test duration attribute

2024-07-31 Thread Rae Moar
printed for each test (excluding parameterized tests). Add documentation for this new attribute to KUnit docs. In order to save the timespec64 object, add the ability to save a memory allocated object to the attributes framework. Signed-off-by: Rae Moar --- Changes v1->v2: - Change sprintf

[PATCH] kunit: add test duration attribute

2024-07-16 Thread Rae Moar
printed for each test (excluding parameterized tests). Add documentation for this new attribute to KUnit docs. In order to save the timespec64 object, add the ability to save a memory allocated object to the attributes framework. Signed-off-by: Rae Moar --- .../dev-tools/kunit/running_tips.rst

Re: [RFC] ktap_v2: KTAP specification transition method

2024-07-02 Thread Rae Moar
Hello everyone, It has been a few months since there has been activity regarding the second version of KTAP. I wanted to bring this topic back up to the surface. Currently, Frank has compiled a list of KTAPv2 patches here at this link: https://elinux.org/Test_Results_Format_Notes#KTAP_version_2

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

2024-06-21 Thread Rae Moar
off-by: Ivan Orlov Hello! This looks good to me. I don't know if it was necessary to move the assert tests but I definitely see the reasoning. Happy with this as it is. There are a few checkpatch warnings I have mentioned below but I think the use case makes it necessary. Reviewed-by:

Re: [PATCH v2 4/5] kunit: assert_test: Prepare to be merged into kunit-test.c

2024-06-21 Thread Rae Moar
(and other) functions from assert into the KUnit namespace, > so we could use them in the tests (and cover them as well). > > Signed-off-by: Ivan Orlov Hi! This looks good to me. I am happy with the changes since v1. Reviewed-by: Rae Moar Thanks for your work on this! -Rae > --- >

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

2024-06-21 Thread Rae Moar
ng by lengthening the description. But I am happy with this patch as is. Reviewed-by: Rae Moar Thanks! -Rae > --- > V1 -> V2: > - No changes > > lib/kunit/Kconfig | 8 > lib/kunit/Makefile | 2 +- > lib/kunit/string-stream-test.

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

2024-06-21 Thread Rae Moar
ule. Import the KUnit namespace in the test. > > Reviewed-by: David Gow > Signed-off-by: Ivan Orlov Hello! This seems good to me. Reviewed-by: Rae Moar Thanks! -Rae > --- > V1 -> V2: > - No changes > > lib/kunit/kunit-test.c | 18 +- > 1 file chan

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

2024-06-21 Thread Rae Moar
ed-off-by: Ivan Orlov Hello! This looks good to me. Reviewed-by: Rae Moar Thanks! -Rae > --- > V1 -> V2: > - No changes > > lib/kunit/string-stream.c | 12 +++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/lib/kunit/string-stream.c

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

2024-06-20 Thread Rae Moar
Signed-off-by: Kees Cook Hello! This looks good to me. And seems to fix the problem. Thanks for the fix! Reviewed-by: Rae Moar -Rae > --- > Resending as v2 with Shuah in To: > --- > Cc: Shuah Khan > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: "G

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

2024-06-20 Thread Rae Moar
Johnson > Signed-off-by: Kees Cook Hi! This looks good to me. Reviewed-by: Rae Moar Thanks! -Rae > --- > 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. >

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
nitions to `assert.h`. > > Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to > how it is done 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 f

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

2024-05-16 Thread Rae Moar
ons to `assert.h`. > > Build the assert test when CONFIG_KUNIT_TEST is enabled, similar to > how it is done 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 co

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
d-by. Thanks! -Rae > > 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 > make

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) 'is_lit

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

2024-04-29 Thread Rae Moar
ssertion > formatting functions. As you can see, it covers some of the static > helper functions as well, 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

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. Than

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

2024-04-23 Thread Rae Moar
se > conditions, and add a dependency 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 Go

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

2024-04-12 Thread Rae Moar
he 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
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
CATED") > 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. Reviewed-by: Rae Moar

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
c validate > 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 |

[KTAP V2 PATCH v3] ktap_v2: add test metadata

2024-02-15 Thread Rae Moar
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 examples of

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

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
; Fixes: d03c720e03bd ("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://l

[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
with 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

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
vices") > 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

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 r

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 kunit_activate

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

2023-12-19 Thread Rae Moar
ake the address of the supplied function, and > 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 thin

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
nality 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
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 of the

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

2023-12-12 Thread Rae Moar
nality 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
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 a

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

2023-12-08 Thread Rae Moar
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
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 a

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

2023-12-05 Thread Rae Moar
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 a

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

2023-12-04 Thread Rae Moar
nality 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
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
_debugfs_create_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! -

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! Rev

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

2023-11-30 Thread Rae Moar
t; Signed-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/strin

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 &

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" for each test

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/4] kunit: Fix indentation level of suite messages

2023-10-03 Thread Rae Moar
On Mon, Oct 2, 2023 at 9:42 AM Michal Wajdeczko wrote: > > > > On 28.09.2023 22:52, Rae Moar wrote: > > On Mon, Sep 25, 2023 at 1:58 PM Michal Wajdeczko > > wrote: > >> > >> A kunit suite is a top level test from the KTAP point of view but > >&g

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

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

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 insertions

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

2023-09-28 Thread Rae Moar
ff-by: 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
ing 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
b/kunit/debugfs.c:119 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

  1   2   >