]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - share/man/man7/tests.7
MFC r315789:
[FreeBSD/stable/10.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 March 22, 2017
30 .Dt TESTS 7
31 .Os
32 .Sh NAME
33 .Nm tests
34 .Nd introduction to the
35 .Fx
36 Test Suite
37 .Sh DESCRIPTION
38 The
39 .Fx
40 Test Suite provides a collection of automated tests for two major purposes.
41 On one hand, the test suite aids
42 .Em developers
43 to detect bugs and regressions when they modify the source tree.
44 On the other hand, it allows
45 .Em end users
46 (and, in particular, system administrators) to verify that fresh installations
47 of the
48 .Fx
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
51 maintenance.
52 .Pp
53 The
54 .Fx
55 Test Suite can be found in the
56 .Pa /usr/tests
57 hierarchy.
58 .Pp
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
63 .Fx ,
64 but this is bound to change during the development of
65 .Fx 11.0 .
66 .Pp
67 If the
68 .Pa /usr/tests
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
72 .Sq WITH_TESTS=yes
73 in your
74 .Pa /etc/src.conf
75 file (see
76 .Xr src.conf 5
77 for details)
78 and rebuilding the system as described in
79 .Xr build 7 .
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
84 .It
85 After a fresh installation of
86 .Fx
87 to ensure that the system works correctly on your hardware platform.
88 .It
89 After an upgrade of
90 .Fx
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
93 configuration.
94 .It
95 After modifying the source tree to detect any new bugs and/or regressions.
96 .It
97 Periodically, maybe from a
98 .Xr cron 8
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.
102 .El
103 .Ss Running the tests
104 First, you will need to install the
105 .Sq devel/kyua
106 package from
107 .Xr ports 7 .
108 Then use the following command to run the whole test suite:
109 .Bd -literal -offset indent
110 $ kyua test -k /usr/tests/Kyuafile
111 .Ed
112 .Pp
113 The above will iterate through all test programs in
114 .Pa /usr/tests
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
120 them failed.
121 .Pp
122 It is possible to restrict which tests to run by providing their names in
123 the command line.
124 For example, this would execute the tests for the
125 .Xr cp 1
126 and
127 .Xr cut 1
128 utilities:
129 .Bd -literal -offset indent
130 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
131 .Ed
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
138 $ kyua report
139 .Ed
140 .Pp
141 This example would generate an HTML report ready to be published on a
142 web server:
143 .Bd -literal -offset indent
144 $ kyua report-html --output ~/public_html/tests
145 .Ed
146 .Pp
147 For further details on the command-line interface of Kyua, please refer
148 to its manual page
149 .Xr kyua 1 .
150 .Ss Configuring the tests
151 Some test cases in the
152 .Fx
153 Test Suite require manual configuration by the administrator before they can be
154 run.
155 Unless certain properties are defined, the tests that require them will be
156 skipped.
157 .Pp
158 Test suites are configured by defining their configuration
159 variables in
160 .Pa /usr/local/etc/kyua/kyua.conf .
161 The format of this file is detailed in
162 .Xr kyua.conf 5 .
163 .Pp
164 The following configuration variables are available in the
165 .Fx
166 Test Suite:
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
173 them up afterwards.
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
176 the same devnames.
177 .It allow_sysctl_side_effects
178 Enables tests that change globally significant
179 .Xr sysctl 8
180 variables.
181 The tests will undo any changes in their cleanup phases.
182 .It disks
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.
186 .It fibs
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.
190 .El
191 .Ss What to do if something fails?
192 If there is
193 .Em any failure
194 during the execution of the test suite, please consider reporting it to the
195 .Fx
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
198 problem report.
199 For more details please refer to:
200 .Bl -bullet -offset indent -compact
201 .It
202 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
203 .It
204 .Lk http://www.freebsd.org/support.html "Problem Reporting"
205 .El
206 .Sh FILES
207 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
208 .It Pa /usr/local/etc/kyua/kyua.conf
209 System-wide configuration file for
210 .Xr kyua 1 .
211 .It Pa ~/.kyua/kyua.conf
212 User-specific configuration file for
213 .Xr kyua 1 ;
214 overrides the system file.
215 .It Pa ~/.kyua/store.db
216 Default result database used by Kyua.
217 .It Pa /usr/tests/
218 Location of the
219 .Fx
220 Test Suite.
221 .It Pa /usr/tests/Kyuafile
222 Top-level test suite definition file.
223 .El
224 .Sh SEE ALSO
225 .Xr kyua 1 ,
226 .Xr build 7
227 .Sh HISTORY
228 The
229 .Fx
230 Test Suite first appeared in
231 .Fx 10.1 .
232 .Pp
233 The
234 .Nm
235 manual page first appeared in
236 .Nx 6.0
237 and was later ported to
238 .Fx 10.1 .
239 .Sh AUTHORS
240 .An Julio Merino Aq Mt jmmv@FreeBSD.org