xref: /netbsd-src/external/bsd/kyua-cli/dist/doc/kyua.1.in (revision 6b3a42af15b5e090c339512c790dd68f3d11a9d8)
1*6b3a42afSjmmv.\" Copyright 2011 Google Inc.
2*6b3a42afSjmmv.\" All rights reserved.
3*6b3a42afSjmmv.\"
4*6b3a42afSjmmv.\" Redistribution and use in source and binary forms, with or without
5*6b3a42afSjmmv.\" modification, are permitted provided that the following conditions are
6*6b3a42afSjmmv.\" met:
7*6b3a42afSjmmv.\"
8*6b3a42afSjmmv.\" * Redistributions of source code must retain the above copyright
9*6b3a42afSjmmv.\"   notice, this list of conditions and the following disclaimer.
10*6b3a42afSjmmv.\" * Redistributions in binary form must reproduce the above copyright
11*6b3a42afSjmmv.\"   notice, this list of conditions and the following disclaimer in the
12*6b3a42afSjmmv.\"   documentation and/or other materials provided with the distribution.
13*6b3a42afSjmmv.\" * Neither the name of Google Inc. nor the names of its contributors
14*6b3a42afSjmmv.\"   may be used to endorse or promote products derived from this software
15*6b3a42afSjmmv.\"   without specific prior written permission.
16*6b3a42afSjmmv.\"
17*6b3a42afSjmmv.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18*6b3a42afSjmmv.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19*6b3a42afSjmmv.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20*6b3a42afSjmmv.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21*6b3a42afSjmmv.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22*6b3a42afSjmmv.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23*6b3a42afSjmmv.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*6b3a42afSjmmv.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*6b3a42afSjmmv.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*6b3a42afSjmmv.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27*6b3a42afSjmmv.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*6b3a42afSjmmv.Dd February 7, 2013
29*6b3a42afSjmmv.Dt KYUA 1
30*6b3a42afSjmmv.Os
31*6b3a42afSjmmv.Sh NAME
32*6b3a42afSjmmv.Nm kyua
33*6b3a42afSjmmv.Nd Command-line interface to Kyua quality assurance toolkit
34*6b3a42afSjmmv.Sh SYNOPSIS
35*6b3a42afSjmmv.Nm
36*6b3a42afSjmmv.Op Fl -config Ar file
37*6b3a42afSjmmv.Op Fl -logfile Ar file
38*6b3a42afSjmmv.Op Fl -loglevel Ar level
39*6b3a42afSjmmv.Op Fl -variable Ar name=value
40*6b3a42afSjmmv.Ar command
41*6b3a42afSjmmv.Op Ar command_options
42*6b3a42afSjmmv.Op Ar command_arguments
43*6b3a42afSjmmv.Sh DESCRIPTION
44*6b3a42afSjmmvKyua is a quality assurance toolkit: a package that provides libraries to
45*6b3a42afSjmmvaid in the creation of test cases, and tools to execute such test cases and
46*6b3a42afSjmmvgenerate reports of their results.
47*6b3a42afSjmmv.Pp
48*6b3a42afSjmmvThis manual page describes
49*6b3a42afSjmmv.Nm
50*6b3a42afSjmmv(note the lowercase), which is the command-line interface to the Kyua
51*6b3a42afSjmmvpackage.
52*6b3a42afSjmmv.Pp
53*6b3a42afSjmmvIf you are here because all you want to know is how to run the tests in
54*6b3a42afSjmmv.Pa __TESTSDIR__ ,
55*6b3a42afSjmmvyou most likely want to read the
56*6b3a42afSjmmv.Xr tests 7
57*6b3a42afSjmmvmanual page instead if your system provides one.
58*6b3a42afSjmmv.Pp
59*6b3a42afSjmmvAs can be observed in the synopsis, the interface of
60*6b3a42afSjmmv.Nm
61*6b3a42afSjmmvimplements a common subcommand-based interface.  The arguments to the tool
62*6b3a42afSjmmvspecify, in this order: a set of common options that all the commands
63*6b3a42afSjmmvaccept, a required
64*6b3a42afSjmmv.Ar command
65*6b3a42afSjmmvname that specifies what
66*6b3a42afSjmmv.Nm
67*6b3a42afSjmmvshould do, and
68*6b3a42afSjmmva set of possibly-optional
69*6b3a42afSjmmv.Ar command_options
70*6b3a42afSjmmvand
71*6b3a42afSjmmv.Ar command_arguments
72*6b3a42afSjmmvthat are specific to the chosen command.
73*6b3a42afSjmmv.Ss Options supported by all commands
74*6b3a42afSjmmvThe following options are recognized by all the commands.
75*6b3a42afSjmmvKeep in mind that these must always be specified before the command name.
76*6b3a42afSjmmv.Bl -tag -width XX
77*6b3a42afSjmmv.It Fl -config Ar path , Fl c Ar path
78*6b3a42afSjmmvSpecifies the configuration file to process, which must be in the format
79*6b3a42afSjmmvdescribed in
80*6b3a42afSjmmv.Xr kyua.conf 5 .
81*6b3a42afSjmmvThe special value
82*6b3a42afSjmmv.Sq none
83*6b3a42afSjmmvexplicitly disables the loading of any configuration file.
84*6b3a42afSjmmv.Pp
85*6b3a42afSjmmvDefaults to
86*6b3a42afSjmmv.Pa ~/.kyua/kyua.conf
87*6b3a42afSjmmvif it exists, otherwise to
88*6b3a42afSjmmv.Pa __CONFDIR__/kyua.conf
89*6b3a42afSjmmvif it exists,
90*6b3a42afSjmmvor else to
91*6b3a42afSjmmv.Sq none .
92*6b3a42afSjmmv.It Fl -logfile Ar path
93*6b3a42afSjmmvSpecifies the location of the file to which
94*6b3a42afSjmmv.Nm
95*6b3a42afSjmmvwill log run time events useful for postmortem debugging.
96*6b3a42afSjmmv.Pp
97*6b3a42afSjmmvThe default depends on different environment variables as described in
98*6b3a42afSjmmv.Sx Logging ,
99*6b3a42afSjmmvbut typically the file will be stored within the user's home directory.
100*6b3a42afSjmmv.It Fl -loglevel Ar level
101*6b3a42afSjmmvSpecifies the maximum logging level to record in the log file.
102*6b3a42afSjmmvSee
103*6b3a42afSjmmv.Sx Logging
104*6b3a42afSjmmvfor more details.
105*6b3a42afSjmmv.Pp
106*6b3a42afSjmmvThe default is
107*6b3a42afSjmmv.Sq info .
108*6b3a42afSjmmv.It Fl -variable Ar name=value , Fl v Ar name=value
109*6b3a42afSjmmvSets the
110*6b3a42afSjmmv.Ar name
111*6b3a42afSjmmvconfiguration variable to
112*6b3a42afSjmmv.Ar value .
113*6b3a42afSjmmvThe values set through this option have preference over the values set in the
114*6b3a42afSjmmvconfiguration file.
115*6b3a42afSjmmv.Pp
116*6b3a42afSjmmvThe specified variable can either be a builtin variable or a test-suite
117*6b3a42afSjmmvspecific variable.  See
118*6b3a42afSjmmv.Xr kyua.conf 5
119*6b3a42afSjmmvfor more details.
120*6b3a42afSjmmv.El
121*6b3a42afSjmmv.Ss Available commands
122*6b3a42afSjmmvThe following commands are generic and do not have any relation to the execution
123*6b3a42afSjmmvof tests or the inspection of their results:
124*6b3a42afSjmmv.Bl -tag -width reportXhtmlXX -offset indent
125*6b3a42afSjmmv.It Ar about
126*6b3a42afSjmmvShows general program information.
127*6b3a42afSjmmvSee
128*6b3a42afSjmmv.Xr kyua-about 1 .
129*6b3a42afSjmmv.It Ar config
130*6b3a42afSjmmvInspects the values of the configuration variables.
131*6b3a42afSjmmvSee
132*6b3a42afSjmmv.Xr kyua-config 1 .
133*6b3a42afSjmmv.It Ar db-exec
134*6b3a42afSjmmvExecutes an arbitrary SQL statement in the store database and prints the
135*6b3a42afSjmmvresulting table.
136*6b3a42afSjmmvSee
137*6b3a42afSjmmv.Xr kyua-db-exec 1 .
138*6b3a42afSjmmv.It Ar help
139*6b3a42afSjmmvShows usage information.
140*6b3a42afSjmmvSee
141*6b3a42afSjmmv.Xr kyua-help 1 .
142*6b3a42afSjmmv.El
143*6b3a42afSjmmv.Pp
144*6b3a42afSjmmvThe following commands are used to generate reports based on the data previously
145*6b3a42afSjmmvstored in the database:
146*6b3a42afSjmmv.Bl -tag -width reportXhtmlXX -offset indent
147*6b3a42afSjmmv.It Ar report
148*6b3a42afSjmmvGenerates a plain-text report.
149*6b3a42afSjmmvSee
150*6b3a42afSjmmv.Xr kyua-report 1 .
151*6b3a42afSjmmv.It Ar report-html
152*6b3a42afSjmmvGenerates an HTML report.
153*6b3a42afSjmmvSee
154*6b3a42afSjmmv.Xr kyua-report-html 1 .
155*6b3a42afSjmmv.El
156*6b3a42afSjmmv.Pp
157*6b3a42afSjmmvThe following commands are used to interact with a test suite:
158*6b3a42afSjmmv.Bl -tag -width reportXhtmlXX -offset indent
159*6b3a42afSjmmv.It Ar debug
160*6b3a42afSjmmvExecutes a single test case in a controlled environment for debugging purposes.
161*6b3a42afSjmmvSee
162*6b3a42afSjmmv.Xr kyua-debug 1 .
163*6b3a42afSjmmv.It Ar list
164*6b3a42afSjmmvLists test cases and their metadata.
165*6b3a42afSjmmvSee
166*6b3a42afSjmmv.Xr kyua-list 1 .
167*6b3a42afSjmmv.It Ar test
168*6b3a42afSjmmvRuns tests.
169*6b3a42afSjmmvSee
170*6b3a42afSjmmv.Xr kyua-test 1 .
171*6b3a42afSjmmv.El
172*6b3a42afSjmmv.Ss Logging
173*6b3a42afSjmmv.Nm
174*6b3a42afSjmmvhas a logging facility that collects all kinds of events at run time.
175*6b3a42afSjmmvThese events are always logged to a file so that the log is available when
176*6b3a42afSjmmvit is most needed: right after a non-reproducible problem happens.
177*6b3a42afSjmmvThe only way to disable logging is by sending the log to
178*6b3a42afSjmmv.Pa /dev/null .
179*6b3a42afSjmmv.Pp
180*6b3a42afSjmmvThe location of the log file can be manually specified with the
181*6b3a42afSjmmv.Fl -logfile
182*6b3a42afSjmmvoption, which applies to all commands.  If no file is explicitly specified, the
183*6b3a42afSjmmvlocation of the log files is chosen in this order:
184*6b3a42afSjmmv.Bl -enum -offset indent
185*6b3a42afSjmmv.It
186*6b3a42afSjmmv.Pa ${HOME}/.kyua/logs/
187*6b3a42afSjmmvif
188*6b3a42afSjmmv.Va HOME
189*6b3a42afSjmmvis defined.
190*6b3a42afSjmmv.It
191*6b3a42afSjmmv.Pa ${TMPDIR}/
192*6b3a42afSjmmvif
193*6b3a42afSjmmv.Va TMPDIR
194*6b3a42afSjmmvis defined.
195*6b3a42afSjmmv.It
196*6b3a42afSjmmv.Pa /tmp/ .
197*6b3a42afSjmmv.El
198*6b3a42afSjmmv.Pp
199*6b3a42afSjmmvAnd the default naming scheme of the log files is:
200*6b3a42afSjmmv.Sq <progname>.<timestamp>.log .
201*6b3a42afSjmmv.Pp
202*6b3a42afSjmmvThe messages stored in the log file have a level (or severity) attached to
203*6b3a42afSjmmvthem.  These are:
204*6b3a42afSjmmv.Bl -tag -width warningXX -offset indent
205*6b3a42afSjmmv.It error
206*6b3a42afSjmmvFatal error messages.  The program generally terminates after these, either
207*6b3a42afSjmmvin a clean manner or by crashing.
208*6b3a42afSjmmv.It warning
209*6b3a42afSjmmvNon-fatal error messages.  These generally report a condition that must be
210*6b3a42afSjmmvaddressed but the application can continue to run.
211*6b3a42afSjmmv.It info
212*6b3a42afSjmmvInformational messages.  These tell the user what the program was doing at
213*6b3a42afSjmmva general level of operation.
214*6b3a42afSjmmv.It debug
215*6b3a42afSjmmvDetailed informational messages.  These are often useful when debugging
216*6b3a42afSjmmvproblems in the application, as they contain lots of internal details.
217*6b3a42afSjmmv.El
218*6b3a42afSjmmv.Pp
219*6b3a42afSjmmvThe default log level is
220*6b3a42afSjmmv.Sq info
221*6b3a42afSjmmvunless expicitly overriden with
222*6b3a42afSjmmv.Fl -loglevel .
223*6b3a42afSjmmv.Pp
224*6b3a42afSjmmvThe log file is a plain text file containing one line per log record.  The
225*6b3a42afSjmmvformat of each line is as follows:
226*6b3a42afSjmmv.Bd -literal -offset indent
227*6b3a42afSjmmvtimestamp entry_type pid file:line: message
228*6b3a42afSjmmv.Ed
229*6b3a42afSjmmv.Pp
230*6b3a42afSjmmv.Ar entry_type
231*6b3a42afSjmmvcan be one of:
232*6b3a42afSjmmv.Sq E
233*6b3a42afSjmmvfor an error,
234*6b3a42afSjmmv.Sq W
235*6b3a42afSjmmvfor a warning,
236*6b3a42afSjmmv.Sq I
237*6b3a42afSjmmvfor an informational message and
238*6b3a42afSjmmv.Sq D
239*6b3a42afSjmmvfor a debug message.
240*6b3a42afSjmmv.Ss Bug reporting
241*6b3a42afSjmmvIf you think you have encountered a bug in
242*6b3a42afSjmmv.Nm ,
243*6b3a42afSjmmvplease take the time to let the developers know about it.  This will ensure
244*6b3a42afSjmmvthat the bug is addressed and potentially fixed in the next Kyua release.
245*6b3a42afSjmmv.Pp
246*6b3a42afSjmmvThe first step in reporting a bug is to check if there already is a similar
247*6b3a42afSjmmvbug in the database.  You can check what issues are currently in the
248*6b3a42afSjmmvdatabase by going to:
249*6b3a42afSjmmv.Bd -literal -offset indent
250*6b3a42afSjmmvhttp://code.google.com/p/kyua/issues/list
251*6b3a42afSjmmv.Ed
252*6b3a42afSjmmv.Pp
253*6b3a42afSjmmvIf there is no existing issue that describes an issue similar to the
254*6b3a42afSjmmvone you are experiencing, you can open a new one by visiting:
255*6b3a42afSjmmv.Bd -literal -offset indent
256*6b3a42afSjmmvhttp://code.google.com/p/kyua/issues/entry
257*6b3a42afSjmmv.Ed
258*6b3a42afSjmmv.Pp
259*6b3a42afSjmmvWhen doing so, please include as much detail as possible.  Among other
260*6b3a42afSjmmvthings, explain what operating system and platform you are running
261*6b3a42afSjmmv.Nm
262*6b3a42afSjmmvon, what were you trying to do, what exact messages you saw on the screen,
263*6b3a42afSjmmvhow did you expect the program to behave, and any other details that you
264*6b3a42afSjmmvmay find relevant.
265*6b3a42afSjmmv.Pp
266*6b3a42afSjmmvAlso, please include a copy of the log file corresponding to the problem
267*6b3a42afSjmmvyou are experiencing.  Unless you have changed the location of the log
268*6b3a42afSjmmvfiles, you can most likely find them in
269*6b3a42afSjmmv.Pa ~/.kyua/logs/ .
270*6b3a42afSjmmvIf the problem is reproducible, it is good idea to regenerate the log file
271*6b3a42afSjmmvwith an increased log level so as to provide more information.  For
272*6b3a42afSjmmvexample:
273*6b3a42afSjmmv.Bd -literal -offset indent
274*6b3a42afSjmmv$ kyua --logfile=problem.log --loglevel=debug \\
275*6b3a42afSjmmv    [rest of the command line]
276*6b3a42afSjmmv.Ed
277*6b3a42afSjmmv.Sh ENVIRONMENT
278*6b3a42afSjmmvThe following variables are recognized and can be freely tuned by the end user:
279*6b3a42afSjmmv.Bl -tag -width COLUMNSXX
280*6b3a42afSjmmv.It Va COLUMNS
281*6b3a42afSjmmvThe width of the screen, in number of characters.
282*6b3a42afSjmmv.Nm
283*6b3a42afSjmmvuses this to wrap long lines.
284*6b3a42afSjmmvIf not present, the width of the screen is determined from the terminal
285*6b3a42afSjmmvstdout is connected to, and, if the guessing fails, this defaults to infinity.
286*6b3a42afSjmmv.It Va HOME
287*6b3a42afSjmmvPath to the user's home directory.
288*6b3a42afSjmmv.Nm
289*6b3a42afSjmmvuses this location to determine paths to configuration files and default log
290*6b3a42afSjmmvfiles.
291*6b3a42afSjmmv.It Va TMPDIR
292*6b3a42afSjmmvPath to the system-wide temporary directory.
293*6b3a42afSjmmv.Nm
294*6b3a42afSjmmvuses this location to place the work directory of test cases, among other
295*6b3a42afSjmmvthings.
296*6b3a42afSjmmv.Pp
297*6b3a42afSjmmvThe default value of this variable depends on the operating system.  In
298*6b3a42afSjmmvgeneral, it is
299*6b3a42afSjmmv.Pa /tmp .
300*6b3a42afSjmmv.El
301*6b3a42afSjmmv.Pp
302*6b3a42afSjmmvThe following variables are also recognized, but you should not need to set them
303*6b3a42afSjmmvduring normal operation.
304*6b3a42afSjmmvThey are only provided to override the value of built-in values, which is useful
305*6b3a42afSjmmvwhen testing
306*6b3a42afSjmmv.Nm
307*6b3a42afSjmmvitself:
308*6b3a42afSjmmv.Bl -tag -width KYUAXCONFDIRXX
309*6b3a42afSjmmv.It Va KYUA_CONFDIR
310*6b3a42afSjmmvPath to the system-wide configuration files for
311*6b3a42afSjmmv.Nm .
312*6b3a42afSjmmv.Pp
313*6b3a42afSjmmvDefaults to
314*6b3a42afSjmmv.Pa __CONFDIR__ .
315*6b3a42afSjmmv.It Va KYUA_DOCDIR
316*6b3a42afSjmmvPath to the location of installed documentation.
317*6b3a42afSjmmv.Pp
318*6b3a42afSjmmvDefaults to
319*6b3a42afSjmmv.Pa __DOCDIR__ .
320*6b3a42afSjmmv.It Va KYUA_MISCDIR
321*6b3a42afSjmmvPath to the location of the installed miscellaneous scripts and data
322*6b3a42afSjmmvfiles provided by
323*6b3a42afSjmmv.Nm .
324*6b3a42afSjmmv.Pp
325*6b3a42afSjmmvDefaults to
326*6b3a42afSjmmv.Pa __MISCDIR__ .
327*6b3a42afSjmmv.It Va KYUA_STOREDIR
328*6b3a42afSjmmvPath to the location of the installed store support files; e.g. the
329*6b3a42afSjmmvdirectory containing the SQL database schema.
330*6b3a42afSjmmv.Pp
331*6b3a42afSjmmvDefaults to
332*6b3a42afSjmmv.Pa __STOREDIR__ .
333*6b3a42afSjmmv.It Va KYUA_TESTERSDIR
334*6b3a42afSjmmvPath to the location of the installed testers; e.g. the directory containing
335*6b3a42afSjmmvprograms like
336*6b3a42afSjmmv.Pa plain_tester .
337*6b3a42afSjmmvDefaults to
338*6b3a42afSjmmv.Pa __TESTERSDIR__ .
339*6b3a42afSjmmv.El
340*6b3a42afSjmmv.Sh FILES
341*6b3a42afSjmmv.Bl -tag -width XXXX
342*6b3a42afSjmmv.It Pa ~/.kyua/kyua.conf
343*6b3a42afSjmmvUser-specific configuration file.
344*6b3a42afSjmmv.It Pa ~/.kyua/logs/
345*6b3a42afSjmmvDefault location for the collected log files.
346*6b3a42afSjmmv.It Pa __CONFDIR__/kyua.conf
347*6b3a42afSjmmvSystem-wide configuration file.
348*6b3a42afSjmmv.El
349*6b3a42afSjmmv.Sh EXIT STATUS
350*6b3a42afSjmmv.Nm
351*6b3a42afSjmmvreturns 0 on success, 1 on a controlled error condition in the given
352*6b3a42afSjmmvsubcommand, 2 on a general unexpected error and 3 on a usage error.
353*6b3a42afSjmmv.Pp
354*6b3a42afSjmmvThe documentation of the subcommands in the corresponding manual pages only
355*6b3a42afSjmmvdetails the difference between a successful exit (0) and the detection of a
356*6b3a42afSjmmvcontrolled error (1).  Even though when those manual pages do not describe
357*6b3a42afSjmmvany other exit statuses, codes above 1 can be returned.
358*6b3a42afSjmmv.Sh SEE ALSO
359*6b3a42afSjmmv.Xr atf 7 ,
360*6b3a42afSjmmv.Xr tests 7
361*6b3a42afSjmmv.Sh AUTHORS
362*6b3a42afSjmmvFor more details on the people that made
363*6b3a42afSjmmv.Nm
364*6b3a42afSjmmvpossible and the license terms, run:
365*6b3a42afSjmmv.Bd -literal -offset indent
366*6b3a42afSjmmv$ kyua about
367*6b3a42afSjmmv.Ed
368