Tuesday, September 05, 2006

kauth(9) regression test framework

Seeing as this year's SoC is over I've been spending some time working on a project for Netbsd. As some of you may know, Elad Efrat has been working on a new authorization model for the NetBSD kernel, kauth(9). It's based on the kauth framework from MacOSX and it's my job to help Ober to produce a regression test framework to ensure that the transition from a traditional security model (refered to in literature as "bsd44") has no adverse side-effects (such as allowing a non-superuser to reboot the system) because the kauth framework hasn't implemented something properly. I won't discuss how the framework works here, refer to the kauth(9) man page for more details and the kernel authorization technical note from apple here.

The real purpose of this blog entry is to stress the need for regression tests in every project :P The regression framework and tests are written in Python as I found it the quickest language to write designs up in. I wrote the framework in two days and began implementing the tests and running them with a kernel that had Elad's patches compiled in. Within a few runs we'd found bugs in Elad's implementation and in fact, in the NetBSD date(1) command. This bug in the date(1) had been around for years and no one had ever reported it before. These tests have been invaluable and it still fails to amaze me how important good regression tests are to the success of a project, especially when you're implementing new policies or changing existing implementations of interfaces. The tests are also adaptable for different models.

Everyone write unit tests ;-)

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]