3 #-----------------------------------------------------------------------
4 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # Test some parent ptr stuff
26 owner=tes@crackle.melbourne.sgi.com
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
45 _path=$1 # might want to only check this path
50 if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
58 echo "Print out hardlink names for given path, $1"
61 xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
70 # Test out some creations
82 p=dir2/dir3/dir4/file4
85 #_print_names $p >>$here/$seq.full
86 _print_names $p | tee -a $here/$seq.full
88 _check_paths $SCRATCH_MNT/$p
94 echo "Testing symlink"
105 _check_paths $SCRATCH_MNT/symlink1
106 _check_paths $SCRATCH_MNT/hlink1
107 _check_paths $SCRATCH_MNT/hlink2
108 _check_paths $SCRATCH_MNT/hlink3
112 # create hardlinks from the same dir
113 # and some from different dirs
115 # test out removing hardlinks too
120 echo "Testing hardlink"
131 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
136 _print_names $p >>$here/$seq.full
139 echo "print out names and check after created hardlinks"
142 _print_names $x | tee -a $here/$seq.full
143 _check_paths $SCRATCH_MNT/$x
148 echo "now try removing half of the hardlinks"
150 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
155 if [ $j -eq 0 ]; then
162 echo "print out names and check after removed hardlinks"
166 _print_names $x | tee -a $here/$seq.full
167 _check_paths $SCRATCH_MNT/$x
174 # in dir, file1 to file2 where file2 does not exist
175 # in dir, file1 to file2 where file2 does exist
176 # dir/file1 to dir2/file2 where file2 does not exist
177 # dir/file1 to dir2/file2 where file2 does exist
178 # dir to dir2 where dir2 does not exist
179 # dir to dir/dir3 - not allowed
185 echo "Testing rename"
189 echo "1. in dir, file1 to file2 where file2 does not exist"
191 d1=$SCRATCH_MNT/ren1/ren2/ren3/ren4
200 echo "2. in dir, file1 to file2 where file2 does exist"
207 echo "3. dir/file1 to dir2/file2 where file2 does not exist"
209 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
217 echo "4. dir/file1 to dir2/file2 where file2 does exist"
219 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
226 echo "5. dir to dir2 where dir2 does not exist"
228 d3=$SCRATCH_MNT/ren1/ren2/ren3/ren6
235 tee -a $here/$seq.full |\
236 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
237 -e 's/[0-9][0-9]* paths/P paths/g' \
238 -e 's/seed = [0-9][0-9]*/seed = S/'
245 echo "Testing fsstress"
248 out=$SCRATCH_MNT/fsstress.$$
251 -f rmdir=10 -f link=10 -f creat=10 \
252 -f mkdir=10 -f rename=30 -f unlink=10 \
254 -n $count -d $out -p 3"
256 echo "fsstress $args" | sed -e "s#$out#outdir#"
257 if ! $FSSTRESS_PROG $args | _filter_num
259 echo " fsstress $args returned $?"
260 cat $tmp.out | tee -a $here/$seq.full
271 echo "Testing dirstress"
274 out=$SCRATCH_MNT/dirstress.$$
279 echo "!! couldn't mkdir $out"
284 args="-d $out -f $count -k -p 3 -n 1"
285 echo "dirstress $args" | sed -e "s#$out#outdir#"
286 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
288 echo " dirstress failed"
289 echo "*** dirstress $args" | tee -a $here/$seq.full
290 cat $tmp.out >>$here/$seq.full
295 args="-d $out -f $count -k -p 3 -n 5"
296 echo "dirstress $args" | sed -e "s#$out#outdir#"
297 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
299 echo " dirstress failed"
300 echo "*** dirstress $args" | tee -a $here/$seq.full
301 cat $tmp.out >>$here/$seq.full
309 # get standard environment, filters and checks
319 rm -f $here/$seq.full
322 _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \
323 || _fail "mkfs scratch failed"
324 _scratch_mkfs_xfs -i parent=1 >>$here/$seq.full 2>&1 \
325 || _notrun "parent inodes not supported"
328 _scratch_mount >>$here/$seq.full 2>&1 \
329 || _fail "mount failed: $MOUNT_OPTIONS"
331 # real QA test starts here
340 # stress testing with verification by parent checking programs