1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-27 01:26:05 +02:00
Files
coreutils/tests/rm/deep-1
Jim Meyering 9af79ee204 Remove `du' stack space test.
Apparently, `ulimit -s N' isn't portable enough.
This test will be restored (with a guard against losing ulimit)
in its own file later.
2004-02-06 16:47:07 +00:00

45 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
# This is a bit of a torture test for mkdir -p, too.
# 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.
if test "$VERBOSE" = yes; then
set -x
rm --version
fi
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp;tmp=$t0/$$
trap 'status=$?; cd $pwd; rm -rf $t0 && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
umask 022
fail=0
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
# 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.
k_deep=$k200$k200
# Create a directory in $tmp with lots of `k' components.
deep=$tmp$k_deep
mkdir -p $deep || fail=1
# Make sure the deep dir was created.
test -d $deep || fail=1
rm -r $tmp || fail=1
# Make sure all of $tmp was deleted.
test -d $tmp && fail=1
(exit $fail); exit