linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Maguire <alan.maguire@oracle.com>
To: Brendan Higgins <brendanhiggins@google.com>
Cc: Alan Maguire <alan.maguire@oracle.com>,
	David Gow <davidgow@google.com>,
	Iurii Zaikin <yzaikin@google.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Kees Cook <keescook@chromium.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	catalin.marinas@arm.com, joe.lawrence@redhat.com,
	penguin-kernel@i-love.sakura.ne.jp, urezki@gmail.com,
	andriy.shevchenko@linux.intel.com,
	Jonathan Corbet <corbet@lwn.net>,
	adilger.kernel@dilger.ca, Luis Chamberlain <mcgrof@kernel.org>,
	linux-ext4@vger.kernel.org,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Knut Omang <knut.omang@oracle.com>
Subject: Re: [PATCH v4 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module
Date: Wed, 20 Nov 2019 13:56:52 +0000 (GMT)	[thread overview]
Message-ID: <alpine.LRH.2.20.1911201347190.19458@dhcp-10-175-162-125.vpn.oracle.com> (raw)
In-Reply-To: <CAFd5g473rHeUk6EJ_KnvRin5LrKyW4cNQxNHXmT2zkai5V=q1w@mail.gmail.com>

On Tue, 19 Nov 2019, Brendan Higgins wrote:

> On Fri, Nov 15, 2019 at 2:16 AM Alan Maguire <alan.maguire@oracle.com> wrote:
> >
> > As tests are added to kunit, it will become less feasible to execute
> > all built tests together.  By supporting modular tests we provide
> > a simple way to do selective execution on a running system; specifying
> >
> > CONFIG_KUNIT=y
> > CONFIG_KUNIT_EXAMPLE_TEST=m
> >
> > ...means we can simply "insmod example-test.ko" to run the tests.
> >
> > To achieve this we need to do the following:
> >
> > o export the required symbols in kunit
> > o string-stream tests utilize non-exported symbols so for now we skip
> >   building them when CONFIG_KUNIT_TEST=m.
> > o support a new way of declaring test suites.  Because a module cannot
> >   do multiple late_initcall()s, we provide a kunit_test_suites() macro
> >   to declare multiple suites within the same module at once.
> > o some test module names would have been too general ("test-test"
> >   and "example-test" for kunit tests, "inode-test" for ext4 tests);
> >   rename these as appropriate ("kunit-test", "kunit-example-test"
> >   and "ext4-inode-test" respectively).
> 
> Hmm...should we maybe apply this naming scheme to all the tests then?
> I think Kees might have suggested this. I am actually not sure whether
> or not we should and would like to get other people's input.
> 

I'd be interested in other opinions here too; the approach I took here was 
to apply the convention [subsystem]-[optional-suite]-test.ko. So for 
example kunit-test.ko because the subsystem under test is kunit, etc.
Implicit in this is the reasoning that the framework used isn't relevant 
to the naming of the test module, but I'm happy to tweak the naming 
scheme if another approach is preferred.  The current names from the 
patchset are:

kunit-test.ko		- tests for kunit itself
kunit-example-test.ko	- example test using the kunit framework
sysctl-test.ko		- sysctl kunit tests
list-test.ko		- list kunit tests
ext4-inode-test.ko	- ext4 kunit tests
 
> It is a valid point that test-test or example-test are too general of
> names for modules, but if this is the case, I think that inode-test is
> probably too general as well. But if we are going that far, maybe we
> should rename everything *-kunit-test.c.
> 

Yep, I figured inode-test.ko was too general also, so the Makefile 
builds ext4-inode-test.ko from inode-test.c. See fs/ext4/Makefile.

Thanks!

Alan

  reply	other threads:[~2019-11-20 13:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15 10:16 [PATCH v4 linux-kselftest-test 0/6] kunit: support building core/tests as modules Alan Maguire
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 1/6] kunit: move string-stream.h to lib/kunit Alan Maguire
2019-11-17  1:33   ` Stephen Boyd
2019-11-19 18:36     ` Brendan Higgins
2019-11-19 18:39   ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 2/6] kunit: hide unexported try-catch interface in try-catch-impl.h Alan Maguire
2019-11-17  1:36   ` Stephen Boyd
2019-11-18 17:30     ` Alan Maguire
2019-11-19 18:48   ` Brendan Higgins
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 3/6] kunit: allow kunit tests to be loaded as a module Alan Maguire
2019-11-19 19:16   ` Brendan Higgins
2019-11-20 13:56     ` Alan Maguire [this message]
2019-11-19 21:05   ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 4/6] kunit: remove timeout dependence on sysctl_hung_task_timeout_seconds Alan Maguire
2019-11-18 22:09   ` Luis Chamberlain
2019-11-19  1:24     ` Brendan Higgins
2019-11-19 21:06   ` Stephen Boyd
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 5/6] kunit: allow kunit to be loaded as a module Alan Maguire
2019-11-19 21:13   ` Stephen Boyd
2019-11-20 13:46     ` Alan Maguire
2019-11-15 10:16 ` [PATCH v4 linux-kselftest-test 6/6] kunit: update documentation to describe module-based build Alan Maguire
2019-11-19 21:15   ` Stephen Boyd

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=alpine.LRH.2.20.1911201347190.19458@dhcp-10-175-162-125.vpn.oracle.com \
    --to=alan.maguire@oracle.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=brendanhiggins@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=davidgow@google.com \
    --cc=joe.lawrence@redhat.com \
    --cc=keescook@chromium.org \
    --cc=knut.omang@oracle.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sboyd@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tytso@mit.edu \
    --cc=urezki@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    --cc=yzaikin@google.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;
as well as URLs for NNTP newsgroup(s).