2 .\" $NetBSD: tests.kyua.7,v 1.2 2013/07/20 21:39:59 wiz Exp $
4 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 .\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 .\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 .Nd introduction to the
40 Test Suite provides a collection of automated tests for two major purposes.
41 On one hand, the test suite aids
43 to detect bugs and regressions when they modify the source tree.
44 On the other hand, it allows
46 (and, in particular, system administrators) to verify that fresh installations
49 operating system behave correctly on their hardware platform and also to ensure
50 that the system does not suffer from regressions during regular operation and
55 Test Suite can be found in the
59 This manual page describes how to run the test suite and how to configure
60 some of its optional features.
61 For information on writing the tests, see
63 .Ss Installing the test suite
66 directory is missing, then you will have to enable the build of the test
67 suite, rebuild your system and install the results.
68 You can do so by setting
75 and rebuilding the system as described in
77 .Ss When to run the tests?
78 Before diving into the details of how to run the test suite, here are some
79 scenarios in which you should run it:
80 .Bl -bullet -offset indent
82 After a fresh installation of
84 to ensure that the system works correctly on your hardware platform.
88 to a different version to ensure that the new code works well on your
89 hardware platform and that the upgrade did not introduce regressions in your
92 After modifying the source tree to detect any new bugs and/or regressions.
94 Periodically, maybe from a
96 job, to ensure that any changes to the system (such as the installation of
97 third-party packages or manual modifications to configuration files) do not
98 introduce unexpected failures.
100 .Ss Running the tests
101 Use the following command to run the whole test suite:
102 .Bd -literal -offset indent
103 $ kyua test -k /usr/tests/Kyuafile
106 The above will iterate through all test programs in
108 recursively, execute them, store their results and debugging data in Kyua's
109 database (by default in
110 .Pa ~/.kyua/store.db ) ,
111 and print a summary of the results.
112 This summary includes a brief count of all total tests run and how many of
115 It is possible to restrict which tests to run by providing their names in
117 For example, this would execute the tests for the
122 .Bd -literal -offset indent
123 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
125 .Ss Obtaining reports of the tests execution
126 Additional information about the test results can be retrieved
127 by using Kyua's various reporting commands.
128 For example, the following would print a plain-text report of the executed
129 tests and show which ones failed:
130 .Bd -literal -offset indent
134 This example would generate an HTML report ready to be published on a
136 .Bd -literal -offset indent
137 $ kyua report-html --output ~/public_html/tests
140 For further details on the command-line interface of Kyua, please refer
143 .Ss Configuring the tests
144 Some test cases in the
146 Test Suite require manual configuration by the administrator before they can be
148 Unless certain properties are defined, the tests that require them will be
151 Test suites are configured by defining their configuration
153 .Pa /etc/kyua/kyua.conf .
154 The format of this file is detailed in
157 The following configuration variables are available in the
160 .Bl -tag -width "allow_sysctl_side_effects"
161 .It allow_devfs_side_effects
162 If defined, enables tests that may destroy and recreate semipermanent device
163 nodes, like disk devices.
164 Without this variable, tests may still create and destroy devices nodes that
165 are normally transient, like /dev/tap* and /dev/pts*, as long as they clean
167 However, tests that require this variable have a relaxed cleanup requirement;
168 they must recreate any devices that they destroyed, but not necessarily with
170 .It allow_sysctl_side_effects
171 Enables tests that change globally significant
174 The tests will undo any changes in their cleanup phases.
176 Must be set to a space delimited list of disk device nodes.
177 Tests that need destructive access to disks must use these devices.
178 Tests are not required to preserve any data present on these disks.
180 Must be set to a space delimited list of FIBs (routing tables).
181 Tests that need to modify a routing table may use any of these.
182 Tests will cleanup any new routes that they create.
184 .Ss What to do if something fails?
187 during the execution of the test suite, please consider reporting it to the
189 developers so that the failure can be analyzed and fixed.
190 To do so, either send a message to the appropriate mailing list or file a
192 For more details please refer to:
193 .Bl -bullet -offset indent -compact
195 .Lk https://lists.freebsd.org/ "FreeBSD Mailing Lists"
197 .Lk https://www.freebsd.org/support.html "Problem Reporting"
200 .Bl -tag -compact -width "/etc/kyua/kyua.conf"
201 .It Pa /etc/kyua/kyua.conf
202 System-wide configuration file for
204 .It Pa ~/.kyua/kyua.conf
205 User-specific configuration file for
207 overrides the system file.
208 .It Pa ~/.kyua/store.db
209 Default result database used by Kyua.
214 .It Pa /usr/tests/Kyuafile
215 Top-level test suite definition file.
225 Test Suite first appeared in
227 and was installed by default in
232 manual page first appeared in
234 and was later ported to
239 was imported as part of the base system in
241 previously being available only in
244 .An Julio Merino Aq Mt jmmv@FreeBSD.org