xref: /netbsd-src/share/man/man7/tests.kyua.7 (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1.\"	$NetBSD: tests.kyua.7,v 1.2 2013/07/20 21:39:59 wiz Exp $
2.\"
3.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
16.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
17.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
20.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
22.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27.\"
28.Dd February 24, 2013
29.Dt TESTS 7
30.Os
31.Sh NAME
32.Nm tests
33.Nd introduction to the NetBSD test suite
34.Sh DESCRIPTION
35The
36.Nx
37test suite provides a collection of automated tests for two major purposes.
38On the one hand, the test suite aids
39.Em developers
40in catching bugs and regressions in the code when they performing modifications
41to the source tree.
42On the other hand, the test suite allows
43.Em end users
44(and, in particular, system administrators) to verify that fresh installations
45of the
46.Nx
47operating system behave correctly in their hardware platform and also to ensure
48that the system does not suffer from regressions during regular system
49operation and maintenance.
50.Pp
51The
52.Nx
53test suite is distributed as a separate installation set, named
54.Pa tests.tgz ,
55and the test programs are all installed under the
56.Pa /usr/tests
57hierarchy.
58.Pp
59This manual page describes how to execute the test suite and how to configure
60some of its optional features.
61.Ss When to run the tests?
62Before diving into the details of how to run the test suite, here are some
63scenarios in which you should be running them:
64.Bl -bullet -offset indent
65.It
66After a fresh installation of
67.Nx
68to ensure that the system works correctly on your hardware platform.
69.It
70After an upgrade of
71.Nx
72to a different version to ensure that the new code works well on your
73hardware platform and that the upgrade did not introduce regressions in your
74configuration.
75.It
76After performing changes to the source tree to catch any bugs and/or regressions
77introduced by the modifications.
78.It
79Periodically, maybe from a
80.Xr cron 8
81job, to ensure that any changes to the system (such as the installation of
82third-party packages or manual modifications to configuration files) do not
83introduce unexpected failures.
84.El
85.Ss Installing the tests
86If you chose to install the
87.Pa tests.tgz
88distribution set while setting up your
89.Nx
90system, the tests are already available in
91.Pa /usr/tests .
92Otherwise, install the set now by running:
93.Bd -literal -offset indent
94# cd /
95# tar xzpf /path/to/tests.tgz
96.Ed
97.Ss Running the tests
98Use the following command to run the whole test suite:
99.Bd -literal -offset indent
100$ kyua test -k /usr/tests/Kyuafile
101.Ed
102.Pp
103The above will go through all test programs in
104.Pa /usr/tests
105recursively, execute them, store their results and debugging data in Kyua
106database (by default in
107.Pa ~/.kyua/store.db ) ,
108and print a summary of the results.
109This summary includes a brief count of all total tests run and how many of
110them failed.
111.Pp
112It is possible to restrict which tests to run by providing their names in
113the command line.
114For example, this would execute the tests for the
115.Xr cp 1
116and
117.Xr cut 1
118utilities:
119.Bd -literal -offset indent
120$ kyua test -k /usr/tests/Kyuafile bin/cp usr.bin/cut
121.Ed
122.Ss Obtaining reports of the tests execution
123Additional information of the results of the execution can be later extracted
124from the database by using the various reporting commands of Kyua.
125For example, the following would extract a plain-text report of the executed
126tests and show which ones failed:
127.Bd -literal -offset indent
128$ kyua report
129.Ed
130.Pp
131This other example would generate an HTML report ready to be published on a
132web server, possibly the built-in
133.Xr httpd 8 :
134.Bd -literal -offset indent
135$ kyua report-html --output ~/public_html/tests
136.Ed
137.Pp
138For further details on the command-line interface of Kyua, please refer
139to its manual page
140.Xr kyua 1 .
141.Ss Configuring the tests
142Some test cases in the
143.Nx
144test suite require the administrator to manually set up some configuration
145properties before they can run.
146Unless these properties are defined, the tests that require them will be marked
147as skipped and thus they will not be really executed.
148.Pp
149Test suites are configured by defining the values to their configuration
150variables in
151.Pa /etc/kyua/kyua.conf .
152The format of this file is detailed in
153.Xr kyua.conf 5 .
154.Pp
155The following configuration variables are available in the
156.Nx
157test suite:
158.Bl -tag -width "fstype"
159.It fstype
160When set to a filesystem type, restrict tests programs from the
161.Pa /usr/tests/fs/vfs/ .
162.Ss What to do if something fails?
163If there is
164.Em any failure
165during the execution of the test suite, please considering reporting it to the
166.Nx
167developers so that the failure can be analyzed and fixed.
168To do so, either send a message to the appropriate mailing list or file a
169problem report.
170For more details please refer to:
171.Bl -bullet -offset indent -compact
172.It
173.Lk http://www.netbsd.org/mailinglists/ "NetBSD mailing lists"
174.It
175.Lk http://www.netbsd.org/support/send-pr.html "NetBSD Problem Reports"
176.El
177.Sh FILES
178.Bl -tag -compact -width etcXatfXNetBSDXconfXX
179.It Pa /etc/kyua/kyua.conf
180System-wide configuration file for
181.Xr kyua 1 .
182.It Pa ~/.kyua/kyua.conf
183User-specific configuration file for
184.Xr kyua 1 ;
185overrides the system file.
186.It Pa ~/.kyua/store.db
187Default database used by Kyua to maintain the data of the executed tests.
188.It Pa /usr/tests/
189Location of the
190.Nx
191test suite.
192.It Pa /usr/tests/Kyuafile
193Top-level test suite definition file.
194.El
195.Sh SEE ALSO
196.Xr kyua 1 ,
197.Xr kyua-report 1 ,
198.Xr kyua-test 1
199.Sh HISTORY
200The collection of test programs in
201.Pa /usr/tests
202first appeared in
203.Nx 5.0
204and has been growing since then.
205.Pp
206The
207.Nm
208manual page first appeared in
209.Nx 6.0
210and was updated in
211.Nx 7.0
212to describe the execution of the tests with Kyua rather than with ATF.
213.Pp
214The ATF testing framework was first distributed with
215.Nx 5.0
216and the runtime tools of this framework are being phased out in
217.Nx 7.0 .
218Note that the
219.Em libraries
220that ship with ATF are still in active use and are not deprecated.
221.Pp
222The Kyua testing toolkit was first distributed with
223.Nx 7.0 .
224The
225.Xr atf-run 1
226and
227.Xr atf-report 1
228tools were replaced as part of this import to be backwards-compatibility
229wrappers around
230.Xr kyua 1 .
231.Sh AUTHORS
232.An Julio Merino Aq Mt jmmv@NetBSD.org
233