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
64 The test suite is installed by default as of
70 directory is missing, then you will have to enable the build of the test
71 suite, rebuild your system and install the results.
72 You can do so by setting
79 and rebuilding the system as described in
81 .Ss When to run the tests?
82 Before diving into the details of how to run the test suite, here are some
83 scenarios in which you should run it:
84 .Bl -bullet -offset indent
86 After a fresh installation of
88 to ensure that the system works correctly on your hardware platform.
92 to a different version to ensure that the new code works well on your
93 hardware platform and that the upgrade did not introduce regressions in your
96 After modifying the source tree to detect any new bugs and/or regressions.
98 Periodically, maybe from a
100 job, to ensure that any changes to the system (such as the installation of
101 third-party packages or manual modifications to configuration files) do not
102 introduce unexpected failures.
104 .Ss Running the tests
105 First, you will need to install the
109 Then use the following command to run the whole test suite:
110 .Bd -literal -offset indent
111 $ kyua test -k /usr/tests/Kyuafile
114 The above will iterate through all test programs in
116 recursively, execute them, store their results and debugging data in Kyua's
117 database (by default in
118 .Pa ~/.kyua/store.db ) ,
119 and print a summary of the results.
120 This summary includes a brief count of all total tests run and how many of
123 It is possible to restrict which tests to run by providing their names in
125 For example, this would execute the tests for the
130 .Bd -literal -offset indent
131 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
133 .Ss Obtaining reports of the tests execution
134 Additional information about the test results can be retrieved
135 by using Kyua's various reporting commands.
136 For example, the following would print a plain-text report of the executed
137 tests and show which ones failed:
138 .Bd -literal -offset indent
142 This example would generate an HTML report ready to be published on a
144 .Bd -literal -offset indent
145 $ kyua report-html --output ~/public_html/tests
148 For further details on the command-line interface of Kyua, please refer
151 .Ss Configuring the tests
152 Some test cases in the
154 Test Suite require manual configuration by the administrator before they can be
156 Unless certain properties are defined, the tests that require them will be
159 Test suites are configured by defining their configuration
161 .Pa /usr/local/etc/kyua/kyua.conf .
162 The format of this file is detailed in
165 The following configuration variables are available in the
168 .Bl -tag -width "allow_sysctl_side_effects"
169 .It allow_devfs_side_effects
170 If defined, enables tests that may destroy and recreate semipermanent device
171 nodes, like disk devices.
172 Without this variable, tests may still create and destroy devices nodes that
173 are normally transient, like /dev/tap* and /dev/pts*, as long as they clean
175 However, tests that require this variable have a relaxed cleanup requirement;
176 they must recreate any devices that they destroyed, but not necessarily with
178 .It allow_sysctl_side_effects
179 Enables tests that change globally significant
182 The tests will undo any changes in their cleanup phases.
184 Must be set to a space delimited list of disk device nodes.
185 Tests that need destructive access to disks must use these devices.
186 Tests are not required to preserve any data present on these disks.
188 Must be set to a space delimited list of FIBs (routing tables).
189 Tests that need to modify a routing table may use any of these.
190 Tests will cleanup any new routes that they create.
192 .Ss What to do if something fails?
195 during the execution of the test suite, please consider reporting it to the
197 developers so that the failure can be analyzed and fixed.
198 To do so, either send a message to the appropriate mailing list or file a
200 For more details please refer to:
201 .Bl -bullet -offset indent -compact
203 .Lk https://lists.freebsd.org/ "FreeBSD Mailing Lists"
205 .Lk https://www.freebsd.org/support.html "Problem Reporting"
208 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
209 .It Pa /usr/local/etc/kyua/kyua.conf
210 System-wide configuration file for
212 .It Pa ~/.kyua/kyua.conf
213 User-specific configuration file for
215 overrides the system file.
216 .It Pa ~/.kyua/store.db
217 Default result database used by Kyua.
222 .It Pa /usr/tests/Kyuafile
223 Top-level test suite definition file.
232 Test Suite first appeared in
237 manual page first appeared in
239 and was later ported to
242 .An Julio Merino Aq Mt jmmv@FreeBSD.org