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 FreeBSD Test Suite
38 Test Suite provides a collection of automated tests for two major purposes.
39 On one hand, the test suite aids
41 to detect bugs and regressions when they modify the source tree. On the other
44 (and, in particular, system administrators) to verify that fresh installations
47 operating system behave correctly on their hardware platform and also to ensure
48 that the system does not suffer from regressions during regular operation and
53 Test Suite can be found in the
57 This manual page describes how to run the test suite and how to configure
58 some of its optional features.
59 .Ss Installing the test suite
60 The test suite is not yet installed by default as part of
62 but this is bound to change during the development of
67 directory is missing, then you will have to enable the build of the test
68 suite, rebuild your system and install the results.
69 You can do so by setting
76 and rebuilding the system as described in
78 .Ss When to run the tests?
79 Before diving into the details of how to run the test suite, here are some
80 scenarios in which you should run it:
81 .Bl -bullet -offset indent
83 After a fresh installation of
85 to ensure that the system works correctly on your hardware platform.
89 to a different version to ensure that the new code works well on your
90 hardware platform and that the upgrade did not introduce regressions in your
93 After modifying the source tree to detect any new bugs and/or regressions.
95 Periodically, maybe from a
97 job, to ensure that any changes to the system (such as the installation of
98 third-party packages or manual modifications to configuration files) do not
99 introduce unexpected failures.
101 .Ss Running the tests
102 First, you will need to install the
106 Then use the following command to run the whole test suite:
107 .Bd -literal -offset indent
108 $ kyua test -k /usr/tests/Kyuafile
111 The above will iterate through all test programs in
113 recursively, execute them, store their results and debugging data in Kyua's
114 database (by default in
115 .Pa ~/.kyua/store.db ) ,
116 and print a summary of the results.
117 This summary includes a brief count of all total tests run and how many of
120 It is possible to restrict which tests to run by providing their names in
122 For example, this would execute the tests for the
127 .Bd -literal -offset indent
128 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
130 .Ss Obtaining reports of the tests execution
131 Additional information about the test results can be retrieved
132 by using Kyua's various reporting commands.
133 For example, the following would print a plain-text report of the executed
134 tests and show which ones failed:
135 .Bd -literal -offset indent
139 This example would generate an HTML report ready to be published on a
141 .Bd -literal -offset indent
142 $ kyua report-html --output ~/public_html/tests
145 For further details on the command-line interface of Kyua, please refer
148 .Ss Configuring the tests
149 Some test cases in the
151 Test Suite require manual configuration by the administrator before they can be
152 run. Unless certain properties are defined, the tests that require them will
155 Test suites are configured by defining their configuration
157 .Pa /usr/local/etc/kyua/kyua.conf .
158 The format of this file is detailed in
161 The following configuration variables are available in the
164 .Bl -tag -width "allow_sysctl_side_effects"
165 .It allow_devfs_side_effects
166 If defined, enables tests that may destroy and recreate semipermanent device
167 nodes, like disk devices. Without this variable, tests may still create and
168 destroy devices nodes that are normally transient, like /dev/tap* and
169 /dev/pts*, as long as they clean them up afterwards. However, tests that
170 require this variable have a relaxed cleanup requirement; they must recreate
171 any devices that they destroyed, but not necessarily with the same devnames.
172 .It allow_sysctl_side_effects
173 Enables tests that change globally significant
175 variables. The tests will undo any changes in their cleanup phases.
177 Must be set to a space delimited list of disk device nodes. Tests that need
178 destructive access to disks must use these devices. Tests are not required to
179 preserve any data present on these disks.
181 Must be set to a space delimited list of FIBs (routing tables). Tests that
182 need to modify a routing table may use any of these. Tests will cleanup any
183 new routes that they create.
185 .Ss What to do if something fails?
188 during the execution of the test suite, please consider reporting it to the
190 developers so that the failure can be analyzed and fixed.
191 To do so, either send a message to the appropriate mailing list or file a
193 For more details please refer to:
194 .Bl -bullet -offset indent -compact
196 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
198 .Lk http://www.freebsd.org/support.html "Problem Reporting"
201 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
202 .It Pa /usr/local/etc/kyua/kyua.conf
203 System-wide configuration file for
205 .It Pa ~/.kyua/kyua.conf
206 User-specific configuration file for
208 overrides the system file.
209 .It Pa ~/.kyua/store.db
210 Default result database used by Kyua.
215 .It Pa /usr/tests/Kyuafile
216 Top-level test suite definition file.
224 Test Suite first appeared in
229 manual page first appeared in
231 and was later ported to
234 .An Julio Merino Aq Mt jmmv@FreeBSD.org