TESTS(7) | Miscellaneous Information Manual | TESTS(7) |
The NetBSD tests are implemented using the Automated Testing Framework (ATF), a third-party package shipped with NetBSD; see atf(7) for details. The NetBSD test suite is distributed as a separate installation set, named tests.tgz, and the test programs are all installed under the /usr/tests hierarchy.
This manual page describes how to execute the test suite and how to configure some of its optional features.
# cd / # tar xzpf /path/to/tests.tgz
$ cd /usr/tests $ atf-run | atf-report
The above will go through all test programs in /usr/tests recursively, execute them, and, at the very end, show a report of the results of the test suite. These results include the count of tests that succeeded (passed), the names of the tests that failed, and the count of the tests that were not executed (skipped) because the system configuration did not meet their requirements.
If you are interested in saving the whole output of the test suite execution so that you can later investigate failures, use the following idiom instead:
$ cd /usr/tests $ atf-run | tee ~/tests.log | atf-report
The above command will save the raw output of the test suite in ~/tests.log, which you can later inspect manually to look for failures. Note that the file contains a copy of the ‘stdout' and ‘stderr' of each test case, which becomes valuable during debugging.
It is also possible to restrict which tests to execute so that only a small subsystem is tested; see atf-run(1) for details. Additionally, it is also possible to run the test programs themselves by hand; see atf-test-program(1) for more details, but be aware that you should only be doing this if you are debugging failing tests.
Each test suite is configured through a separate file that lives under /etc/atf/ and that carries the name of the test suite. Henceforth, to configure the properties that affect the execution of the NetBSD test suite, you need to edit /etc/atf/NetBSD.conf. The suite-specific configuration file implicitly depends on /etc/atf/common.conf, which contains properties shared among all test suites. These files conform to the configuration file format described in atf-formats(5).
The following configuration variables are available in the NetBSD test suite:
The ATF testing framework was first distributed with NetBSD 5.0 and the collection of test programs in /usr/tests has been growing since then.
August 5, 2011 | NetBSD 6.1 |