]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - share/man/man7/tests.7
Set up the /usr/tests hierarchy.
[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 October 19, 2013
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 the one hand, the test suite aids
40 .Em developers
41 in catching bugs and regressions in the code when they performing modifications
42 to the source tree.
43 On the other hand, the test suite allows
44 .Em end users
45 (and, in particular, system administrators) to verify that fresh installations
46 of the
47 .Fx
48 operating system behave correctly in their hardware platform and also to ensure
49 that the system does not suffer from regressions during regular system
50 operation and maintenance.
51 .Pp
52 The
53 .Fx
54 test suite is installed under the
55 .Pa /usr/tests
56 hierarchy.
57 .Pp
58 This manual page describes how to execute the test suite and how to configure
59 some of its optional features.
60 .Ss When to run the tests?
61 Before diving into the details of how to run the test suite, here are some
62 scenarios in which you should be running them:
63 .Bl -bullet -offset indent
64 .It
65 After a fresh installation of
66 .Fx
67 to ensure that the system works correctly on your hardware platform.
68 .It
69 After an upgrade of
70 .Fx
71 to a different version to ensure that the new code works well on your
72 hardware platform and that the upgrade did not introduce regressions in your
73 configuration.
74 .It
75 After performing changes to the source tree to catch any bugs and/or regressions
76 introduced by the modifications.
77 .It
78 Periodically, maybe from a
79 .Xr cron 8
80 job, to ensure that any changes to the system (such as the installation of
81 third-party packages or manual modifications to configuration files) do not
82 introduce unexpected failures.
83 .El
84 .Ss Running the tests
85 First of all, you will need to install the
86 .Sq ports/devel/kyua
87 package.
88 .Pp
89 Use the following command to run the whole test suite:
90 .Bd -literal -offset indent
91 $ kyua test -k /usr/tests/Kyuafile
92 .Ed
93 .Pp
94 The above will go through all test programs in
95 .Pa /usr/tests
96 recursively, execute them, store their results and debugging data in Kyua
97 database (by default in
98 .Pa ~/.kyua/store.db ) ,
99 and print a summary of the results.
100 This summary includes a brief count of all total tests run and how many of
101 them failed.
102 .Pp
103 It is possible to restrict which tests to run by providing their names in
104 the command line.
105 For example, this would execute the tests for the
106 .Xr cp 1
107 and
108 .Xr cut 1
109 utilities:
110 .Bd -literal -offset indent
111 $ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
112 .Ed
113 .Ss Obtaining reports of the tests execution
114 Additional information of the results of the execution can be later extracted
115 from the database by using the various reporting commands of Kyua.
116 For example, the following would extract a plain-text report of the executed
117 tests and show which ones failed:
118 .Bd -literal -offset indent
119 $ kyua report
120 .Ed
121 .Pp
122 This other example would generate an HTML report ready to be published on a
123 web server:
124 .Bd -literal -offset indent
125 $ kyua report-html --output ~/public_html/tests
126 .Ed
127 .Pp
128 For further details on the command-line interface of Kyua, please refer
129 to its manual page
130 .Xr kyua 1 .
131 .\".Ss Configuring the tests
132 .\"Some test cases in the
133 .\".Fx
134 .\"test suite require the administrator to manually set up some configuration
135 .\"properties before they can run.
136 .\"Unless these properties are defined, the tests that require them will be marked
137 .\"as skipped and thus they will not be really executed.
138 .\".Pp
139 .\"Test suites are configured by defining the values to their configuration
140 .\"variables in
141 .\".Pa /usr/local/etc/kyua/kyua.conf .
142 .\"The format of this file is detailed in
143 .\".Xr kyua.conf 5 .
144 .\".Pp
145 .\"The following configuration variables are available in the
146 .\".Fx
147 .\"test suite:
148 .\".Bl -tag
149 .\".It NONE REGISTERED YET
150 .\"TBD.
151 .Ss What to do if something fails?
152 If there is
153 .Em any failure
154 during the execution of the test suite, please considering reporting it to the
155 .Fx
156 developers so that the failure can be analyzed and fixed.
157 To do so, either send a message to the appropriate mailing list or file a
158 problem report.
159 For more details please refer to:
160 .Bl -bullet -offset indent -compact
161 .It
162 .Lk http://lists.freebsd.org/ "FreeBSD Mailing Lists"
163 .It
164 .Lk http://www.freebsd.org/send-pr.html "Submit a FreeBSD Problem Report"
165 .El
166 .Sh FILES
167 .Bl -tag -compact -width usrXlocalXetcXkyuaXkyuaXconfXX
168 .It Pa /usr/local/etc/kyua/kyua.conf
169 System-wide configuration file for
170 .Xr kyua 1 .
171 .It Pa ~/.kyua/kyua.conf
172 User-specific configuration file for
173 .Xr kyua 1 ;
174 overrides the system file.
175 .It Pa ~/.kyua/store.db
176 Default database used by Kyua to maintain the data of the executed tests.
177 .It Pa /usr/tests/
178 Location of the
179 .Fx
180 test suite.
181 .It Pa /usr/tests/Kyuafile
182 Top-level test suite definition file.
183 .El
184 .Sh SEE ALSO
185 .Xr kyua 1 .
186 .Sh HISTORY
187 The collection of test programs in
188 .Pa /usr/tests
189 first appeared in
190 .Fx 11.0 .
191 .Pp
192 The
193 .Nm
194 manual page first appeared in
195 .Nx 6.0
196 and was later ported to
197 .Fx 11.0 .
198 .Sh AUTHORS
199 .An Julio Merino Aq Mt jmmv@google.com