1*11be35a1SLionel Sambuc.\" Copyright 2012 Google Inc. 2*11be35a1SLionel Sambuc.\" All rights reserved. 3*11be35a1SLionel Sambuc.\" 4*11be35a1SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 5*11be35a1SLionel Sambuc.\" modification, are permitted provided that the following conditions are 6*11be35a1SLionel Sambuc.\" met: 7*11be35a1SLionel Sambuc.\" 8*11be35a1SLionel Sambuc.\" * Redistributions of source code must retain the above copyright 9*11be35a1SLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 10*11be35a1SLionel Sambuc.\" * Redistributions in binary form must reproduce the above copyright 11*11be35a1SLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 12*11be35a1SLionel Sambuc.\" documentation and/or other materials provided with the distribution. 13*11be35a1SLionel Sambuc.\" * Neither the name of Google Inc. nor the names of its contributors 14*11be35a1SLionel Sambuc.\" may be used to endorse or promote products derived from this software 15*11be35a1SLionel Sambuc.\" without specific prior written permission. 16*11be35a1SLionel Sambuc.\" 17*11be35a1SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18*11be35a1SLionel Sambuc.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19*11be35a1SLionel Sambuc.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20*11be35a1SLionel Sambuc.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21*11be35a1SLionel Sambuc.\" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22*11be35a1SLionel Sambuc.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23*11be35a1SLionel Sambuc.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24*11be35a1SLionel Sambuc.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25*11be35a1SLionel Sambuc.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26*11be35a1SLionel Sambuc.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27*11be35a1SLionel Sambuc.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28*11be35a1SLionel Sambuc.Dd June 16, 2012 29*11be35a1SLionel Sambuc.Dt ATF-RUN 1 30*11be35a1SLionel Sambuc.Os 31*11be35a1SLionel Sambuc.Sh NAME 32*11be35a1SLionel Sambuc.Nm atf-run 33*11be35a1SLionel Sambuc.Nd Kyua-based implementation of the deprecated atf-run 34*11be35a1SLionel Sambuc.Sh SYNOPSIS 35*11be35a1SLionel Sambuc.Nm 36*11be35a1SLionel Sambuc.Op Fl v Ar var=value Op .. Fl v Ar varN=valueN 37*11be35a1SLionel Sambuc.Op Ar test_program1 Op Ar .. test_programN 38*11be35a1SLionel Sambuc.Sh DESCRIPTION 39*11be35a1SLionel Sambuc.Em DISCLAIMER : 40*11be35a1SLionel SambucThis version of 41*11be35a1SLionel Sambuc.Nm 42*11be35a1SLionel Sambucprovides a reimplementation of ATF's execution engine built on top of Kyua. 43*11be35a1SLionel SambucThis is a transitional script and should only be considered a helper to 44*11be35a1SLionel Sambucmigrate away from ATF. 45*11be35a1SLionel SambucTherefore, this version of 46*11be35a1SLionel Sambuc.Nm 47*11be35a1SLionel Sambucmimics the 48*11be35a1SLionel Sambuc.Em behavior 49*11be35a1SLionel Sambucof the original 50*11be35a1SLionel Sambuc.Nm 51*11be35a1SLionel Sambucbut 52*11be35a1SLionel Sambuc.Em NOT 53*11be35a1SLionel Sambucthe specific output of the command. 54*11be35a1SLionel SambucThe output of this implementation is significantly different as that of the 55*11be35a1SLionel Sambucoriginal one. 56*11be35a1SLionel SambucPlease migrate to using 57*11be35a1SLionel Sambuc.Sq kyua test 58*11be35a1SLionel Sambucas soon as feasible. 59*11be35a1SLionel SambucSee the 60*11be35a1SLionel Sambuc.Sx Migration path 61*11be35a1SLionel Sambucsection below for further details. 62*11be35a1SLionel Sambuc.Pp 63*11be35a1SLionel Sambuc.Nm 64*11be35a1SLionel Sambucexecutes a collection of test programs or, in other words, a complete 65*11be35a1SLionel Sambuctest suite. 66*11be35a1SLionel SambucThe output generated by this tool is minimalistic: such output is only intended 67*11be35a1SLionel Sambucto keep track of what 68*11be35a1SLionel Sambuc.Nm 69*11be35a1SLionel Sambucis doing, as the execution of a test suite can take a long time. 70*11be35a1SLionel SambucIn order to obtain detailed reports, please see the 71*11be35a1SLionel Sambuc.Xr atf-report 1 72*11be35a1SLionel Sambucutility instead. 73*11be35a1SLionel Sambuc.Pp 74*11be35a1SLionel SambucThe list of test programs to execute is read from a 75*11be35a1SLionel Sambuc.Pa Kyuafile 76*11be35a1SLionel Sambucor an 77*11be35a1SLionel Sambuc.Pa Atffile 78*11be35a1SLionel Sambucfile present in the current directory, in this order. 79*11be35a1SLionel SambucThese files describe the test suite stored in the directory they live in, 80*11be35a1SLionel Sambucwhich aside from the list of test programs also includes meta-data and 81*11be35a1SLionel Sambucconfiguration variables. 82*11be35a1SLionel SambucIn those cases where only an Atffile exists, the 83*11be35a1SLionel Sambuc.Xr atf2kyua 1 84*11be35a1SLionel Sambucutility is used to convert the old Atffiles to new Kyuafiles in a temporary 85*11be35a1SLionel Sambucdirectory. 86*11be35a1SLionel Sambuc.Pp 87*11be35a1SLionel Sambuc.Nm 88*11be35a1SLionel Sambucis also in charge of reading the configuration files that tune the behavior 89*11be35a1SLionel Sambucof each test program and passing down the necessary variables to them. 90*11be35a1SLionel SambucMore details on how this is done are given in the 91*11be35a1SLionel Sambuc.Sx Configuration 92*11be35a1SLionel Sambucsection. 93*11be35a1SLionel Sambuc.Pp 94*11be35a1SLionel SambucIn the first synopsis form, 95*11be35a1SLionel Sambuc.Nm 96*11be35a1SLionel Sambucparses the 97*11be35a1SLionel Sambuc.Pa Atffile 98*11be35a1SLionel Sambucin the current directory and runs all the test programs specified in it. 99*11be35a1SLionel SambucIf any test program names are given as part of the command line, those are 100*11be35a1SLionel Sambucthe ones executed instead of the complete list. 101*11be35a1SLionel Sambuc.Pp 102*11be35a1SLionel SambucThe following options are available: 103*11be35a1SLionel Sambuc.Bl -tag -width XvXvarXvalueXX 104*11be35a1SLionel Sambuc.It Fl v Ar var=value 105*11be35a1SLionel SambucSets the configuration variable 106*11be35a1SLionel Sambuc.Ar var 107*11be35a1SLionel Sambucto the given value 108*11be35a1SLionel Sambuc.Ar value . 109*11be35a1SLionel Sambuc.El 110*11be35a1SLionel Sambuc.Ss Configuration 111*11be35a1SLionel Sambuc.Nm 112*11be35a1SLionel Sambucreads configuration data from multiple places. 113*11be35a1SLionel SambucAfter all of these places have been analyzed, a list of variable-value 114*11be35a1SLionel Sambucpairs are passed to the test programs to be run. 115*11be35a1SLionel Sambuc.Pp 116*11be35a1SLionel SambucThe following locations are scanned for configuration data, in order. 117*11be35a1SLionel SambucItems down the list override values defined above them: 118*11be35a1SLionel Sambuc.Bl -enum 119*11be35a1SLionel Sambuc.It 120*11be35a1SLionel SambucConfiguration variables defined in the system-wide configuration file 121*11be35a1SLionel Sambucshared among all test suites. 122*11be35a1SLionel SambucThis lives in 123*11be35a1SLionel Sambuc.Pa ${ATF_CONFDIR}/common.conf . 124*11be35a1SLionel Sambuc.It 125*11be35a1SLionel SambucConfiguration variables defined in the system-wide test-suite-specific 126*11be35a1SLionel Sambucconfiguration file. 127*11be35a1SLionel SambucThis lives in 128*11be35a1SLionel Sambuc.Pa ${ATF_CONFDIR}/<test-suite>.conf . 129*11be35a1SLionel Sambuc.It 130*11be35a1SLionel SambucConfiguration variables defined in the user-specific configuration file 131*11be35a1SLionel Sambucshared among all test suites. 132*11be35a1SLionel SambucThis lives in 133*11be35a1SLionel Sambuc.Pa ${HOME}/.atf/common.conf . 134*11be35a1SLionel Sambuc.It 135*11be35a1SLionel SambucConfiguration variables defined in the user-specific test-suite-specific 136*11be35a1SLionel Sambucconfiguration file. 137*11be35a1SLionel SambucThis lives in 138*11be35a1SLionel Sambuc.Pa ${HOME}/.atf/<test-suite>.conf . 139*11be35a1SLionel Sambuc.It 140*11be35a1SLionel SambucConfiguration variables provided as part of the command line through the 141*11be35a1SLionel Sambuc.Fl v 142*11be35a1SLionel Sambucoption. 143*11be35a1SLionel Sambuc.El 144*11be35a1SLionel Sambuc.Pp 145*11be35a1SLionel SambucThe value of 146*11be35a1SLionel Sambuc.Va ATF_CONFDIR 147*11be35a1SLionel Sambucin the above list is determined by the build settings of the 148*11be35a1SLionel Sambuc.Nm 149*11be35a1SLionel Sambucscript, but its value can be overriden by setting such variable in the 150*11be35a1SLionel Sambucenvironment. 151*11be35a1SLionel Sambuc.Pp 152*11be35a1SLionel SambucThe following configuration variables are globally recognized: 153*11be35a1SLionel Sambuc.Bl -tag -width XunprivilegedXuserXX 154*11be35a1SLionel Sambuc.It Va unprivileged-user 155*11be35a1SLionel SambucThe name of the system user that atf-run will drop root privileges into 156*11be35a1SLionel Sambucfor test cases defining 157*11be35a1SLionel Sambuc.Sq require.user=unprivileged . 158*11be35a1SLionel SambucNote that this is 159*11be35a1SLionel Sambuc.Em not provided for security purposes ; 160*11be35a1SLionel Sambucthis feature is only for the convenience of the user. 161*11be35a1SLionel Sambuc.El 162*11be35a1SLionel Sambuc.Ss Migration path 163*11be35a1SLionel SambucMoving from 164*11be35a1SLionel Sambuc.Nm 165*11be35a1SLionel Sambucto 166*11be35a1SLionel Sambuc.Sq kyua test 167*11be35a1SLionel Sambucis rather simple. 168*11be35a1SLionel Sambuc.Pp 169*11be35a1SLionel SambucThe first step is converting all of your Atffiles to Kyuafiles. 170*11be35a1SLionel SambucThe 171*11be35a1SLionel Sambuc.Xr atf2kyua 1 172*11be35a1SLionel Sambucscript will help you in performing this initial conversion. 173*11be35a1SLionel Sambuc.Pp 174*11be35a1SLionel SambucOnce all the Kyuafiles are in place, the following examples show how to 175*11be35a1SLionel Sambucconvert some common 176*11be35a1SLionel Sambuc.Nm 177*11be35a1SLionel Sambucinvocations to their corresponding 178*11be35a1SLionel Sambuc.Sq kyua test 179*11be35a1SLionel Sambucones. 180*11be35a1SLionel Sambuc.Bd -literal -offset indent 181*11be35a1SLionel Sambuc### Run all tests. 182*11be35a1SLionel Sambuc$ atf-run 183*11be35a1SLionel Sambuc$ kyua test 184*11be35a1SLionel Sambuc 185*11be35a1SLionel Sambuc### Run specific test programs. 186*11be35a1SLionel Sambuc$ atf-run dir1/foo_test bar_test 187*11be35a1SLionel Sambuc$ kyua test dir1/foo_test bar_test 188*11be35a1SLionel Sambuc 189*11be35a1SLionel Sambuc### Set configuration variables; foo is the name of your test suite. 190*11be35a1SLionel Sambuc$ atf-run -v unprivileged-user=nobody -v iterations=10 191*11be35a1SLionel Sambuc$ kyua test -v unprivileged-user=nobody -v test_suite.foo.iterations=10 192*11be35a1SLionel Sambuc.Ed 193*11be35a1SLionel Sambuc.Pp 194*11be35a1SLionel SambucThat said, 195*11be35a1SLionel Sambuc.Xr kyua 1 196*11be35a1SLionel Sambucis way more flexible than 197*11be35a1SLionel Sambuc.Nm 198*11be35a1SLionel Sambucever was. 199*11be35a1SLionel SambucPlease see Kyua's documentation or built-in command-line help to explore 200*11be35a1SLionel Sambucall the additional features included. 201*11be35a1SLionel Sambuc.Sh SEE ALSO 202*11be35a1SLionel Sambuc.Xr kyua 1 , 203*11be35a1SLionel Sambuc.Xr atf-report 1 204