4 # Test symlinks & ELOOP
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 # Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
24 # Mountain View, CA 94043, USA, or: http://www.sgi.com
25 #-----------------------------------------------------------------------
31 # Note1: On Linux, ELOOP limit used to be 32 but changed to 8, and lately
32 # its become 5. Who knows what it might be next.
33 # Note2: On IRIX, the limit is around the 30 mark.
35 # What we are looking for here is: no panic due to blowing the stack;
36 # and that the ELOOP error code is returned at some point (the actual
37 # limit point is unimportant, just checking that we do hit it).
41 echo "QA output created by $seq"
45 status=0 # success is the default!
46 trap "_cleanup; exit \$status" 0 1 2 3 15
51 rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
58 # On IRIX: Too many symbolic links in path name traversal
59 # On Linux: Too many levels of symbolic links
60 touch $@ 2>&1 | grep -q 'Too many.*symbolic links'
62 echo "ELOOP returned. Good."
64 echo "No ELOOP? Unexpected!"
68 # get standard environment, filters and checks
72 # real QA test starts here
73 _supported_fs xfs udf nfs
75 # IRIX UDF does not support symlinks
76 if [ $FSTYP == 'udf' ]; then
79 _supported_os Linux IRIX
88 for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
94 ln -s symlink_self symlink_self
96 echo "*** touch deep symlinks"
98 _touch symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
100 echo "*** touch recusive symlinks"