1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
|
## Process this file with automake to produce Makefile.in -*-Makefile-*-.
# Sort in traditional ASCII order, regardless of the current locale;
# otherwise we may get into trouble with distinct strings that the
# current locale considers to be equal.
ASSORT = LC_ALL=C sort
EXTRA_DIST = \
Coreutils.pm \
CuTmpdir.pm \
Makefile.am.in \
README \
check.mk \
envvar-check \
input-tty \
lang-default \
mk-script \
other-fs-tmpdir \
require-perl \
sample-test \
setgid-check \
test-lib.sh
## N O T E :: Do not add more names to this list.
## N O T E :: Even these are expected to go away.
SUBDIRS = join pr tail
root_tests = \
chown/basic \
cp/cp-a-selinux \
cp/preserve-gid \
cp/special-bits \
ls/nameless-uid \
misc/chcon \
misc/selinux \
mkdir/writable-under-readonly \
mv/sticky-to-xpart \
rm/fail-2eperm \
rm/no-give-up \
rm/one-file-system \
tail-2/append-only \
touch/now-owned-by-other
.PHONY: check-root
check-root:
$(MAKE) check TESTS='$(root_tests)' SUBDIRS=
check-recursive: root-hint
# Advertise `check-root' target.
.PHONY: root-hint
root-hint:
@echo '***********************************************************'
@echo "NOTICE: Some tests may be run only as root."
@echo " See the 'Running tests as root' section in README."
@echo '***********************************************************'
EXTRA_DIST += $(TESTS)
# Do not choose a name that is a shell keyword like 'if', or a
# commonly-used utility like 'cat' or 'test', as the name of a test.
# Otherwise, VPATH builds will fail on hosts like Solaris, since they
# will expand 'if test ...' to 'if .../test ...', and the '.../test'
# will execute the test script rather than the standard utility.
# Regarding ordering in SUBDIRS, place early in the list the tools that
# are most commonly used in test scripts. Nearly every test script uses
# rm and chmod, so they appear early in the list.
# Notes on the ordering of these tests:
# help-version comes early because it's a basic sanity test.
# Put seq early, since lots of other tests use it.
# Put tests that sleep early, but not all together, so in parallel builds
# they share time with tests that burn CPU, not with others that sleep.
# Put head-elide-tail early, because it's long-running.
TESTS = \
misc/help-version \
rm/cycle \
chmod/no-x \
chgrp/basic \
rm/dangling-symlink \
misc/ls-time \
rm/deep-1 \
rm/deep-2 \
rm/dir-no-w \
rm/dir-nonrecur \
rm/dot-rel \
rm/isatty \
rm/empty-inacc \
rm/empty-name \
rm/f-1 \
rm/fail-eacces \
rm/fail-eperm \
tail-2/assert \
rm/hash \
rm/i-1 \
rm/i-never \
rm/i-no-r \
tail-2/infloop-1 \
rm/ignorable \
rm/inaccessible \
rm/interactive-always \
rm/interactive-once \
rm/ir-1 \
rm/r-1 \
rm/r-2 \
rm/r-3 \
rm/r-4 \
rm/readdir-bug \
rm/rm1 \
touch/empty-file \
rm/rm2 \
rm/rm3 \
rm/rm4 \
rm/rm5 \
rm/sunos-1 \
rm/unread2 \
rm/unread3 \
rm/unreadable \
rm/v-slash \
chgrp/default-no-deref \
chgrp/deref \
chgrp/no-x \
chgrp/posix-H \
chgrp/recurse \
misc/test \
misc/seq \
misc/head \
misc/head-elide-tail \
tail-2/tail-n0f \
misc/ls-misc \
misc/date \
misc/ptx-overrun \
misc/xstrtol \
misc/od \
misc/mktemp \
misc/arch \
misc/pr \
misc/df-P \
misc/pwd-unreadable-parent \
misc/chcon-fail \
misc/selinux \
misc/cut \
misc/wc \
misc/wc-files0-from \
misc/wc-files0 \
misc/cat-proc \
misc/base64 \
misc/basename \
misc/close-stdout \
misc/csplit \
misc/date-sec \
misc/dircolors \
misc/df \
misc/dirname \
misc/expand \
misc/expr \
misc/factor \
misc/false-status \
misc/fmt \
misc/fmt-long-line \
misc/fold \
misc/groups-dash \
misc/groups-version \
misc/head-c \
misc/head-pos \
misc/id-context \
misc/md5sum \
misc/md5sum-newline \
misc/mknod \
misc/nice \
misc/nl \
misc/nohup \
misc/od-N \
misc/od-x8 \
misc/paste \
misc/pathchk1 \
misc/printf \
misc/printf-hex \
misc/printf-surprise \
misc/pwd-long \
misc/readlink-fp-loop \
misc/runcon-no-reorder \
misc/sha1sum \
misc/sha1sum-vec \
misc/sha224sum \
misc/sha256sum \
misc/sha384sum \
misc/sha512sum \
misc/shred-exact \
misc/shred-remove \
misc/shuf \
misc/sort \
misc/sort-compress \
misc/sort-merge \
misc/sort-rand \
misc/split-a \
misc/split-fail \
misc/split-l \
misc/stat-fmt \
misc/stat-printf \
misc/stty \
misc/stty-invalid \
misc/stty-row-col \
misc/sum \
misc/sum-sysv \
misc/tac \
misc/tac-continue \
misc/tee \
misc/tee-dash \
misc/test-diag \
misc/tr \
misc/tsort \
misc/tty-eof \
misc/unexpand \
misc/uniq \
chmod/c-option \
chmod/equal-x \
chmod/equals \
chmod/inaccessible \
chmod/octal \
chmod/setgid \
chmod/thru-dangling \
chmod/umask-x \
chmod/usage \
chown/deref \
chown/preserve-root \
chown/separator \
cp/abuse \
cp/acl \
cp/backup-1 \
cp/backup-dir \
cp/backup-is-src \
cp/cp-HL \
cp/cp-deref \
cp/cp-i \
cp/cp-mv-backup \
cp/cp-parents \
cp/deref-slink \
cp/dir-rm-dest \
cp/dir-slash \
cp/dir-vs-file \
cp/existing-perm-race \
cp/fail-perm \
cp/file-perm-race \
cp/into-self \
cp/link \
cp/link-no-deref \
cp/link-preserve \
cp/no-deref-link1 \
cp/no-deref-link2 \
cp/no-deref-link3 \
cp/parent-perm \
cp/parent-perm-race \
cp/perm \
cp/preserve-2 \
cp/proc-zero-len \
cp/r-vs-symlink \
cp/same-file \
cp/slink-2-slink \
cp/sparse \
cp/special-f \
cp/src-base-dot \
cp/symlink-slash \
cp/thru-dangling \
dd/misc \
dd/not-rewound \
dd/skip-seek \
dd/skip-seek2 \
dd/unblock-sync \
du/2g \
du/8gb \
du/basic \
du/deref \
du/deref-args \
du/exclude \
du/fd-leak \
du/files0-from \
du/hard-link \
du/inacc-dest \
du/inacc-dir \
du/inaccessible-cwd \
du/long-from-unreadable \
du/long-sloop \
du/no-deref \
du/no-x \
du/one-file-system \
du/restore-wd \
du/slash \
du/slink \
du/trailing-slash \
du/two-args \
install/basic-1 \
install/create-leading \
install/d-slashdot \
install/trap \
ln/backup-1 \
ln/hard-backup \
ln/misc \
ln/sf-1 \
ln/target-1 \
ls/color-dtype-dir \
ls/dangle \
ls/dired \
ls/file-type \
ls/follow-slink \
ls/infloop \
ls/inode \
ls/m-option \
ls/no-arg \
ls/proc-selinux-segfault \
ls/recursive \
ls/rt-1 \
ls/stat-dtype \
ls/stat-failed \
ls/stat-free-symlinks \
ls/stat-vs-dirent \
ls/symlink-slash \
ls/x-option \
mkdir/p-1 \
mkdir/p-2 \
mkdir/p-3 \
mkdir/p-slashdot \
mkdir/p-thru-slink \
mkdir/p-v \
mkdir/parents \
mkdir/perm \
mkdir/selinux \
mkdir/special-1 \
mkdir/t-slash \
mv/acl \
mv/atomic \
mv/atomic2 \
mv/backup-dir \
mv/backup-is-src \
mv/childproof \
mv/diag \
mv/dir-file \
mv/dir2dir \
mv/dup-source \
mv/force \
mv/hard-2 \
mv/hard-3 \
mv/hard-4 \
mv/hard-link-1 \
mv/hard-verbose \
mv/i-1 \
mv/i-2 \
mv/i-3 \
mv/i-4 \
mv/i-5 \
mv/i-link-no \
mv/into-self \
mv/into-self-2 \
mv/into-self-3 \
mv/into-self-4 \
mv/leak-fd \
mv/mv-special-1 \
mv/no-target-dir \
mv/part-fail \
mv/part-hardlink \
mv/part-rename \
mv/part-symlink \
mv/partition-perm \
mv/perm-1 \
mv/reply-no \
mv/to-symlink \
mv/trailing-slash \
mv/update \
readlink/can-e \
readlink/can-f \
readlink/can-m \
readlink/rl-1 \
rmdir/fail-perm \
rmdir/ignore \
rmdir/t-slash \
tail-2/assert-2 \
tail-2/big-4gb \
tail-2/proc-ksyms \
tail-2/start-middle \
touch/dangling-symlink \
touch/dir-1 \
touch/fail-diag \
touch/fifo \
touch/no-create-missing \
touch/no-rights \
touch/not-owner \
touch/obsolescent \
touch/read-only \
touch/relative \
$(root_tests)
include $(top_srcdir)/tests/check.mk
|