Update QA tests and host configs.
[xfstests-dev.git] / 005
1 #! /bin/sh
2 # FS QA Test No. 005
3 #
4 # Test symlinks & ELOOP
5 #
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.
12 #
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.
17 #
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
21 #  USA
22 #
23 #  Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
24 #  Mountain View, CA 94043, USA, or: http://www.sgi.com
25 #-----------------------------------------------------------------------
26 #
27 # creator
28 owner=dxm@sgi.com
29
30 #
31 # note ELOOP limit used to be 32 but changed to 8. Who knows what
32 # it might be next.
33 #
34
35 seq=`basename $0`
36 echo "QA output created by $seq"
37
38 here=`pwd`
39 tmp=/tmp/$$
40 status=0        # success is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
42
43 _cleanup()
44 {
45     cd $testdir
46     rm -f symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9} symlink_self empty_file
47     cd /
48     _cleanup_testdir
49 }
50
51 _touch()
52 {
53     touch $@ 2>&1 | sed \
54         -e "s/creating \`//g" \
55         -e "s/setting times of \`//g" \
56         -e "s/cannot touch \`//g" \
57         -e "s/'//g"
58 }
59
60 # get standard environment, filters and checks
61 . ./common.rc
62 . ./common.filter
63
64 # link correct .out file
65 _link_out_file $seq.out
66
67 # real QA test starts here
68 _supported_fs xfs udf nfs
69
70 # IRIX UDF does not support symlinks
71 if [ $FSTYP == 'udf' ]; then
72     _supported_os Linux
73 else
74     _supported_os Linux IRIX
75 fi
76
77 _setup_testdir
78
79 cd $testdir
80
81 o=empty_file
82 _touch $o
83 for f in symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
84 do
85     ln -s $o $f
86     o=$f
87 done
88
89 ln -s symlink_self symlink_self
90
91 echo "*** touch deep symlinks"
92 echo ""
93 _touch symlink_{0,1,2,3}{0,1,2,3,4,5,6,7,8,9}
94 echo ""
95 echo "*** touch recusive symlinks"
96 echo ""
97 _touch symlink_self
98
99
100
101 exit