xref: /freebsd/share/man/man7/tests.7 (revision 7661de35d15f582ab33e3bd6b8d909601557e436)
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
36The
37.Fx
38test suite provides a collection of automated tests for two major purposes.
39On the one hand, the test suite aids
40.Em developers
41in catching bugs and regressions in the code when they performing modifications
42to the source tree.
43On the other hand, the test suite allows
44.Em end users
45(and, in particular, system administrators) to verify that fresh installations
46of the
47.Fx
48operating system behave correctly in their hardware platform and also to ensure
49that the system does not suffer from regressions during regular system
50operation and maintenance.
51.Pp
52The
53.Fx
54test suite is installed under the
55.Pa /usr/tests
56hierarchy.
57.Pp
58This manual page describes how to execute the test suite and how to configure
59some of its optional features.
60.Ss When to run the tests?
61Before diving into the details of how to run the test suite, here are some
62scenarios in which you should be running them:
63.Bl -bullet -offset indent
64.It
65After a fresh installation of
66.Fx
67to ensure that the system works correctly on your hardware platform.
68.It
69After an upgrade of
70.Fx
71to a different version to ensure that the new code works well on your
72hardware platform and that the upgrade did not introduce regressions in your
73configuration.
74.It
75After performing changes to the source tree to catch any bugs and/or regressions
76introduced by the modifications.
77.It
78Periodically, maybe from a
79.Xr cron 8
80job, to ensure that any changes to the system (such as the installation of
81third-party packages or manual modifications to configuration files) do not
82introduce unexpected failures.
83.El
84.Ss Running the tests
85First of all, you will need to install the
86.Sq ports/devel/kyua
87package.
88.Pp
89Use 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
94The above will go through all test programs in
95.Pa /usr/tests
96recursively, execute them, store their results and debugging data in Kyua
97database (by default in
98.Pa ~/.kyua/store.db ) ,
99and print a summary of the results.
100This summary includes a brief count of all total tests run and how many of
101them failed.
102.Pp
103It is possible to restrict which tests to run by providing their names in
104the command line.
105For example, this would execute the tests for the
106.Xr cp 1
107and
108.Xr cut 1
109utilities:
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
114Additional information of the results of the execution can be later extracted
115from the database by using the various reporting commands of Kyua.
116For example, the following would extract a plain-text report of the executed
117tests and show which ones failed:
118.Bd -literal -offset indent
119$ kyua report
120.Ed
121.Pp
122This other example would generate an HTML report ready to be published on a
123web server:
124.Bd -literal -offset indent
125$ kyua report-html --output ~/public_html/tests
126.Ed
127.Pp
128For further details on the command-line interface of Kyua, please refer
129to 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?
152If there is
153.Em any failure
154during the execution of the test suite, please considering reporting it to the
155.Fx
156developers so that the failure can be analyzed and fixed.
157To do so, either send a message to the appropriate mailing list or file a
158problem report.
159For 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
169System-wide configuration file for
170.Xr kyua 1 .
171.It Pa ~/.kyua/kyua.conf
172User-specific configuration file for
173.Xr kyua 1 ;
174overrides the system file.
175.It Pa ~/.kyua/store.db
176Default database used by Kyua to maintain the data of the executed tests.
177.It Pa /usr/tests/
178Location of the
179.Fx
180test suite.
181.It Pa /usr/tests/Kyuafile
182Top-level test suite definition file.
183.El
184.Sh SEE ALSO
185.Xr kyua 1 .
186.Sh HISTORY
187The collection of test programs in
188.Pa /usr/tests
189first appeared in
190.Fx 11.0 .
191.Pp
192The
193.Nm
194manual page first appeared in
195.Nx 6.0
196and was later ported to
197.Fx 11.0 .
198.Sh AUTHORS
199.An Julio Merino Aq Mt jmmv@google.com
200