Location of test kernel drivers in tree?

Garrett Cooper yaneurabeya at gmail.com
Thu Jul 24 01:20:41 UTC 2014


On Wed, Jul 23, 2014 at 6:11 PM, Julio Merino <jmmv at freebsd.org> wrote:
> On Tue, Jul 22, 2014 at 7:07 PM, Garrett Cooper <yaneurabeya at gmail.com> wrote:
>> Hi all,
>>     I need to do some KPI verification and hook that into ATF / kyua.
>> Since we don't have RUMP [yet] from NetBSD, I would typically write a
>> simple, one-off test driver, hook it into the kernel build and have a
>> piece of C or shell code that pokes directly at the driver to get
>> access to kernel interfaces.
>>     I was wondering if it made sense to put all test drivers into
>> sys/tests/<module-name>/..., e.g.
>> sys/tests/test_memguard/{Makefile,test_memguard.c}, etc. Is there an
>> alternative approach that others use to solve this problem?
>
> I don't have an answer to alternative solutions, but keeping the
> helper modules inside tests/sys/ (I think you got that backwards in
> your email?) is a good idea.

I was thinking of sys/tests (with associated build machinery under
sys/modules/tests) because the kernel and world [*] build vary wildly
by design.

> (Instead of tests/sys/<module-name>/, I'd probably do
> tests/sys/<thing-being-tested>/<module-name>/... though, to keep the
> helpers next to the only tests that need them. Unless the helper is
> really generic and usable by many tests.)

Most definitely!

Thanks :)!!
-Garrett

* There's MODULES_WITH_WORLD [see make.conf(5)], which is off by
default, so technically modules can be built with world, but I'm not
sure how well it works when you have to have to use opt_* headers.


More information about the freebsd-testing mailing list