ATF-devel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Only userland?



On Feb 3, 2008, at 12:49 PM, Martin Kulas wrote:

Hello!

Hello Martin,

I have just glanced over the ATF home page and have looked
at the examples.  Do I see it correctly that ATF only
tests userland code?  Or is it possible to test code
that is written for the kernel?

ATF just provides (at the moment) some libraries to simplify the writing of test cases and some tools to run them. The way it is now, yes, the test cases always run in userland at the moment.

Testing of the kernel can be done indirectly from userland. We are currently doing this for some (few, yet) file system and networking tests in NetBSD, but the old tests (not converted to ATF) that are in the tree are all also "userland-based". In the case of NetBSD you can also use puffs, pud, rump or NetBSD/usermode to simplify things.

There are plans to simplify the usage of all these features and, more specifically, to allow the remote execution (inside a VM, for example) of tests that can crash the machine. (Because those userland tests for kernel features may trigger regressions that cause immediate panics, for example.)

For example,  I have some custom functions which manipulate
mbuf(9) structures.  Is it possible to use ATF in order to
write tests for my custom functions which run in kernel space?
Of course, I could write tests for my custom functions in userland
but then I have to rewrite all mbuf{} functions that the kernel
provides.

I am interested to know what you would need in ATF to be able to do that (i.e., the "write tests for my custom functions which run in kernel space" part). The way I see it, you should either write a kernel module with the testing code, load it, get the results (or crash), and unload it (which you can already do with ATF, but manually). Or you'd just recompile the code as a userland binary and use it in the tests (as NetBSD's rump allows). Or... your approach? :-)

Thanks.



Home | Main Index | Thread Index | Old Index