2 # Ensure that the size of a long-named-symlink is > 0.
4 if test "$VERBOSE" = yes; then
10 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
11 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
12 trap '(exit $?); exit $?' 1 2 13 15
15 mkdir -p $tmp || framework_failure=1
16 cd $tmp || framework_failure=1
18 # Determine if `.' is on a local (would non-NFS be sufficient?) file system.
19 # On at least some NFS implementations, symlinks never take up space,
20 df --local . | tail -n +2 > tmp
21 # So if this is a non-local file system, skip the test.
25 echo "$0: skipping this test, since \`.' is on a non-local file system" 1>&2
29 df --type=xfs . | tail -n +2 > tmp
31 # At least on Irix-6.5.19, when using an xfs file system,
32 # each created symlink (name lengths up to 255) would have a size of `0'.
33 echo "$0: skipping this test, since \`.' is on an XFS file system" 1>&2
37 if test $framework_failure = 1; then
38 echo "$0: failure in testing framework" 1>&2
43 symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
44 for len in $symlink_name_lengths; do
45 name=`seq 1 $len|tr -c x y |head -c$len`
46 # Record the names of symlinks that are successfully created.
47 ln -fs $name $len > /dev/null 2>&1 \
48 && symlinks="$symlinks $len"
51 du -a $symlinks > out || fail=1
53 # Require that at least one of these symlinks has a non-zero size.
54 grep '^[1-9]' out > /dev/null || fail=1
56 (exit $fail); exit $fail