8
8
.\" source. A copy of the CDDL is also available via the Internet at
9
9
.\" http://www.illumos.org/license/CDDL.
10
10
.\"
11
- .\"
12
11
.\" Copyright (c) 2012 by Delphix. All rights reserved.
13
12
.\"
14
- .Dd March 10, 2020
13
+ .Dd May 26, 2021
15
14
.Dt RUN 1
16
15
.Os
17
16
.
45
44
.
46
45
.Sh DESCRIPTION
47
46
.Nm
48
- command has three basic modes of operation. With neither
47
+ command has three basic modes of operation.
48
+ With neither
49
49
.Fl c
50
50
nor
51
51
.Fl w ,
52
52
.Nm
53
53
processes the arguments provided on
54
- the command line, adding them to the list for this run. If a specified
54
+ the command line, adding them to the list for this run.
55
+ If a specified
55
56
.Ar pathname
56
- is an executable file, it is added as a test. If a specified
57
+ is an executable file, it is added as a test.
58
+ If a specified
57
59
.Ar pathname
58
60
is a directory, the behavior depends upon the presence of
59
61
.Fl g .
60
62
If
61
63
.Fl g
62
- is specified, the directory is treated as a test group. See the
63
- section on
64
+ is specified, the directory is treated as a test group.
65
+ See the section on
64
66
.Sy Test Groups
65
- below. Without
67
+ below.
68
+ Without
66
69
.Fl g ,
67
70
.Nm
68
71
simply descends into the directory looking for executable files.
@@ -76,8 +79,8 @@ Rather than executing the tests and logging the results, the test configuration
76
79
is stored in a
77
80
.Ar runfile ,
78
81
which can be used in future invocations, or edited
79
- to modify which tests are executed and which options are applied. Options
80
- included on the command line with
82
+ to modify which tests are executed and which options are applied.
83
+ Options included on the command line with
81
84
.Fl w
82
85
become defaults in the
83
86
.Ar runfile .
@@ -92,20 +95,23 @@ The tests are then executed, and the results are logged.
92
95
.
93
96
.Ss Test Groups
94
97
A test group is comprised of a set of executable files, all of which exist in
95
- one directory. The options specified on the command line or in a
98
+ one directory.
99
+ The options specified on the command line or in a
96
100
.Ar runfile
97
- apply to individual tests in the group. The exception is options pertaining to
98
- pre and post scripts, which act on all tests as a group. Rather than running
99
- before and after each test, these scripts are run only once each at the start
100
- and end of the test group.
101
+ apply to individual tests in the group.
102
+ The exception is options pertaining to pre and post scripts, which act on all tests as a group.
103
+ Rather than running before and after each test,
104
+ these scripts are run only once each at the start and end of the test group.
101
105
.Ss Test Execution
102
106
The specified tests run serially, and are typically assigned results according
103
- to exit values. Tests that exit zero and non-zero are marked
107
+ to exit values.
108
+ Tests that exit zero and non-zero are marked
104
109
.Sy PASS
105
110
and
106
111
.Sy FAIL ,
107
- respectively. When a pre script fails for a test group, only the post script is
108
- executed, and the remaining tests are marked
112
+ respectively.
113
+ When a pre script fails for a test group, only the post script is executed,
114
+ and the remaining tests are marked
109
115
.Sy SKIPPED .
110
116
Any test that exceeds
111
117
its
@@ -114,30 +120,31 @@ is terminated, and marked
114
120
.Sy KILLED .
115
121
.Pp
116
122
By default, tests are executed with the credentials of the
117
- .Sy
123
+ .Nm
118
124
script.
119
125
Executing tests with other credentials is done via
120
126
.Xr sudo 1m ,
121
127
which must
122
- be configured to allow execution without prompting for a password. Environment
123
- variables from the calling shell are available to individual tests. During test
124
- execution, the working directory is changed to
128
+ be configured to allow execution without prompting for a password.
129
+ Environment variables from the calling shell are available to individual tests.
130
+ During test execution, the working directory is changed to
125
131
.Ar outputdir .
126
132
.
127
133
.Ss Output Logging
128
134
By default,
129
135
.Nm
130
136
will print one line on standard output at the conclusion
131
- of each test indicating the test name, result and elapsed time. Additionally,
132
- for each invocation of
137
+ of each test indicating the test name, result and elapsed time.
138
+ Additionally, for each invocation of
133
139
.Nm ,
134
- a directory is created using the ISO 8601
135
- date format. Within this directory is a file named
140
+ a directory is created using the ISO 8601 date format.
141
+ Within this directory is a file named
136
142
.Sy log
137
143
containing all the
138
- test output with timestamps, and a directory for each test. Within the test
139
- directories, there is one file each for standard output, standard error and
140
- merged output. The default location for the
144
+ test output with timestamps, and a directory for each test.
145
+ Within the test directories, there is one file each for standard output,
146
+ standard error and merged output.
147
+ The default location for the
141
148
.Ar outputdir
142
149
is
143
150
.Pa /var/tmp/test_results .
@@ -150,11 +157,12 @@ The file has one section named
150
157
which contains configuration option
151
158
names and their values in
152
159
.Sy name No = Ar value
153
- format. The values in this section
154
- apply to all the subsequent sections, unless they are also specified there, in
155
- which case the default is overridden. The remaining section names are the
156
- absolute pathnames of files and directories, describing tests and test groups
157
- respectively. The legal option names are:
160
+ format.
161
+ The values in this section apply to all the subsequent sections,
162
+ unless they are also specified there, in which case the default is overridden.
163
+ The remaining section names are the absolute pathnames of files and directories,
164
+ describing tests and test groups respectively.
165
+ The legal option names are:
158
166
.Bl -tag -width " tests = ['filename', …]"
159
167
.It Sy outputdir No = Ar pathname
160
168
The name of the directory that holds test logs.
@@ -176,11 +184,12 @@ Execute the post script as
176
184
If
177
185
.Sy True ,
178
186
only the results summary is printed to standard out.
179
- .It Sy tests No = [ Ns Ar 'filename' Ns , … ]
187
+ .It Sy tests No = [ Ns Ar 'filename' , No … ]
180
188
Specify a list of
181
189
.Ar filenames
182
- for this test group. Only the basename of the
183
- absolute path is required. This option is only valid for test groups, and each
190
+ for this test group.
191
+ Only the basename of the absolute path is required.
192
+ This option is only valid for test groups, and each
184
193
.Ar filename
185
194
must be single quoted.
186
195
.It Sy timeout No = Ar n
@@ -199,8 +208,8 @@ Specify a
199
208
.Ar runfile
200
209
to be consumed by the run command.
201
210
.It Fl d
202
- Dry run mode. Execute no tests, but print a description of each test that would
203
- have been run.
211
+ Dry run mode.
212
+ Execute no tests, but print a description of each test that would have been run.
204
213
.It Fl g
205
214
Create test groups from any directories found while searching for tests.
206
215
.It Fl o Ar outputdir
@@ -217,13 +226,15 @@ after any test or test group.
217
226
Print only the results summary to the standard output.
218
227
.It Fl s Ar script
219
228
Run
220
- .Ar script as a failsafe after any test is killed.
229
+ .Ar script
230
+ as a failsafe after any test is killed.
221
231
.It Fl S Ar username
222
232
Execute the failsafe script as
223
233
.Ar username .
224
234
.It Fl t Ar n
225
235
Specify a timeout value of
226
- .Ar n seconds per test.
236
+ .Ar n
237
+ seconds per test.
227
238
.It Fl u Ar username
228
239
Execute tests or test groups as
229
240
.Ar username .
@@ -241,7 +252,7 @@ Execute the post script as
241
252
.
242
253
.Sh EXAMPLES
243
254
.Bl -tag -width " -h"
244
- .It Sy Example 1 Ns : Running ad-hoc tests.
255
+ .It Sy Example 1 : No Running ad-hoc tests.
245
256
This example demonstrates the simplest invocation of
246
257
.Nm .
247
258
.Bd -literal
@@ -257,7 +268,7 @@ Running Time: 00:00:07
257
268
Percent passed: 100.0%
258
269
Log directory: /var/tmp/test_results/20120923T180654
259
270
.Ed
260
- .It Sy Example 2 Ns : Creating a Ar runfile No for future use.
271
+ .It Sy Example 2 : No Creating a Ar runfile No for future use.
261
272
This example demonstrates creating a
262
273
.Ar runfile
263
274
with non-default options.
0 commit comments