TESTS(7)
π TESTS(7) β the NetBSD test suite, explained by your resident Unix bestie π
okay so this is TESTS(7), a page from the Miscellaneous Information Manual, and it's literally the glow-up guide to the NetBSD test suite. think of it as the group chat where your OS tells you whether it's actually okay or just pretending. π«Ά
β¨ NAME β¨
tests β the intro to the NetBSD test suite, no cap.
πΈ DESCRIPTION πΈ
the NetBSD test suite is a whole collection of automated tests and it exists for two big reasons, both iconic:
- it helps developers catch bugs and regressions in the code while they're out here modifying the source tree π
- it lets end users (especially system admins, the main characters) verify that a fresh install of NetBSD actually behaves correctly on their hardware platform, and also make sure the system doesn't suffer from regressions during regular system operation and maintenance β¨
the NetBSD test suite ships as its own separate installation set called tests.tgz, and all the test programs get installed under the /usr/tests hierarchy. periodt.
this manual page tells you how to execute the test suite and how to configure some of its optional features. that's it, that's the vibe.
π¦ When to run the tests? π¦
before we dive into the details of running the suite, here are the scenarios where you should be running them, bestie:
- after a fresh installation of NetBSD, to make sure the system works correctly on your hardware platform π
- after an upgrade of NetBSD to a different version, to make sure the new code works well on your hardware platform and that the upgrade didn't introduce regressions in your configuration π₯
- after performing changes to the source tree, to catch any bugs and/or regressions introduced by the modifications π
- periodically, maybe from a
cron(8)job, to make sure any changes to the system (like installing third-party packages or manually editing config files) don't sneak in unexpected failures π
π Installing the tests π
if you chose to install the tests.tgz distribution set while setting up your NetBSD system, the tests are already available in /usr/tests. slay, you're done.
otherwise, install the set now by running:
# cd /
# tar xzpf /path/to/tests.tgz
π Running the tests π
use this command to run the whole entire test suite:
$ kyua test -k /usr/tests/Kyuafile
the above will go through all test programs in /usr/tests recursively, execute them, store their results and debugging data in the Kyua database (by default in ~/.kyua/store.db), and print a summary of the results. that summary includes a brief count of all total tests run and how many of them failed. it's giving report card energy π
and you can restrict which tests to run by providing their names on the command line. for example, this would execute the tests for the cp(1) and cut(1) utilities:
$ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
β Obtaining reports of the tests execution β
later on you can pull additional info about the results out of the database using the various reporting commands of Kyua. for example, this extracts a plain-text report of the executed tests and shows which ones failed:
$ kyua report
and this other example generates an HTML report ready to be published on a web server β possibly the built-in httpd(8):
$ kyua report-html --output ~/public_html/tests
for further details on the command-line interface of Kyua, please refer to its manual page kyua(1). iykyk. π
π§ Test environment considerations π§
tests can be invoked as an unprivileged user, in which case tests that require privileges will be skipped. if run as root, an unprivileged user will be used for tests that do not require privileges. for maximal coverage, the standard approach is to invoke tests as root. π
ideally tests are self-contained and don't either depend on or perturb the host environment β aside from skipping tests when optional facilities aren't available. in reality? tests load and unload modules and do other things that might cause problems. so:
while it's not entirely safe to run tests on a multi-user system, permanent problems or crashes from doing so are viewed as bugs and should be reported. don't just sit with it, tell someone. π«Ά
π Configuring the tests π
some test cases in the NetBSD test suite require the administrator to manually set up some configuration properties before they can run. unless these properties are defined, the tests that require them will be marked as skipped and thus they will not be really executed. π
test suites are configured by defining the values to their configuration variables in /etc/kyua/kyua.conf. the format of this file is detailed in kyua.conf(5).
the following configuration variables are available in the NetBSD test suite:
fstypeβ when set to a filesystem type, restrict tests programs from the/usr/tests/fs/vfs/.
π What to do if something fails? π
if there's any failure during the execution of the test suite, please consider reporting it to the NetBSD developers so the failure can be analyzed and fixed. to do so, either send a message to the appropriate mailing list or file a problem report. for more details please refer to:
- NetBSD mailing lists:
https://www.netbsd.org/mailinglists/ - NetBSD Problem Reports:
https://www.netbsd.org/support/send-pr.html
π FILES π
/etc/kyua/kyua.confβ system-wide configuration file forkyua(1).~/.kyua/kyua.confβ user-specific configuration file forkyua(1); overrides the system file.~/.kyua/store.dbβ default database used by Kyua to maintain the data of the executed tests./usr/tests/β location of the NetBSD test suite./usr/tests/Kyuafileβ top-level test suite definition file.
π SEE ALSO π
kyua(1), kyua-report(1), kyua-test(1)
π HISTORY π
the collection of test programs in /usr/tests first appeared in NetBSD 5.0 and has been growing since then. glow-up era. β¨
the tests manual page first appeared in NetBSD 6.0 and was updated in NetBSD 7.0 to describe the execution of the tests with Kyua rather than with ATF.
the ATF testing framework was first distributed with NetBSD 5.0, and the runtime tools of this framework are being phased out in NetBSD 7.0. note that the libraries that ship with ATF are still in active use and are not deprecated β so don't come for them. π
the Kyua testing toolkit was first distributed with NetBSD 7.0. the atf-run(1) and atf-report(1) tools were replaced as part of this import, becoming backwards-compatibility wrappers around kyua(1).
π AUTHORS π
Julio Merino <jmmv@NetBSD.org> β thank you for your service, king π«Ά
okay that's the whole page, bestie β go run your tests and hydrate!! π¦β¨
this page came from the Debian build of the manual, dated July 29, 2015, and it's the TESTS(7) page closing out here. mwah π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2010 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms