Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jul 2014 18:45:12 -0700
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        Julio Merino <jmmv@freebsd.org>
Cc:        "freebsd-testing@freebsd.org" <freebsd-testing@freebsd.org>
Subject:   Re: Location of test kernel drivers in tree?
Message-ID:  <CAGHfRMAhfC7bi8ApX66ZyiYOSJYJJiaBvDszFzGPy5TFgQnJRg@mail.gmail.com>
In-Reply-To: <CAFY7cWAhieTAxjwE=mEq9pn9BAsjTwqfPTgh5fPDSAVK0U9TGw@mail.gmail.com>
References:  <CAGHfRMC==6WRKwd13R7Yyjyu%2B_Oi_173TLTXPVk9ynH0G5qqxg@mail.gmail.com> <CAFY7cWCR_bUjm4KSLow85%2BeshTgDVzPCF5iJVS0rb37Lh7zGWQ@mail.gmail.com> <CAGHfRMCWJXi82AQA_vgWUkjWGXc86subB_0u18R9MgAnXfo_pQ@mail.gmail.com> <CAFY7cWAhieTAxjwE=mEq9pn9BAsjTwqfPTgh5fPDSAVK0U9TGw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 23, 2014 at 6:29 PM, Julio Merino <jmmv@freebsd.org> wrote:
> On Wed, Jul 23, 2014 at 9:20 PM, Garrett Cooper <yaneurabeya@gmail.com> wrote:
>>
>> I was thinking of sys/tests (with associated build machinery under
>> sys/modules/tests) because the kernel and world [*] build vary wildly
>> by design.
>
> But didn't we decide a while ago that we'd put kernel tests in
> tests/sys/ precisely to avoid the build system "oddities" of the
> kernel?  That's where the few kernel-level tests that we have today
> live...

Correct (and I have more in isilon-atf and there are more at Isilon
that need to be upstreamed :)..).

> Or am I misunderstanding?  Because if you originally said that you'd
> put _only_ the test-related kernel modules in sys/..., then I guess
> that makes sense!

Yup! That's what I was thinking of doing. I was kind of envisioning
the following:

sys/modules/tests/memguard/Makefile - This will be the makefile that
handles compiling the test kernel module(s) (it might need to be
nested a bit if there are multiple modules because I don't remember if
bsd.kmod.mk can build multiple modules from one Makefile)
sys/tests/memguard/ - this will be where the source for the memguard
test module(s) lives
tests/sys/memguard/ - this will be where the memguard test scripts live

This layout does the following:
1. Makes it clear where the test code lives (helps make things more intuitive).
2. Follows the existing model with kernel code (to some degree).
3. Makes it easy to disable/skip the tests with MK_TESTS (ease of
maintenance/use).

The only catch is that we really need to "grow" some additional
infrastructure around ATF/kyua on FreeBSD to detect when modules are
present/loaded/etc to set that as requirements for tests to avoid
sprinkling bits everywhere in test code to skip tests if the helper
programs or modules aren't present. I already started that to some
degree (I mentioned that in another freebsd-testing thread), but it
needs more work (mostly because what I did works for simple cases but
there are some things I potentially missed dealing with how drivers
are named, etc):
https://github.com/yaneurabeya/freebsd_atf_kyua_test_extensions .
Alan's helped out with an initial pass at reviewing the code.

Thoughts?

Thanks!
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGHfRMAhfC7bi8ApX66ZyiYOSJYJJiaBvDszFzGPy5TFgQnJRg>