Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: list.lkml.keyrings@me.benboeckel.net
Cc: keyrings@vger.kernel.org,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <david@davidgow.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Rae Moar <raemoar63@gmail.com>,
	Ryota Sakamoto <sakamo.ryota@gmail.com>,
	Kuan-Wei Chiu <visitorckw@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Kir Chou <note351@hotmail.com>, Petr Mladek <pmladek@suse.com>,
	Dmitry Antipov <dmantipov@yandex.ru>,
	Guan-Chun Wu <409411716@gms.tku.edu.tw>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)"
	<linux-kselftest@vger.kernel.org>,
	"open list:KERNEL UNIT TESTING FRAMEWORK (KUnit)"
	<kunit-dev@googlegroups.com>
Subject: Re: [PATCH] lib/tests: kunit for associative array
Date: Sun, 18 Oct 2026 05:19:02 +0300	[thread overview]
Message-ID: <atQsloTurzo4cl7c@kernel.org> (raw)
In-Reply-To: <atQcpQ-1J28uJyT9@rotor.dev.benboeckel.internal>

On Sat, Oct 17, 2026 at 09:11:01PM -0400, Ben Boeckel wrote:
> On Wed, Oct 14, 2026 at 19:01:38 +0300, Jarkko Sakkinen wrote:
> > This is a kunit test for lib/assoc_array.c, which maintains a shadow model
> > across assoc_array operations, and checks its integrity after every
> > operation.
> > 
> > I wrote a draft version so that I could properly test 'assoc-array-fixes'
> > tag at Linus' tree, and spent today rewriting a new more polished version
> > with as good description as I could possibly could on how the seeded test
> > keys were cherry-picked. Along the way I also tweaked the numbers to be
> > a bit less messier set than in my original version.
> > 
> > The transcripts that follow were executed with this command-line:
> > 
> >     ./tools/testing/kunit/kunit.py run --raw_output assoc_array
> > 
> > With 'assoc-array-fixes' commits and its subsequent tag iterations all
> > eight tests pass, and without them all of them fail.
> > 
> > Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
> > ---
> >  lib/Kconfig.debug             |  15 +
> >  lib/tests/Makefile            |   1 +
> >  lib/tests/assoc_array_kunit.c | 570 ++++++++++++++++++++++++++++++++++
> >  3 files changed, 586 insertions(+)
> >  create mode 100644 lib/tests/assoc_array_kunit.c
> > 
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index 6b24a2c89b84..3e8d3852f53c 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -2857,6 +2857,21 @@ config HASHTABLE_KUNIT_TEST
> > 
> >  	  If unsure, say N.
> > 
> > +config ASSOC_ARRAY_KUNIT_TEST
> > +	tristate "KUnit test for assoc_array" if !KUNIT_ALL_TESTS
> > +	depends on KUNIT
> > +	default KUNIT_ALL_TESTS
> > +	select ASSOCIATIVE_ARRAY
> > +	help
> > +	  This builds the assoc_array KUnit test suite.
> > +	  It tests the basic functionality of the API defined in
> > +	  include/linux/assoc_array.h.
> > +
> > +	  For more information on KUnit and unit tests in general please refer
> > +	  to the KUnit documentation in Documentation/dev-tools/kunit/.
> > +
> > +	  If unsure, say N.
> > +
> >  config LINEAR_RANGES_TEST
> >  	tristate "KUnit test for linear_ranges"
> >  	depends on KUNIT
> > diff --git a/lib/tests/Makefile b/lib/tests/Makefile
> > index 3cac3b63a752..107e16b4ebc1 100644
> > --- a/lib/tests/Makefile
> > +++ b/lib/tests/Makefile
> > @@ -4,6 +4,7 @@
> > 
> >  # KUnit tests
> >  CFLAGS_bitfield_kunit.o := $(DISABLE_STRUCTLEAK_PLUGIN)
> > +obj-$(CONFIG_ASSOC_ARRAY_KUNIT_TEST) += assoc_array_kunit.o
> >  obj-$(CONFIG_BASE64_KUNIT) += base64_kunit.o
> >  obj-$(CONFIG_BITOPS_KUNIT) += bitops_kunit.o
> >  obj-$(CONFIG_BITFIELD_KUNIT) += bitfield_kunit.o
> 
> Why does this one end with `_TEST` and the others do not? I see
> `LINEAR_RANGES_TEST` in the context above, but it also lacks `_KUINT`.
> There is `HASHTABLE_KUNIT_TEST` nearby too, so perhaps consistency has
> just never been popular around these parts.

A blind spot. I started with that name.

This is phasing down as an RF patch set with rhashtable migration
is already out.

> 
> Thanks,
> 
> --Ben

Regardless, appreciate your feedback, thanks!

Br, Jarkko

      reply	other threads:[~2026-10-18  2:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 16:01 [PATCH] lib/tests: kunit for associative array Jarkko Sakkinen
2026-10-14 16:35 ` Eric Biggers
2026-10-14 16:56   ` Jarkko Sakkinen
2026-10-14 17:03     ` Jarkko Sakkinen
2026-10-14 17:32       ` Jarkko Sakkinen
2026-10-14 17:01   ` Linus Torvalds
2026-10-16  5:36 ` kernel test robot
2026-10-16 13:21 ` kernel test robot
2026-10-18  1:11 ` Ben Boeckel
2026-10-18  2:19   ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atQsloTurzo4cl7c@kernel.org \
    --to=jarkko@kernel.org \
    --cc=409411716@gms.tku.edu.tw \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brendan.higgins@linux.dev \
    --cc=david@davidgow.net \
    --cc=dmantipov@yandex.ru \
    --cc=keyrings@vger.kernel.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=list.lkml.keyrings@me.benboeckel.net \
    --cc=note351@hotmail.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=pmladek@suse.com \
    --cc=raemoar63@gmail.com \
    --cc=sakamo.ryota@gmail.com \
    --cc=visitorckw@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox