]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - share/man/man7/tests.7
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / share / man / man7 / tests.7
1 .\"     $FreeBSD$
2 .\"     $NetBSD: tests.kyua.7,v 1.2 2013/07/20 21:39:59 wiz Exp $
3 .\"
4 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
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.
15 .\"
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.
28 .\"
29 .Dd April 13, 2014
30 .Dt TESTS 7
31 .Os
32 .Sh NAME
33 .Nm tests
34 .Nd introduction to the FreeBSD Test Suite
35 .Sh DESCRIPTION
36 The
37 .Fx
38 Test Suite provides a collection of automated tests for two major purposes.
39 On one hand, the test suite aids
40 .Em developers
41 to detect bugs and regressions when they modify the source tree.  On the other
42 hand, it allows
43 .Em end users
44 (and, in particular, system administrators) to verify that fresh installations
45 of the
46 .Fx
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
49 maintenance.
50 .Pp
51 The
52 .Fx
53 Test Suite can be found in the
54 .Pa /usr/tests
55 hierarchy.
56 .Pp
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
61 .Fx ,
62 but this is bound to change during the development of
63 .Fx 11.0 .
64 .Pp
65 If the
66 .Pa /usr/tests
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
70 .Sq WITH_TESTS=yes
71 in your
72 .Pa /etc/src.conf
73 file (see
74 .Xr src.conf 5
75 for details)
76 and rebuilding the system as described in
77 .Xr build 7 .
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
82 .It
83 After a fresh installation of
84 .Fx
85 to ensure that the system works correctly on your hardware platform.
86 .It
87 After an upgrade of
88 .Fx
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
91 configuration.
92 .It
93 After modifying the source tree to detect any new bugs and/or regressions.
94 .It
95 Periodically, maybe from a
96 .Xr cron 8
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.
100 .El
101 .Ss Running the tests
102 First, you will need to install the
103 .Sq devel/kyua
104 package from
105 .Xr ports 7 .
106 Then use the following command to run the whole test suite:
107 .Bd -literal -offset indent
108 $ kyua test -k /usr/tests/Kyuafile
109 .Ed
110 .Pp
111 The above will iterate through all test programs in
112 .Pa /usr/tests
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
118 them failed.
119 .Pp
120 It is possible to restrict which tests to run by providing their names in
121 the command line.
122 For example, this would execute the tests for the
123 .Xr cp 1
124 and
125 .Xr cut 1
126 utilities:
127 .Bd -literal -offset indent
128 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
129 .Ed
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
136 $ kyua report
137 .Ed
138 .Pp
139 This example would generate an HTML report ready to be published on a
140 web server:
141 .Bd -literal -offset indent
142 $ kyua report-html --output ~/public_html/tests
143 .Ed
144 .Pp
145 For further details on the command-line interface of Kyua, please refer
146 to its manual page
147 .Xr kyua 1 .
148 .Ss Configuring the tests
149 Some test cases in the
150 .Fx
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
153 be skipped.
154 .Pp
155 Test suites are configured by defining their configuration
156 variables in
157 .Pa /usr/local/etc/kyua/kyua.conf .
158 The format of this file is detailed in
159 .Xr kyua.conf 5 .
160 .Pp
161 The following configuration variables are available in the
162 .Fx
163 Test Suite:
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
174 .Xr sysctl 8
175 variables.  The tests will undo any changes in their cleanup phases.
176 .It disks
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.
180 .It fibs
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.
184 .El
185 .Ss What to do if something fails?
186 If there is
187 .Em any failure
188 during the execution of the test suite, please consider reporting it to the
189 .Fx
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
192 problem report.
193 For more details please refer to:
194 .Bl -bullet -offset indent -compact
195 .It
196 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
197 .It
198 .Lk http://www.freebsd.org/support.html "Problem Reporting"
199 .El
200 .Sh FILES
201 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
202 .It Pa /usr/local/etc/kyua/kyua.conf
203 System-wide configuration file for
204 .Xr kyua 1 .
205 .It Pa ~/.kyua/kyua.conf
206 User-specific configuration file for
207 .Xr kyua 1 ;
208 overrides the system file.
209 .It Pa ~/.kyua/store.db
210 Default result database used by Kyua.
211 .It Pa /usr/tests/
212 Location of the
213 .Fx
214 Test Suite.
215 .It Pa /usr/tests/Kyuafile
216 Top-level test suite definition file.
217 .El
218 .Sh SEE ALSO
219 .Xr kyua 1 ,
220 .Xr build 7
221 .Sh HISTORY
222 The
223 .Fx
224 Test Suite first appeared in
225 .Fx 10.1 .
226 .Pp
227 The
228 .Nm
229 manual page first appeared in
230 .Nx 6.0
231 and was later ported to
232 .Fx 10.1 .
233 .Sh AUTHORS
234 .An Julio Merino Aq Mt jmmv@FreeBSD.org