[PATCH net-next v8 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-14 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

[PATCH v8 4/4] scanf: break kunit into test cases

2025-02-14 Thread Tamir Duberstein
ect)); \ if (got != *expect) { \ - KUNIT_FAIL(test, \ - "%s:%d: vsscanf(\"%s\", \"%s\", ...) expect

[PATCH v8 3/4] scanf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
Convert the scanf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Reviewed-by: David Gow Signed-off-by: Tamir Duberstein --- M

[PATCH v8 1/4] scanf: implicate test line in failure messages

2025-02-14 Thread Tamir Duberstein
This improves the failure output by pointing to the failing line at the top level of the test. Signed-off-by: Tamir Duberstein --- lib/test_scanf.c | 66 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/test_scanf.c b

[PATCH v8 0/4] scanf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
This is one of just 3 remaining "Test Module" kselftests (the others being bitmap and printf), the rest having been converted to KUnit. In addition to the enclosed patch, please consider this an RFC on the removal of the "Test Module" kselftest machinery. I tested this usi

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
> > > tests)? > > > > If the latter, how are we supposed to answer to the question if the > > > > failed test > > > > is from new bunch of cases I hypothetically added or regression of the > > > > existing > > > > ones? Witho

Re: [PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-14 Thread Tamir Duberstein
On Fri, Feb 14, 2025 at 2:42 AM David Gow wrote: > > From: José Expósito > > In some cases, we need to call test-only code from outside the test > case, for example, to mock a function or a module. > > In order to check whether we are in a test or not, we need to test if &g

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-14 Thread Petr Mladek
to the question if the > > > failed test > > > is from new bunch of cases I hypothetically added or regression of the > > > existing > > > ones? Without this it seems like I need to go through all failures. OTOH > > > it may > > > be needed anyw

Re: [PATCH net 4/4] selftest/bpf: Add vsock test for sockmap rejecting unconnected

2025-02-14 Thread Michal Luczaj
On 2/13/25 12:58, Michal Luczaj wrote: > ... > This does not test datagram vsocks. Even though it hardly matters. VMCI is > the only transport that features VSOCK_TRANSPORT_F_DGRAM, but it has an > unimplemented vsock_transport::readskb() callback, making it un

Re: [PATCH v2] ww_mutex: convert self-test to KUnit

2025-02-14 Thread Tamir Duberstein
On Fri, Feb 14, 2025 at 4:48 AM Peter Zijlstra wrote: > > On Thu, Feb 13, 2025 at 10:42:24AM -0500, Tamir Duberstein wrote: > > On Thu, Feb 13, 2025 at 6:59 AM Peter Zijlstra wrote: > > > > > > On Thu, Feb 13, 2025 at 06:40:20AM -0500, Tamir Duberstein wrote: >

Re: [PATCH v2] ww_mutex: convert self-test to KUnit

2025-02-14 Thread Peter Zijlstra
On Thu, Feb 13, 2025 at 10:42:24AM -0500, Tamir Duberstein wrote: > On Thu, Feb 13, 2025 at 6:59 AM Peter Zijlstra wrote: > > > > On Thu, Feb 13, 2025 at 06:40:20AM -0500, Tamir Duberstein wrote: > > > Convert this unit test to a KUnit test. This allows the test to bene

[PATCH v6 3/3] rust: kunit: allow to know if we are in a test

2025-02-13 Thread David Gow
From: José Expósito In some cases, we need to call test-only code from outside the test case, for example, to mock a function or a module. In order to check whether we are in a test or not, we need to test if `CONFIG_KUNIT` is set. Unfortunately, we cannot rely only on this condition because

Re: [PATCH net-next RESEND v7 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-13 Thread Jakub Kicinski
On Thu, 13 Feb 2025 19:23:13 + Joe Damato wrote: > +TEST_GEN_PROGS := xdp_helper TEST_GET_PROGS is for self-contained tests TEST_GEN_FILES is the right variable for building helpers -- pw-bot: cr

Re: [PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-13 Thread kernel test robot
Hi Antonio, kernel test robot noticed the following build errors: [auto build test ERROR on 39f54262ba499d862420a97719d2f0eea0cbd394] url: https://github.com/intel-lab-lkp/linux/commits/Antonio-Quartulli/net-introduce-OpenVPN-Data-Channel-Offload-ovpn/20250211-091029 base

[PATCH net-next RESEND v7 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-13 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

Re: [PATCH v2] ww_mutex: convert self-test to KUnit

2025-02-13 Thread Tamir Duberstein
On Thu, Feb 13, 2025 at 6:59 AM Peter Zijlstra wrote: > > On Thu, Feb 13, 2025 at 06:40:20AM -0500, Tamir Duberstein wrote: > > Convert this unit test to a KUnit test. This allows the test to benefit > > from the KUnit tooling. Note that care is taken to avoid test-ending > &

Re: [PATCH v2] ww_mutex: convert self-test to KUnit

2025-02-13 Thread Peter Zijlstra
On Thu, Feb 13, 2025 at 06:40:20AM -0500, Tamir Duberstein wrote: > Convert this unit test to a KUnit test. This allows the test to benefit > from the KUnit tooling. Note that care is taken to avoid test-ending > assertions in worker threads, which is unsafe in KUnit (and wasn't done

[PATCH net 4/4] selftest/bpf: Add vsock test for sockmap rejecting unconnected

2025-02-13 Thread Michal Luczaj
Verify that for a connectible AF_VSOCK socket, merely having a transport assigned is insufficient; socket must be connected for the sockmap to accept. This does not test datagram vsocks. Even though it hardly matters. VMCI is the only transport that features VSOCK_TRANSPORT_F_DGRAM, but it has an

[PATCH v2] ww_mutex: convert self-test to KUnit

2025-02-13 Thread Tamir Duberstein
Convert this unit test to a KUnit test. This allows the test to benefit from the KUnit tooling. Note that care is taken to avoid test-ending assertions in worker threads, which is unsafe in KUnit (and wasn't done before this change either). Signed-off-by: Tamir Duberstein --- I tested this

Re: [PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-12 Thread kernel test robot
Hi Antonio, kernel test robot noticed the following build errors: [auto build test ERROR on 39f54262ba499d862420a97719d2f0eea0cbd394] url: https://github.com/intel-lab-lkp/linux/commits/Antonio-Quartulli/net-introduce-OpenVPN-Data-Channel-Offload-ovpn/20250211-091029 base

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-12 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 12:26 PM Tamir Duberstein wrote: > > > Is it me who cut something or the above missing this information (total > > tests)? > > If the latter, how are we supposed to answer to the question if the failed > > test > > is from new bunch o

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-12 Thread Dan Carpenter
On Wed, Feb 12, 2025 at 09:33:46AM -0500, Tamir Duberstein wrote: > > > > As an aside, how can I compile with the warning settings used by > kernel test robot? > This is a Smatch warning. https://github.com/error27/smatch https://github.com/error27/smatch/blob/master/Docume

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-12 Thread Tamir Duberstein
Hi Dan, On Wed, Feb 12, 2025 at 6:53 AM Dan Carpenter wrote: > > Hi Tamir, > > kernel test robot noticed the following build warnings: > > url: > https://github.com/intel-lab-lkp/linux/commits/Tamir-Duberstein/ww_mutex-convert-self-test-to-KUnit/2

[PATCH net-next v7 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-12 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Enable CONFIG_XDP_SOCKETS for selftests/drivers/net tests, as well. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-12 Thread Joe Damato
gt; +1 this we need for sure OK will do. > > > I wonder if that's a separate issue though? > > > > > > In other words: maybe writing the test as I've mentioned above so it > > > works regardless of whether CONFIG_XDP_SOCKETS is set or not is a > > &

[PATCH v5 2/2] selftests/futex: Create test for robust list

2025-02-12 Thread André Almeida
Create a test for the robust list mechanism. Test the following uAPI operations: - Creating a robust mutex where the lock waiter is wake by the kernel when the lock owner died - Setting a robust list to the current task - Getting a robust list from the current task - Getting a robust list from

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-12 Thread Dan Carpenter
Hi Tamir, kernel test robot noticed the following build warnings: url: https://github.com/intel-lab-lkp/linux/commits/Tamir-Duberstein/ww_mutex-convert-self-test-to-KUnit/20250211-000245 base: a64dcfb451e254085a7daee5fe51bf22959d52d3 patch link: https://lore.kernel.org/r/20250210

[PATCH bpf-next v5 5/6] selftests/bpf: test_xdp_veth: Add XDP program on egress test

2025-02-12 Thread Bastien Curutchet (eBPF Foundation)
XDP programs loaded on egress is tested by test_xdp_redirect_multi.sh but not by the test_progs framework. Add a test case in test_xdp_veth.c to test the XDP program on egress. Use the same BPF program than test_xdp_redirect_multi.sh that replaces the source MAC address by one provided through a

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-12 Thread David Gow
On Wed, 12 Feb 2025 at 06:43, Tamir Duberstein wrote: > > On Tue, Feb 11, 2025 at 5:38 PM Boqun Feng wrote: > > > > Hi Tamir, > > Hi Boqun, thanks for taking a look. > > > On Mon, Feb 10, 2025 at 10:59:12AM -0500, Tamir Duberstein wrote: > > &

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-12 Thread David Gow
reading > >> >> code using those KUNIT macros quite hard, because I'm not familiar with > >> >> those macros and when I try to look up what they do they turn out to be > >> >> defined in terms of other KUNIT macros 10 levels deep. > >> >&

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Jakub Kicinski
ore clear. My suggestion is to add > CONFIG_XDP_SOCKETS to tools/testing/selftests/drivers/net/config > to make your new testcase run in a proper environment with XSKs enabled. +1 this we need for sure > > I wonder if that's a separate issue though? > > > > In ot

Re: [PATCH v2] blackhole_dev: convert self-test to KUnit

2025-02-11 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski : On Sat, 08 Feb 2025 14:26:43 -0500 you wrote: > Convert this very simple smoke test to a KUnit test. > > Add a missing `htons` call that was spotted[0] by kernel test robot > after initial convers

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Stanislav Fomichev
; > > > > On 2/10/25 8:38 PM, Joe Damato wrote: > > [...] > > > > > > > > > > > This causes self-test failures: > > > > > > > > > > https://netdev-3.bots.linux.dev/vmksft-net-drv/results/987742/4-queues-py/stdout

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 5:38 PM Boqun Feng wrote: > > Hi Tamir, Hi Boqun, thanks for taking a look. > On Mon, Feb 10, 2025 at 10:59:12AM -0500, Tamir Duberstein wrote: > > Convert this unit test to a KUnit test. > > > > I would like to know the pros and cons between k

Re: [PATCH] ww_mutex: convert self-test to KUnit

2025-02-11 Thread Boqun Feng
Hi Tamir, On Mon, Feb 10, 2025 at 10:59:12AM -0500, Tamir Duberstein wrote: > Convert this unit test to a KUnit test. > I would like to know the pros and cons between kunit tests and kselftests, maybe someone Cced can answer that? It'll be good to put these in the commit log as wel

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
0/25 8:38 PM, Joe Damato wrote: [...] > > > > > > > > This causes self-test failures: > > > > > > > > https://netdev-3.bots.linux.dev/vmksft-net-drv/results/987742/4-queues-py/stdout > > > > > > > > but I really haven't done any real inve

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Stanislav Fomichev
in queues: > > > > +if q['id'] == 0: > > > > +if q['type'] == 'rx': > > > > +rx = True > > > > + if q['type'] == 'tx': > > > > +tx = Tr

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
> > +rx = True > > > +if q['type'] == 'tx': > > > +tx = True > > > + > > > +ksft_eq(q['xsk'], {}) > > > +else: > > > +if 'xsk&#

[PATCH v15 11/15] selftests: pci_endpoint: Add doorbell test case

2025-02-11 Thread Frank Li
Add doorbell test case. Signed-off-by: Frank Li --- change from v14 to v15 - none change from v13 to v14 - merge to selftests framework --- .../selftests/pci_endpoint/pci_endpoint_test.c | 25 ++ 1 file changed, 25 insertions(+) diff --git a/tools/testing/selftests

[PATCH v15 10/15] misc: pci_endpoint_test: Add doorbell test case

2025-02-11 Thread Frank Li
AR_5, + NO_BAR = -1, }; struct pci_endpoint_test { @@ -829,6 +842,71 @@ static int pci_endpoint_test_set_irq(struct pci_endpoint_test *test, return 0; } +static int pci_endpoint_test_doorbell(struct pci_endpoint_test *test) +{ + struct pci_dev *pdev = test->pdev; + s

[PATCH v15 09/15] PCI: endpoint: pci-epf-test: Add doorbell test support

2025-02-11 Thread Frank Li
ci_epc_get_next_free_bar(epf_test->epc_features, epf_test->test_reg_bar + 1); + if (bar < BAR_0 || bar == epf_test->test_reg_bar || !epf->db_msg) { + reg->status |= STATUS_DOORBELL_ENABLE_FAIL; + return; + } + + ret = request_irq(e

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 6:34 AM Tamir Duberstein wrote: > > https://lore.kernel.org/all/20250210-printf-kunit-convert-v3-1-ee6ac5500...@gmail.com/ > > Weirdly the cover letter seems to be missing on lore, should I resend? It's there now. https://lore.kernel.org/all/20250210-printf-kunit-convert-v

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Joe Damato
+for q in queues: > > +if q['id'] == 0: > > +if q['type'] == 'rx': > > +rx = True > > +if q['type'] == 'tx': > > +tx = True > > + > > +

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
t; > > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > > > > wrote: > > > > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: > > ... > > > > > > > - Use original test assertions as KUNIT_*_EQ_MSG produces > &

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
gt; > > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: ... > > > > > - Use original test assertions as KUNIT_*_EQ_MSG produces > > > > > hard-to-parse > > > > > messages. The new failure output is: > > > &

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 11:38 AM Kees Cook wrote: > > On Tue, Feb 11, 2025 at 06:51:09AM -0500, Tamir Duberstein wrote: > > Kees, it looks like the private header didn't make it to your tree. > > This bit is missing: > > Whoops! Thanks. I've added it (and fixed the comment style). > > I really nee

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-11 Thread Kees Cook
On Tue, Feb 11, 2025 at 06:51:09AM -0500, Tamir Duberstein wrote: > Kees, it looks like the private header didn't make it to your tree. > This bit is missing: Whoops! Thanks. I've added it (and fixed the comment style). I really need to do my build/run testing from a fresh checkout instead of in

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 11:06 AM Petr Mladek wrote: > > On Tue 2025-02-11 06:45:07, Tamir Duberstein wrote: > > On Tue, Feb 11, 2025 at 6:37 AM Petr Mladek wrote: > > > > > > On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > > > > Con

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Petr Mladek
On Tue 2025-02-11 06:45:07, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 6:37 AM Petr Mladek wrote: > > > > On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > > > Convert the scanf() self-test to a KUnit test. > > > > > > In the interest of keepi

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
> ... > > > > > - Use original test assertions as KUNIT_*_EQ_MSG produces hard-to-parse > > > > messages. The new failure output is: > > > > > > It would be good if you put into cover letter, or even in the respectful > > > patch >

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:47:03AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko > wrote: > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: ... > > > - Use original test assertions as KUNIT_*_EQ_MSG produces hard-to-p

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 10:40 AM Andy Shevchenko wrote: > > On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: > > This is one of just 3 remaining "Test Module" kselftests (the others > > being bitmap and printf), the rest having been converted to K

Re: [PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 10:13:36AM -0500, Tamir Duberstein wrote: > This is one of just 3 remaining "Test Module" kselftests (the others > being bitmap and printf), the rest having been converted to KUnit. In > addition to the enclosed patch, please consider this an RFC on t

Re: [PATCH] blackhole_dev: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 9:47 AM Simon Horman wrote: > > On Fri, Feb 07, 2025 at 06:38:41PM -0500, Tamir Duberstein wrote: > > Convert this very simple smoke test to a KUnit test. > > Hi Tamir, > > I think some text explaining why this change is being made is > warrant

[PATCH v7 2/3] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
Convert the scanf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Reviewed-by: David Gow Signed-off-by: Tamir Duberstein --- M

[PATCH v7 3/3] scanf: break kunit into test cases

2025-02-11 Thread Tamir Duberstein
if (got != *expect) { \ - KUNIT_FAIL(test, \ - "vsscanf(\"%s\", \"%s\", ...) expected " arg_fmt " got " arg_fmt, \ -

[PATCH v7 0/3] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
This is one of just 3 remaining "Test Module" kselftests (the others being bitmap and printf), the rest having been converted to KUnit. In addition to the enclosed patch, please consider this an RFC on the removal of the "Test Module" kselftest machinery. I tested this usi

Re: [PATCH v6 2/2] scanf: break kunit into test cases

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 6:54 AM Petr Mladek wrote: > > On Mon 2025-02-10 13:13:49, Tamir Duberstein wrote: > > Use `suite_init` and move some tests into `scanf_test_cases`. This > > gives us nicer output in the event of a failure. > > Hmm, simulate the following fail

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 7:15 AM Andy Shevchenko wrote: > > On Tue, Feb 11, 2025 at 06:45:07AM -0500, Tamir Duberstein wrote: > > On Tue, Feb 11, 2025 at 6:37 AM Petr Mladek wrote: > > > On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > > > > > +

Re: [PATCH] blackhole_dev: convert self-test to KUnit

2025-02-11 Thread Simon Horman
On Fri, Feb 07, 2025 at 06:38:41PM -0500, Tamir Duberstein wrote: > Convert this very simple smoke test to a KUnit test. Hi Tamir, I think some text explaining why this change is being made is warranted here. > > Signed-off-by: Tamir Duberstein > --- > I tested this usin

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Andy Shevchenko
On Tue, Feb 11, 2025 at 06:45:07AM -0500, Tamir Duberstein wrote: > On Tue, Feb 11, 2025 at 6:37 AM Petr Mladek wrote: > > On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > > > + kunit_printk(KERN_DEBUG, test, "\"%s\", \"%s\" ->",

Re: [PATCH v6 2/2] scanf: break kunit into test cases

2025-02-11 Thread Petr Mladek
On Mon 2025-02-10 13:13:49, Tamir Duberstein wrote: > Use `suite_init` and move some tests into `scanf_test_cases`. This > gives us nicer output in the event of a failure. Hmm, simulate the following failure in the original test module: diff --git a/lib/test_scanf.c b/lib/test_scanf.c

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
t; > > > On Mon, Feb 10, 2025 at 9:37 PM Kees Cook wrote: > > > > > > On Sat, Feb 08, 2025 at 09:44:39PM -0500, Tamir Duberstein wrote: > > > > Extract a private header and convert the prime_numbers self-test to a > > > > KUnit test. I consider

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
On Tue, Feb 11, 2025 at 6:37 AM Petr Mladek wrote: > > On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > > Convert the scanf() self-test to a KUnit test. > > > > In the interest of keeping the patch reasonably-sized this doesn't > > refactor the tests int

Re: [PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-11 Thread Petr Mladek
On Mon 2025-02-10 13:13:48, Tamir Duberstein wrote: > Convert the scanf() self-test to a KUnit test. > > In the interest of keeping the patch reasonably-sized this doesn't > refactor the tests into proper parameterized tests - it's all one big > test case. > >

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-11 Thread Tamir Duberstein
find reading > >> >> code using those KUNIT macros quite hard, because I'm not familiar with > >> >> those macros and when I try to look up what they do they turn out to be > >> >> defined in terms of other KUNIT macros 10 levels deep. > >> >

Re: [PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-11 Thread Paolo Abeni
e > +if q['type'] == 'tx': > +tx = True > + > +ksft_eq(q['xsk'], {}) > +else: > +if 'xsk' in q: > +_fail("Check failed: xsk attribute set.") > + > +

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-11 Thread Rasmus Villemoes
> those macros and when I try to look up what they do they turn out to be >> >> defined in terms of other KUNIT macros 10 levels deep. >> >> >> >> But that still leaves a few points. First, I really like that "388 test >> >> cases passed" tally or som

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread David Gow
th the fragment "at boot". I think > > > > > > IMO, "at boot" is a misnomer, as most tests can be either builtin > > > or modular. > > > > Right. > > > > > > > > > KUNIT is disabled in defconfig, at least on x86_64.

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-10 Thread David Gow
f other KUNIT macros 10 levels deep. > >> > >> But that still leaves a few points. First, I really like that "388 test > >> cases passed" tally or some other free-form summary (so that I can see > >> that I properly hooked up, compiled, and ran a new testc

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
t; > On Sat, Feb 08, 2025 at 09:44:39PM -0500, Tamir Duberstein wrote: > > > Extract a private header and convert the prime_numbers self-test to a > > > KUnit test. I considered parameterizing the test using > > > `KUNIT_CASE_PARAM` but didn't see how it was possible

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
On Mon, Feb 10, 2025 at 9:37 PM Kees Cook wrote: > > On Sat, Feb 08, 2025 at 09:44:39PM -0500, Tamir Duberstein wrote: > > Extract a private header and convert the prime_numbers self-test to a > > KUnit test. I considered parameterizing the test using > > `KUNIT_CASE_PARA

Re: [PATCH v5 2/2] lib/prime_numbers: convert self-test to KUnit

2025-02-10 Thread Kees Cook
On Sat, Feb 08, 2025 at 09:44:39PM -0500, Tamir Duberstein wrote: > Extract a private header and convert the prime_numbers self-test to a > KUnit test. I considered parameterizing the test using > `KUNIT_CASE_PARAM` but didn't see how it was possible since the test > logic is e

[PATCH net-next v19 25/26] testing/selftests: add test tool and scripts for ovpn module

2025-02-10 Thread Antonio Quartulli
|5 + tools/testing/selftests/net/ovpn/ovpn-cli.c| 2377 tools/testing/selftests/net/ovpn/tcp_peers.txt |5 + .../testing/selftests/net/ovpn/test-chachapoly.sh |9 + tools/testing/selftests/net/ovpn/test-float.sh |9 + tools/testing/selftests/net

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread John Hubbard
ilable in the kernel-modules-internal package. To test this you can follow this to install rawhide-vm: https://developer.fedoraproject.org/tools/virt-builder/about.html then inside the vm: yum install kernel-modules-internal add the kunit.enable=1 to the cmdline reboot vm mo

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread Nico Pache
t;> > >> IMO, "at boot" is a misnomer, as most tests can be either builtin > >> or modular. > > > > Right. > > > >> > >>> KUNIT is disabled in defconfig, at least on x86_64. It is also disabled > >>> on my Ubuntu 24.04 m

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
th the fragment "at boot". I think > > > > > > IMO, "at boot" is a misnomer, as most tests can be either builtin > > > or modular. > > > > Right. > > > > > > > > > KUNIT is disabled in defconfig, at least on x86_64.

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread Yury Norov
be either builtin > > or modular. > > Right. > > > > > > KUNIT is disabled in defconfig, at least on x86_64. It is also disabled > > > on my Ubuntu 24.04 machine. If I take your patches, I'll be unable to > > OK so I just bought a shiny new test mac

Re: distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread David Hildenbrand
4 machine. If I take your patches, I'll be unable to OK so I just bought a shiny new test machine, and installed one of the big name distros on it, hoping they've moved ahead and bought into the kunit story... $ grep KUNIT /boot/config-6.8.0-52-generic # CONFIG_KUNIT is not set ...

[PATCH net-next v6 3/3] selftests: drv-net: Test queue xsk attribute

2025-02-10 Thread Joe Damato
Test that queues which are used for AF_XDP have the xsk nest attribute. The attribute is currently empty, but its existence means the AF_XDP is being used for the queue. Signed-off-by: Joe Damato Suggested-by: Jakub Kicinski --- v3: - Change comment style of helper C program to avoid kdoc

distro support for CONFIG_KUNIT: [PATCH 0/3] bitmap: convert self-test to KUnit

2025-02-10 Thread John Hubbard
#x27;ll be unable to OK so I just bought a shiny new test machine, and installed one of the big name distros on it, hoping they've moved ahead and bought into the kunit story... $ grep KUNIT /boot/config-6.8.0-52-generic # CONFIG_KUNIT is not set ...gagghh! No such luck. One more data po

[PATCH v6 2/2] scanf: break kunit into test cases

2025-02-10 Thread Tamir Duberstein
BUF_SIZE 1024 @@ -428,8 +424,11 @@ static void numbers_list_hh(struct kunit *test, const char *delim) numbers_list_8(signed char,"0x%hhx", delim, "hhi", check_char); } -static void numbers_list(struct kunit *test, const char *delim) +static void numbers_lis

[PATCH v6 1/2] scanf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
Convert the scanf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Acked-by: Petr Mladek Reviewed-by: David Gow Signed-off-by: Tamir Duberstein --- M

[PATCH v6 0/2] scanf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
This is one of just 3 remaining "Test Module" kselftests (the others being bitmap and printf), the rest having been converted to KUnit. In addition to the enclosed patch, please consider this an RFC on the removal of the "Test Module" kselftest machinery. I tested this usi

Re: [PATCH v5 2/2] scanf: break kunit into test cases

2025-02-10 Thread Tamir Duberstein
On Mon, Feb 10, 2025 at 11:27 AM Geert Uytterhoeven wrote: > > > [...] > > > > -static char *test_buffer; > > -static char *fmt_buffer; > > +static char test_buffer[BUF_SIZE]; > > +static char fmt_buffer[BUF_SIZE]; > > Why? This wastes 2 KiB of memo

Re: [PATCH v5 2/2] scanf: break kunit into test cases

2025-02-10 Thread Geert Uytterhoeven
har *test_buffer; > -static char *fmt_buffer; > +static char test_buffer[BUF_SIZE]; > +static char fmt_buffer[BUF_SIZE]; Why? This wastes 2 KiB of memory when the test is not running. > static struct rnd_state rnd_state; > > typedef void (*check_fn)(struct kunit *test, const v

[PATCH] ww_mutex: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
Convert this unit test to a KUnit test. Signed-off-by: Tamir Duberstein --- I tested this using: $ tools/testing/kunit/kunit.py run --arch arm64 --make_options LLVM=1 ww_mutex On success: ; [12:48:16] == ww_mutex (5 subtests) === ; [12:48:16

Re: [PATCH v2] blackhole_dev: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
On Sat, Feb 8, 2025 at 2:26 PM Tamir Duberstein wrote: > > Convert this very simple smoke test to a KUnit test. > > Add a missing `htons` call that was spotted[0] by kernel test robot > after initial conversion to KUnit. > > Link: > https://lore.kernel.org/oe-kbuild-a

Re: [PATCH v5 1/2] scanf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
On Mon, Feb 10, 2025 at 10:00 AM Tamir Duberstein wrote: > > Convert the scanf() self-test to a KUnit test. > > In the interest of keeping the patch reasonably-sized this doesn't > refactor the tests into proper parameterized tests - it's all one big > test cas

[PATCH v6 3/3] rseq/selftests: Add test for mm_cid compaction

2025-02-10 Thread Gabriele Monaco
A task in the kernel (task_mm_cid_work) runs somewhat periodically to compact the mm_cid for each process. Add a test to validate that it runs correctly and timely. The test spawns 1 thread pinned to each CPU, then each thread, including the main one, runs in short bursts for some time. During

Re: [PATCH v5 3/3] rseq/selftests: Add test for mm_cid compaction

2025-02-10 Thread Gabriele Monaco
On Mon, 2025-02-10 at 15:53 +0100, Mathieu Desnoyers wrote: > On 2025-02-10 08:57, Gabriele Monaco wrote: > > A task in the kernel (task_mm_cid_work) runs somewhat periodically > > to > > compact the mm_cid for each process. Add a test to validate that it > > ru

Re: [PATCH v2 1/2] printf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
On Mon, Feb 10, 2025 at 9:52 AM Geert Uytterhoeven wrote: > > Hi Tamir, > > On Mon, 10 Feb 2025 at 15:37, Tamir Duberstein wrote: > > On Mon, Feb 10, 2025 at 8:01 AM Rasmus Villemoes > > wrote: > > > > > > On Fri, Feb 07 2025, Tamir Duberstein wrote: > > > > > > [...] > > > > > > If/when you do

[PATCH v5 2/2] scanf: break kunit into test cases

2025-02-10 Thread Tamir Duberstein
BUF_SIZE 1024 -static char *test_buffer; -static char *fmt_buffer; +static char test_buffer[BUF_SIZE]; +static char fmt_buffer[BUF_SIZE]; static struct rnd_state rnd_state; typedef void (*check_fn)(struct kunit *test, const void *check_data, const char *string, @@ -428,8 +423,11 @@ static void

[PATCH v5 1/2] scanf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
Convert the scanf() self-test to a KUnit test. In the interest of keeping the patch reasonably-sized this doesn't refactor the tests into proper parameterized tests - it's all one big test case. Acked-by: Petr Mladek Reviewed-by: David Gow Signed-off-by: Tamir Duberstein --- M

[PATCH v5 0/2] scanf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
This is one of just 3 remaining "Test Module" kselftests (the others being bitmap and printf), the rest having been converted to KUnit. In addition to the enclosed patch, please consider this an RFC on the removal of the "Test Module" kselftest machinery. I tested this usi

Re: [PATCH v5 3/3] rseq/selftests: Add test for mm_cid compaction

2025-02-10 Thread Mathieu Desnoyers
On 2025-02-10 08:57, Gabriele Monaco wrote: A task in the kernel (task_mm_cid_work) runs somewhat periodically to compact the mm_cid for each process. Add a test to validate that it runs correctly and timely. The test spawns 1 thread pinned to each CPU, then each thread, including the main one

Re: [PATCH v2 1/2] printf: convert self-test to KUnit

2025-02-10 Thread Geert Uytterhoeven
Hi Tamir, On Mon, 10 Feb 2025 at 15:37, Tamir Duberstein wrote: > On Mon, Feb 10, 2025 at 8:01 AM Rasmus Villemoes > wrote: > > > > On Fri, Feb 07 2025, Tamir Duberstein wrote: > > > > [...] > > > > If/when you do re-roll a v3, can you split the defconfig changes off to > > a separate patch? It

Re: [PATCH v2 1/2] printf: convert self-test to KUnit

2025-02-10 Thread Tamir Duberstein
> --- a/lib/Kconfig.debug > > +++ b/lib/Kconfig.debug > > @@ -2427,6 +2427,23 @@ config ASYNC_RAID6_TEST > > config TEST_HEXDUMP > > tristate "Test functions located in the hexdump module at runtime" > > > > +config PRINTF_KUNIT_TEST > > +

Re: [PATCH v2 1/2] printf: convert self-test to KUnit

2025-02-10 Thread Rasmus Villemoes
On Fri, Feb 07 2025, Tamir Duberstein wrote: > Convert the printf() self-test to a KUnit test. > > In the interest of keeping the patch reasonably-sized this doesn't > refactor the tests into proper parameterized tests - it's all one big > test case. > > Acked

Re: [PATCH 0/2] printf: convert self-test to KUnit

2025-02-10 Thread Rasmus Villemoes
sing those KUNIT macros quite hard, because I'm not familiar with >> those macros and when I try to look up what they do they turn out to be >> defined in terms of other KUNIT macros 10 levels deep. >> >> But that still leaves a few points. First, I really like that &qu

  1   2   3   4   5   6   7   8   9   10   >