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