summaryrefslogtreecommitdiff
path: root/tests/rm/deep-1
blob: 171c567ba1e13878045dc51218ab9babbd8d5661 (plain)
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
#!/bin/sh

# This is a bit of a torture test for mkdir -p, too.

: ${RM=rm}
: ${MKDIR=mkdir}

test=deep-1

# Don't require use of TMPDIR.
: ${RM_TMPDIR=.}

if test "$VERBOSE" = yes; then
  set -x
  $RM --version
fi

umask 022

fail=0

tmp=$RM_TMPDIR/t-rm.$$

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
k_deep=$k200$k200

# Create a directory in $tmp with lots of `k' components.
deep=$tmp$k_deep
$MKDIR -p $deep || fail=1

find $tmp > k

# Make sure the deep dir was created.
test -d $deep || fail=1

$RM -r $tmp || fail=1

# Make sure it was deleted.
test -d $deep && fail=1

exit $fail