xref: /minix3/external/bsd/atf/dist/tools/atf-formats.5 (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc.\"
2*0a6a1f1dSLionel Sambuc.\" Automated Testing Framework (atf)
3*0a6a1f1dSLionel Sambuc.\"
4*0a6a1f1dSLionel Sambuc.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
5*0a6a1f1dSLionel Sambuc.\" All rights reserved.
6*0a6a1f1dSLionel Sambuc.\"
7*0a6a1f1dSLionel Sambuc.\" Redistribution and use in source and binary forms, with or without
8*0a6a1f1dSLionel Sambuc.\" modification, are permitted provided that the following conditions
9*0a6a1f1dSLionel Sambuc.\" are met:
10*0a6a1f1dSLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright
11*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer.
12*0a6a1f1dSLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright
13*0a6a1f1dSLionel Sambuc.\"    notice, this list of conditions and the following disclaimer in the
14*0a6a1f1dSLionel Sambuc.\"    documentation and/or other materials provided with the distribution.
15*0a6a1f1dSLionel Sambuc.\"
16*0a6a1f1dSLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17*0a6a1f1dSLionel Sambuc.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18*0a6a1f1dSLionel Sambuc.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19*0a6a1f1dSLionel Sambuc.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*0a6a1f1dSLionel Sambuc.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21*0a6a1f1dSLionel Sambuc.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*0a6a1f1dSLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23*0a6a1f1dSLionel Sambuc.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24*0a6a1f1dSLionel Sambuc.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25*0a6a1f1dSLionel Sambuc.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26*0a6a1f1dSLionel Sambuc.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27*0a6a1f1dSLionel Sambuc.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*0a6a1f1dSLionel Sambuc.\"
29*0a6a1f1dSLionel Sambuc.Dd December 20, 2011
30*0a6a1f1dSLionel Sambuc.Dt ATF-FORMATS 5
31*0a6a1f1dSLionel Sambuc.Os
32*0a6a1f1dSLionel Sambuc.Sh NAME
33*0a6a1f1dSLionel Sambuc.Nm atf-formats
34*0a6a1f1dSLionel Sambuc.Nd machine-parseable data formats used by ATF
35*0a6a1f1dSLionel Sambuc.Sh DESCRIPTION
36*0a6a1f1dSLionel SambucThis manual page describes the multiple data formats used in ATF.
37*0a6a1f1dSLionel SambucThese formats affect configuration files, control files and any data that
38*0a6a1f1dSLionel Sambucis externalized or internalized by the tools.
39*0a6a1f1dSLionel Sambuc.Pp
40*0a6a1f1dSLionel SambucData files are always organized as follows:
41*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
42*0a6a1f1dSLionel SambucHeader1: Value1            \\
43*0a6a1f1dSLionel Sambuc    ...                    | head
44*0a6a1f1dSLionel SambucHeaderN: ValueN            /
45*0a6a1f1dSLionel Sambuc                           mandatory blank line
46*0a6a1f1dSLionel SambucFree-form text contents    \\
47*0a6a1f1dSLionel Sambuc    ...                    | body
48*0a6a1f1dSLionel Sambuc    ...                    /
49*0a6a1f1dSLionel Sambuc.Ed
50*0a6a1f1dSLionel Sambuc.Pp
51*0a6a1f1dSLionel SambucA file must always contain a
52*0a6a1f1dSLionel Sambuc.Sq Content-Type
53*0a6a1f1dSLionel Sambucheader and must always separate that header from the body with a blank
54*0a6a1f1dSLionel Sambucline, even if the body is empty.
55*0a6a1f1dSLionel Sambuc.Pp
56*0a6a1f1dSLionel SambucThe
57*0a6a1f1dSLionel Sambuc.Sq Content-Type
58*0a6a1f1dSLionel Sambucis always of the form:
59*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
60*0a6a1f1dSLionel SambucContent-Type: application/X-atf-<subtype>; version="<version>"
61*0a6a1f1dSLionel Sambuc.Ed
62*0a6a1f1dSLionel Sambuc.Pp
63*0a6a1f1dSLionel Sambucwhere
64*0a6a1f1dSLionel Sambuc.Sq subtype
65*0a6a1f1dSLionel Sambucindicates the specific file format and
66*0a6a1f1dSLionel Sambuc.Sq version
67*0a6a1f1dSLionel Sambucits format version.
68*0a6a1f1dSLionel SambucThis header must be the first one of the file.
69*0a6a1f1dSLionel Sambuc.Pp
70*0a6a1f1dSLionel SambucThe main purpose of the
71*0a6a1f1dSLionel Sambuc.Sq Content-Type
72*0a6a1f1dSLionel Sambucheader, aside from determining the format used in the file, is to allow
73*0a6a1f1dSLionel Sambucfuture changes to a given format.
74*0a6a1f1dSLionel SambucWhenever an incompatible change is made, the version is bumped by one.
75*0a6a1f1dSLionel SambucBy keeping the header in the first line, future versions may even remove
76*0a6a1f1dSLionel Sambucthe need for such a header -- e.g. if some format was replaced by XML
77*0a6a1f1dSLionel Sambucfiles, which have their own mandatory header.
78*0a6a1f1dSLionel Sambuc.Pp
79*0a6a1f1dSLionel SambucThe rest of this document details the different format types.
80*0a6a1f1dSLionel Sambuc.Ss Format: application/X-atf-atffile, version: 1
81*0a6a1f1dSLionel SambucAtffiles are logically divided into three sections:
82*0a6a1f1dSLionel Sambuc.Bl -bullet
83*0a6a1f1dSLionel Sambuc.It
84*0a6a1f1dSLionel SambucTest programs: the list of test programs that define the test suite
85*0a6a1f1dSLionel Sambucdescribed by the Atffile.
86*0a6a1f1dSLionel Sambuc.It
87*0a6a1f1dSLionel SambucMeta-data properties: these define some constant values applicable to
88*0a6a1f1dSLionel Sambucall the test programs defined in the file.
89*0a6a1f1dSLionel SambucIn some sense they define the properties that describe the test suite.
90*0a6a1f1dSLionel Sambuc.It
91*0a6a1f1dSLionel SambucConfiguration variables: defaults for configuration variables that
92*0a6a1f1dSLionel Sambuccan be overridden through configuration files or the command line.
93*0a6a1f1dSLionel Sambuc.El
94*0a6a1f1dSLionel Sambuc.Pp
95*0a6a1f1dSLionel SambucThe grammar for Atffiles is the following:
96*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
97*0a6a1f1dSLionel SambucDATA ::= ( ( CONF | PROP | TP )? COMMENT? NEWLINE )* EOF
98*0a6a1f1dSLionel SambucCONF ::= 'conf:' WORD EQUAL STRING
99*0a6a1f1dSLionel SambucPROP ::= 'prop:' WORD EQUAL STRING
100*0a6a1f1dSLionel SambucTP ::= TPFILE | TPGLOB
101*0a6a1f1dSLionel SambucTPFILE ::= 'tp: ' STRING
102*0a6a1f1dSLionel SambucTPGLOB ::= 'tp-glob: ' STRING
103*0a6a1f1dSLionel SambucSTRING ::= WORD | '"' WORD* '"'
104*0a6a1f1dSLionel Sambuc.Ed
105*0a6a1f1dSLionel Sambuc.Pp
106*0a6a1f1dSLionel SambucThe meaning of the constructions above is:
107*0a6a1f1dSLionel Sambuc.Bl -tag -width TPGLOBXX
108*0a6a1f1dSLionel Sambuc.It CONF
109*0a6a1f1dSLionel SambucDefinition of a configuration variable.
110*0a6a1f1dSLionel Sambuc.It PROP
111*0a6a1f1dSLionel SambucDefinition of a meta-data property.
112*0a6a1f1dSLionel Sambuc.It TPFILE
113*0a6a1f1dSLionel SambucAddition of a test program into the test suite.
114*0a6a1f1dSLionel SambucThe string is taken literally as the program's name, and this program
115*0a6a1f1dSLionel Sambucmust exist.
116*0a6a1f1dSLionel Sambuc.It TPGLOB
117*0a6a1f1dSLionel SambucAddition of multiple test programs into the test suite.
118*0a6a1f1dSLionel SambucThe string is taken as a glob pattern, which may have or not have any
119*0a6a1f1dSLionel Sambucmatches in the current directory.
120*0a6a1f1dSLionel Sambuc.El
121*0a6a1f1dSLionel Sambuc.Pp
122*0a6a1f1dSLionel SambucAn example:
123*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
124*0a6a1f1dSLionel Sambucprop: test-suite = utilities
125*0a6a1f1dSLionel Sambuc
126*0a6a1f1dSLionel Sambucconf: unprivileged-user = nobody
127*0a6a1f1dSLionel Sambuc
128*0a6a1f1dSLionel Sambuctp: t_cp
129*0a6a1f1dSLionel Sambuctp: t_mv
130*0a6a1f1dSLionel Sambuctp: t_df
131*0a6a1f1dSLionel Sambuctp-glob: t_dir_*
132*0a6a1f1dSLionel Sambuc.Ed
133*0a6a1f1dSLionel Sambuc.Ss Format: application/X-atf-config, version: 1
134*0a6a1f1dSLionel SambucConfiguration files are very simple: they only contain a list of variable
135*0a6a1f1dSLionel Sambucname/variable value pairs.
136*0a6a1f1dSLionel SambucTheir grammar is:
137*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
138*0a6a1f1dSLionel SambucDATA ::= ( VAR? COMMENT? NEWLINE )* EOF
139*0a6a1f1dSLionel SambucVAR ::= WORD EQUAL STRING
140*0a6a1f1dSLionel SambucCOMMENT ::= HASH WORD*
141*0a6a1f1dSLionel SambucSTRING ::= WORD | '"' WORD* '"'
142*0a6a1f1dSLionel Sambuc.Ed
143*0a6a1f1dSLionel Sambuc.Pp
144*0a6a1f1dSLionel SambucAn example:
145*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
146*0a6a1f1dSLionel Sambuc# This is the system-wide configuration file for ATF.
147*0a6a1f1dSLionel Sambuc# The above and this line are comments placed on their own line.
148*0a6a1f1dSLionel Sambuc
149*0a6a1f1dSLionel Sambucvar1 = this is a variable value
150*0a6a1f1dSLionel Sambucvar2 = this is another one      # Optional comment at the end.
151*0a6a1f1dSLionel Sambuc.Ed
152*0a6a1f1dSLionel Sambuc.Ss Format: application/X-atf-tps, version: 3
153*0a6a1f1dSLionel SambucThe
154*0a6a1f1dSLionel Sambuc.Sq application/X-atf-tps
155*0a6a1f1dSLionel Sambucformat multiplexes the standard output, standard error and results output
156*0a6a1f1dSLionel Sambucstreams from multiple test programs into a single data file.
157*0a6a1f1dSLionel SambucThis format is used by
158*0a6a1f1dSLionel Sambuc.Xr atf-run 1
159*0a6a1f1dSLionel Sambucto report the execution of several test programs and is later parsed by
160*0a6a1f1dSLionel Sambuc.Xr atf-report 1
161*0a6a1f1dSLionel Sambucto inform the user of this process.
162*0a6a1f1dSLionel SambucIt has the following grammar:
163*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
164*0a6a1f1dSLionel SambucDATA ::= INFO* TPS-COUNT TP-STANZA* INFO* EOF
165*0a6a1f1dSLionel SambucINFO ::= 'info' COLON STRING COMMA STRING NEWLINE
166*0a6a1f1dSLionel SambucTPS-COUNT ::= 'tps-count' COLON POSITIVE-NUMBER NEWLINE
167*0a6a1f1dSLionel SambucTP-STANZA ::= TP-START TC-STANZA* TC-END
168*0a6a1f1dSLionel SambucTP-START ::= 'tp-start' COLON TIMESTAMP COMMA STRING COMMA
169*0a6a1f1dSLionel Sambuc             POSITIVE-NUMBER NEWLINE
170*0a6a1f1dSLionel SambucTP-END ::= 'tc-end' COLON TIMESTAMP COMMA STRING (COMMA STRING)?
171*0a6a1f1dSLionel SambucTC-STANZA ::= TC-START (TC-SO | TC-SE)* TC-END
172*0a6a1f1dSLionel SambucTC-START ::= 'tc-start' COLON TIMESTAMP COMMA STRING NEWLINE
173*0a6a1f1dSLionel SambucTC-SO ::= 'tc-so' COLON STRING NEWLINE
174*0a6a1f1dSLionel SambucTC-SE ::= 'tc-se' COLON STRING NEWLINE
175*0a6a1f1dSLionel SambucTC-END ::= 'tc-end' COLON TIMESTAMP COMMA STRING COMMA TCR NEWLINE
176*0a6a1f1dSLionel SambucTCR ::= 'passed' | ('failed' | 'skipped') COMMA STRING
177*0a6a1f1dSLionel SambucTIMESTAMP ::= [0-9]+.[0-9]+
178*0a6a1f1dSLionel Sambuc.Ed
179*0a6a1f1dSLionel Sambuc.Pp
180*0a6a1f1dSLionel SambucThe meaning of the constructions above is:
181*0a6a1f1dSLionel Sambuc.Bl -tag -width TPSXCOUNTXX
182*0a6a1f1dSLionel Sambuc.It TPS-COUNT
183*0a6a1f1dSLionel SambucIndicates the number of test programs that will be executed.
184*0a6a1f1dSLionel SambucThere will be this exact amount of
185*0a6a1f1dSLionel Sambuc.Sq TP-STANZA
186*0a6a1f1dSLionel Sambucconstructions following it.
187*0a6a1f1dSLionel Sambuc.It TP-START
188*0a6a1f1dSLionel SambucIndicates the beginning of a test program.
189*0a6a1f1dSLionel SambucThis includes the program's name and the amount of test cases that
190*0a6a1f1dSLionel Sambucwill follow.
191*0a6a1f1dSLionel Sambuc.It TP-END
192*0a6a1f1dSLionel SambucIndicates the completion of a test program.
193*0a6a1f1dSLionel SambucThis is followed by the program's name and, if the program ended
194*0a6a1f1dSLionel Sambucprematurely, an error message indicating the reason of its failure.
195*0a6a1f1dSLionel SambucA successful execution of a test program (regardless of the status of its
196*0a6a1f1dSLionel Sambuctest cases) must not be accompanied by any reason.
197*0a6a1f1dSLionel Sambuc.It TC-START
198*0a6a1f1dSLionel SambucIndicates the beginning of a test case.
199*0a6a1f1dSLionel SambucThis is accompanied by the test case's name.
200*0a6a1f1dSLionel Sambuc.It TC-SO
201*0a6a1f1dSLionel SambucContains a text line sent to the standard output stream during the
202*0a6a1f1dSLionel Sambucexecution of the test case.
203*0a6a1f1dSLionel SambucLeading and trailing space is preserved.
204*0a6a1f1dSLionel Sambuc.It TC-SE
205*0a6a1f1dSLionel SambucContains a text line sent to the standard error stream during the
206*0a6a1f1dSLionel Sambucexecution of the test case.
207*0a6a1f1dSLionel SambucLeading and trailing space is preserved.
208*0a6a1f1dSLionel Sambuc.It TC-END
209*0a6a1f1dSLionel SambucIndicates the completion of a test case.
210*0a6a1f1dSLionel SambucThis is accompanied by the test case's name, its result and the reason
211*0a6a1f1dSLionel Sambucassociated with this result (if applicable).
212*0a6a1f1dSLionel Sambuc.El
213*0a6a1f1dSLionel Sambuc.Pp
214*0a6a1f1dSLionel SambucAn example:
215*0a6a1f1dSLionel Sambuc.Bd -literal -offset indent
216*0a6a1f1dSLionel Sambuctps-count: 2
217*0a6a1f1dSLionel Sambuctp-start: calculator, 1324318951.838923, 2
218*0a6a1f1dSLionel Sambuctc-start: add, 1324318951.839101
219*0a6a1f1dSLionel Sambuctc-end: add, 1324318951.839500, passed
220*0a6a1f1dSLionel Sambuctc-start: subtract, 1324318951.840001
221*0a6a1f1dSLionel Sambuctc-so: 3-2 expected to return 1 but got 0
222*0a6a1f1dSLionel Sambuctc-end: subtract, 1324318952.000123, failed, Calculated an unexpected value
223*0a6a1f1dSLionel Sambuctp-end: calculator, 1324318952.002301
224*0a6a1f1dSLionel Sambuctp-start: files, 1, 1324318952.502348
225*0a6a1f1dSLionel Sambuctc-start: copy, 1324318952.508291
226*0a6a1f1dSLionel Sambuctc-se: could not find the cp(1) utility
227*0a6a1f1dSLionel Sambuctc-end: copy, 1324318953.203145, skipped
228*0a6a1f1dSLionel Sambuctp-end: files, 1324318953.203800
229*0a6a1f1dSLionel Sambuc.Ed
230*0a6a1f1dSLionel Sambuc.Sh SEE ALSO
231*0a6a1f1dSLionel Sambuc.Xr atf 7
232