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 .Ss Installing the test suite
62 The test suite is not yet installed by default as part of
64 but this is bound to change during the development of
69 directory is missing, then you will have to enable the build of the test
70 suite, rebuild your system and install the results.
71 You can do so by setting
78 and rebuilding the system as described in
80 .Ss When to run the tests?
81 Before diving into the details of how to run the test suite, here are some
82 scenarios in which you should run it:
83 .Bl -bullet -offset indent
85 After a fresh installation of
87 to ensure that the system works correctly on your hardware platform.
91 to a different version to ensure that the new code works well on your
92 hardware platform and that the upgrade did not introduce regressions in your
95 After modifying the source tree to detect any new bugs and/or regressions.
97 Periodically, maybe from a
99 job, to ensure that any changes to the system (such as the installation of
100 third-party packages or manual modifications to configuration files) do not
101 introduce unexpected failures.
103 .Ss Running the tests
104 First, you will need to install the
108 Then use the following command to run the whole test suite:
109 .Bd -literal -offset indent
110 $ kyua test -k /usr/tests/Kyuafile
113 The above will iterate through all test programs in
115 recursively, execute them, store their results and debugging data in Kyua's
116 database (by default in
117 .Pa ~/.kyua/store.db ) ,
118 and print a summary of the results.
119 This summary includes a brief count of all total tests run and how many of
122 It is possible to restrict which tests to run by providing their names in
124 For example, this would execute the tests for the
129 .Bd -literal -offset indent
130 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
132 .Ss Obtaining reports of the tests execution
133 Additional information about the test results can be retrieved
134 by using Kyua's various reporting commands.
135 For example, the following would print a plain-text report of the executed
136 tests and show which ones failed:
137 .Bd -literal -offset indent
141 This example would generate an HTML report ready to be published on a
143 .Bd -literal -offset indent
144 $ kyua report-html --output ~/public_html/tests
147 For further details on the command-line interface of Kyua, please refer
150 .Ss Configuring the tests
151 Some test cases in the
153 Test Suite require manual configuration by the administrator before they can be
155 Unless certain properties are defined, the tests that require them will be
158 Test suites are configured by defining their configuration
160 .Pa /usr/local/etc/kyua/kyua.conf .
161 The format of this file is detailed in
164 The following configuration variables are available in the
167 .Bl -tag -width "allow_sysctl_side_effects"
168 .It allow_devfs_side_effects
169 If defined, enables tests that may destroy and recreate semipermanent device
170 nodes, like disk devices.
171 Without this variable, tests may still create and destroy devices nodes that
172 are normally transient, like /dev/tap* and /dev/pts*, as long as they clean
174 However, tests that require this variable have a relaxed cleanup requirement;
175 they must recreate any devices that they destroyed, but not necessarily with
177 .It allow_sysctl_side_effects
178 Enables tests that change globally significant
181 The tests will undo any changes in their cleanup phases.
183 Must be set to a space delimited list of disk device nodes.
184 Tests that need destructive access to disks must use these devices.
185 Tests are not required to preserve any data present on these disks.
187 Must be set to a space delimited list of FIBs (routing tables).
188 Tests that need to modify a routing table may use any of these.
189 Tests will cleanup any new routes that they create.
191 .Ss What to do if something fails?
194 during the execution of the test suite, please consider reporting it to the
196 developers so that the failure can be analyzed and fixed.
197 To do so, either send a message to the appropriate mailing list or file a
199 For more details please refer to:
200 .Bl -bullet -offset indent -compact
202 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
204 .Lk http://www.freebsd.org/support.html "Problem Reporting"
207 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
208 .It Pa /usr/local/etc/kyua/kyua.conf
209 System-wide configuration file for
211 .It Pa ~/.kyua/kyua.conf
212 User-specific configuration file for
214 overrides the system file.
215 .It Pa ~/.kyua/store.db
216 Default result database used by Kyua.
221 .It Pa /usr/tests/Kyuafile
222 Top-level test suite definition file.
230 Test Suite first appeared in
235 manual page first appeared in
237 and was later ported to
240 .An Julio Merino Aq Mt jmmv@FreeBSD.org