Unit Tests for FreeBSD Kernel APIs?
John Baldwin
jhb at freebsd.org
Fri Jun 24 13:26:34 UTC 2011
On Friday, June 24, 2011 3:23:11 am Sebastian Huber wrote:
> Hello,
>
> exists there some unit tests for FreeBSD kernel APIs, e.g. mutex(9),
> condvar(9), etc.?
>
> Have a nice day!
Hmm, I have a kernel module that does some tests, but it is not in the tree.
One of the issues is that many of the tests you want to do for some of these
APIs involve timing. For rwlocks, for example, I used KTR traces and used
a kernel module that forked 4 threads to all compete over a single lock. I
then verified via KTR traces that every branch was taken (and made liberal
use of KASSERT()s which caught a few edge cases I had missed initially).
--
John Baldwin
More information about the freebsd-hackers
mailing list