1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-19 18:26:32 +02:00
Files
coreutils/tests/rm/deep-1

54 lines
1.1 KiB
Plaintext
Raw Normal View History

1997-08-02 17:10:12 +00:00
#!/bin/sh
# This is a bit of a torture test for mkdir -p, too.
1997-08-02 17:31:01 +00:00
# GNU rm performs *much* better on systems that have a d_type member
# in the directory structure because then it does only one stat per
# command line argument.
# If this test takes too long on your system, blame the OS.
1997-08-02 17:10:12 +00:00
: ${RM=rm}
: ${MKDIR=mkdir}
test=deep-1
1997-08-02 17:20:39 +00:00
# Don't require use of TMPDIR.
: ${RM_TMPDIR=.}
1997-08-02 17:10:12 +00:00
if test "$VERBOSE" = yes; then
set -x
$RM --version
fi
umask 022
fail=0
1997-08-02 17:20:39 +00:00
tmp=$RM_TMPDIR/t-rm.$$
1997-08-02 17:10:12 +00:00
k20=/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k/k
k200=$k20$k20$k20$k20$k20$k20$k20$k20$k20$k20
1997-08-02 17:36:07 +00:00
# Be careful not to exceed max file name length (usu 512?).
# Doing so wouldn't affect GNU mkdir or GNU rm, but any tool that
# operates on the full pathname (like `test') would choke.
1997-08-02 17:20:39 +00:00
k_deep=$k200$k200
1997-08-02 17:10:12 +00:00
1997-08-02 17:20:39 +00:00
# Create a directory in $tmp with lots of `k' components.
deep=$tmp$k_deep
1997-10-19 03:20:04 +00:00
echo "creating a hierarchy 400 deep in $tmp..." |tr -d '\012'
1997-08-02 17:10:12 +00:00
$MKDIR -p $deep || fail=1
1997-10-19 03:20:04 +00:00
echo done
1997-08-02 17:10:12 +00:00
# Make sure the deep dir was created.
test -d $deep || fail=1
1997-10-19 03:20:04 +00:00
echo "deleting $tmp..." |tr -d '\012'
1997-08-02 17:20:39 +00:00
$RM -r $tmp || fail=1
1997-10-19 03:20:04 +00:00
echo done
1997-08-02 17:10:12 +00:00
1997-08-02 17:36:07 +00:00
# Make sure all of $tmp was deleted.
test -d $tmp && fail=1
1997-08-02 17:10:12 +00:00
exit $fail