chiark / gitweb /
64602d9b0ac555cb9c4cf1f3994b2343786b3e53
[autopkgtest.git] / runner / adt-run.1
1 .TH adt\-run 1 2007 autopkgtest "Linux Programmer's Manual"
2 .SH NAME
3 adt\-run \- test an installed binary package using the package's tests
4 .SH SYNOPSYS
5 .B adt\-run
6 .IR options ...
7 .B \-\-\-
8 .I virt\-server
9 .RI [ virt\-server\-arg ...]
10 .br
11 .SH DESCRIPTION
12 .B adt\-run
13 is the program for invoking the autopkgtest package testing machinery.
14
15 autopkgtest is a facility for testing binary packages, as installed on
16 a system (such as a testbed system).  The tests are those supplied in
17 the source package.
18
19 adt\-run runs each test supplied by a particular package and reports
20 the results.  It drives the specified virtualisation regime as
21 appropriate, and parses the test description metadata, and arranges
22 for data to be copied to and from the testbed as required.
23
24 adt\-run should be invoked (unless options to the contrary are
25 supplied) in the top level directory of the built source tree, on the
26 host.  The package should be installed on the testbed.
27
28 .SH PROCESSING INSTRUCTIONS
29 .TP
30 .BR --built-tree " " \fIdirectory\fR
31 Specifies that tests from the built source tree
32 .IR directory
33 should be run.  Note that the packages that would normally be
34 installed as a result of \fB*\fR in the tests' \fBDepends\fR field
35 (which includes the case where the \fBDepends\fR field is not
36 specified) are \fInot\fR installed.  The caller must explicitly
37 instruct \fBadt-run\fR to install any relevant packages.
38 .TP
39 .BR --source " " \fIdsc\fR
40 Builds \fIdsc\fR.  The resulting binaries will (by default) be used to
41 satisfy dependencies.  The tests from that built tree will also be run
42 (by default).  The ordering is significant: each \fB--source\fR option
43 should precede options whose dependencies are to be satisfied by the
44 binaries it produces.
45 .TP
46 .BR --unbuilt-tree " " \fIdirectory\fR
47 Specifies that tests from the unbuilt source tree
48 .IR directory
49 should be run.  This is very similar to specifing \fB--source\fR
50 except that a directory tree (which should be pristine) is supplied,
51 instead of a source package.
52 .TP
53 .BR --binary " " \fIdeb\fR
54 Specifies that \fIdeb\fR should be used.  By default it will be used
55 to satisfy dependencies, both during building and testing, but not
56 necessarily installed.  The ordering is significant, as for
57 \fB--source\fR.
58 .TP
59 .I filename
60 Bare filename arguments are processed as if
61 .BR --built-tree ", " --source ", " --unbuilt-tree " or " --binary
62 was specified; the nature of the argument is guessed from the form of
63 the filename.  In the case of \fB--built-tree\fR, either the
64 option must be specified, or the filename must end in a slash; two
65 slashes at the end are taken to mean \fB--unbuilt-tree\fR.
66 .SH PROCESSING OPTIONS
67 These affect modify processing instructions.  Unless stated
68 otherwise, they affect all subsequent options.
69 .TP
70 .BR --paths-testbed | --paths-host
71 Specifies that subsequent pathnames in command-line arguments refer to
72 files on the testbed, or on the host, respectively.  The default is
73 \fB--paths-host\fR.
74 .TP
75 .BR --sources-tests | --sources-no-tests
76 Specifies that the tests in subsequent \fB--source\fR and
77 \fB--unbuilt-tree\fR arguments should (or should not) be run.
78 .TP
79 .BR --built-binaries-filter= \fIpattern\fB,\fIpattern\fB,\fR...
80 Specifies that only binaries whose package names match one of the
81 specified patterns should be used; others will be ignored.  This
82 option applies to subsequent \fB--source\fR and \fB--unbuilt-tree\fR arguments.
83 .TP
84 .BR --no-built-binaries
85 Specifies that all built binaries should be ignored completely;
86 equivalent to
87 .BR --built-binaries-filter=_
88 (since no package name ever contains \fB_\fR).
89 .TP
90 .B --binaries=ignore | --binaries=auto | --binaries=install
91 Specifies that binary package (in subsequently specified
92 \fB--binary\fR arguments, or resulting from subsequently specified
93 \fB--source\fR or \fB--unbuilt-tree\fR arguments and not filtered out) should be ignored, used
94 only to satisfy dependencies, or installed unconditionally,
95 respectively.  Equivalent to specifying both
96 .BR --binaries-forbuilds " and " --binaries-fortests .
97 .TP
98 .BI --binaries-forbuilds= ...
99 Like \fB--binaries=\fR but only changes the handling during package
100 building: packages will be ignored, used for dependencies, or
101 unconditionally installed, when a source package is built.
102 .TP
103 .BI --binaries-fortests= ...
104 Like \fB--binaries=\fR but only changes the handling during testing:
105 packages will be ignored, used for dependencies (including as the
106 package under test), or unconditionally installed, when tests are run
107 (as a result of \fB--source\fR, \fB--built-tree\fR or \fB--unbuilt-tree\fR).
108 .SH OTHER OPTIONS
109 .TP
110 .BI --output-dir " " \fIoutput-dir\fR
111 Specifies that stderr and stdout from the tests should be placed in
112 .IR output-dir .
113 These files are named
114 .BI argid- test -stderr
115 and
116 .BI argid- test -stdout
117 for each test
118 .IR test ,
119 and
120 .BR log
121 for the log transcript.  If no \fIoutput-dir\fR is specified, or the
122 path is specified to be on the testbed (ie, if \fB--output-dir\fR
123 follows \fB--paths-testbed\fR), then the \fBlog\fR file is instead
124 written to the temporary directory \fItmpdir\fR if one was specified,
125 or otherwise no separate copy is made.  Note that the log transcript
126 output will also be sent to \fBadt-run\fR's stderr unless
127 \fB--quiet\fR is specified.
128 .TP
129 .BI --user= user
130 Run builds and tests as \fIuser\fR on the testbed.  This needs root on
131 the testbed; if root on the testbed is not available then builds and
132 tests run as whatever user is provided.
133 .TP
134 .BI --gain-root= gain-root
135 Prefixes
136 .B debian/rules binary
137 with
138 .RB gain-root .  The default is not to use anything, except that if
139 \fB--user\fR is supplied or root on the testbed is not available the
140 default is \fBfakeroot\fR.
141 .TP
142 .BI --tmp-dir= tmpdir
143 Specifies that \fItmpdir\fR should be used instead of a fresh
144 temporary directory on the host.  \fItmpdir\fR will be created if
145 necessary, and emptied of all of its contents before \fBadt-run\fR
146 starts, and it will not be cleaned out afterwards.  \fItmpdir\fR is
147 not affected by \fB--paths-testbed\fR.
148 .B NOTE
149 again that all of the contents of \fItmpdir\fR will be \fBdeleted\fR.
150 .TP
151 .BI --log-file= logfile
152 Specifies that the trace log should be written to \fIlogfile\fR
153 instead of to \fBlog\fR in \fIoutput-dir\fR or \fItmpdir\fR.
154 \fIlog-file\fR is not affected by \fB--paths-testbed\fR.
155 .TP
156 .BI --gnupg-home= dir
157 Uses \fIdir\fR as the \fBGNUPGHOME\fR for local apt archive signing.
158 The specified directory should not contain keyrings containing other
159 unrelated keys, since \fBadt-run\fR does not specify to \fBgpg\fR
160 which keys to use.  The default is
161 .BR $HOME/.autopkgtest .
162 \fB--paths-testbed\fR has no effect on this option.
163 .TP
164 .B --gnupg-home=fresh
165 Use a fresh temporary directory and generate fresh keys each run.
166 This can be very slow and depends on the availability of sufficient
167 quantities of high-quality entropy.
168 .TP
169 .BR -q " | " --quiet
170 Do not send a copy of \fBadt-run\fR's trace logstream to stderr.  This
171 option does not affect the copy sent to \fIlogfile\fR,
172 \fIoutput-dir\fR or \fItmpdir\fR.  Note that without the trace
173 logstream it can be very hard to diagnose problems.
174 .TP
175 \fB---\fR \fIvirt-server virt-server-arg\fR...
176 Specifies the virtualisation regime server, as a command and arguments
177 to invoke.  All the remaining arguments and options after
178 .B ---
179 are passed to the virtualisation server program.
180
181 .SH OUTPUT FORMAT
182 During a normal test run, one line is printed for each test.  This
183 consists of a short string identifying the test, some horizontal
184 whitespace, and either
185 .B PASS
186 or
187 .BR FAIL " reason"
188 or
189 .BR SKIP " reason"
190 where the pass/fail indication is separated by any reason by some
191 horizontal whitespace.
192
193 The string to identify the test consists of a short alphanumeric
194 string invented by \fBadt-run\fR to distinguish different command-line
195 arguments, the \fIargid\fR, followed by a hyphen and the test name.
196
197 Sometimes a
198 .B SKIP
199 will be reported when the name of the test is not known or not
200 applicable: for example, when there are no tests in the package, or a
201 there is a test stanza which contains features not understood by this
202 version of
203 .BR adt-run .
204 In this case
205 .B *
206 will appear where the name of the test should be.
207
208 If \fBadt-run\fR detects that erroneous package(s) are involved, it
209 will print the two lines
210 .BR "blame: " \fIblamed-thing\fR ...
211 and
212 .BR "badpkg: " \fImessage\fR.
213 Here each whitespace-separated \fIblamed-thing\fR is one of
214 .BI arg: argument
215 (representing a pathname found in a command line argument),
216 .BI dsc: package
217 (a source package name),
218 .BI deb: package
219 (a binary package name)
220 or possibly other strings to be determined.  This indicates which
221 arguments and/or packages might have contributed to the problem; the
222 ones which were processed most recently and which are therefore most
223 likely to be the cause of a problem are listed last.
224
225 .SH EXIT STATUS
226 0       all tests passed
227 .br
228 1       unexpected failure (the python interpreter invents this exit status)
229 .br
230 2       at least one test skipped
231 .br
232 4       at least one test failed
233 .br
234 6       at least one test failed and at least one test skipped
235 .br
236 8       no tests in this package
237 .br
238 12      erroneous package
239 .br
240 16      testbed failure
241 .br
242 20      other unexpected failures including bad usage
243
244 .SH SEE ALSO
245 \fBadt-virt-chroot\fR(1), \fBadt-virt-xenlvm\fR(1)
246
247 .SH BUGS
248 This tool still lacks some important features and is not very
249 well-tested.
250
251 .SH AUTHORS AND COPYRIGHT
252 This manpage is part of autopkgtest, a tool for testing Debian binary
253 packages.  autopkgtest is Copyright (C) 2006-1007 Canonical Ltd and
254 others.
255
256 See \fB/usr/share/doc/autopkgtest/CREDITS\fR for the list of
257 contributors and full copying conditions.