4 # Test some parent ptr stuff
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
11 owner=tes@crackle.melbourne.sgi.com
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
30 _path=$1 # might want to only check this path
35 if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
43 echo "Print out hardlink names for given path, $1"
46 xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
55 # Test out some creations
67 p=dir2/dir3/dir4/file4
70 #_print_names $p >>$here/$seq.full
71 _print_names $p | tee -a $here/$seq.full
73 _check_paths $SCRATCH_MNT/$p
79 echo "Testing symlink"
90 _check_paths $SCRATCH_MNT/symlink1
91 _check_paths $SCRATCH_MNT/hlink1
92 _check_paths $SCRATCH_MNT/hlink2
93 _check_paths $SCRATCH_MNT/hlink3
97 # create hardlinks from the same dir
98 # and some from different dirs
100 # test out removing hardlinks too
105 echo "Testing hardlink"
116 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
121 _print_names $p >>$here/$seq.full
124 echo "print out names and check after created hardlinks"
127 _print_names $x | tee -a $here/$seq.full
128 _check_paths $SCRATCH_MNT/$x
133 echo "now try removing half of the hardlinks"
135 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
140 if [ $j -eq 0 ]; then
147 echo "print out names and check after removed hardlinks"
151 _print_names $x | tee -a $here/$seq.full
152 _check_paths $SCRATCH_MNT/$x
159 # in dir, file1 to file2 where file2 does not exist
160 # in dir, file1 to file2 where file2 does exist
161 # dir/file1 to dir2/file2 where file2 does not exist
162 # dir/file1 to dir2/file2 where file2 does exist
163 # dir to dir2 where dir2 does not exist
164 # dir to dir/dir3 - not allowed
170 echo "Testing rename"
174 echo "1. in dir, file1 to file2 where file2 does not exist"
176 d1=$SCRATCH_MNT/ren1/ren2/ren3/ren4
185 echo "2. in dir, file1 to file2 where file2 does exist"
192 echo "3. dir/file1 to dir2/file2 where file2 does not exist"
194 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
202 echo "4. dir/file1 to dir2/file2 where file2 does exist"
204 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
211 echo "5. dir to dir2 where dir2 does not exist"
213 d3=$SCRATCH_MNT/ren1/ren2/ren3/ren6
220 tee -a $here/$seq.full |\
221 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
222 -e 's/[0-9][0-9]* paths/P paths/g' \
223 -e 's/seed = [0-9][0-9]*/seed = S/'
230 echo "Testing fsstress"
233 out=$SCRATCH_MNT/fsstress.$$
236 -f rmdir=10 -f link=10 -f creat=10 \
237 -f mkdir=10 -f rename=30 -f unlink=10 \
239 -n $count -d $out -p 3"
241 echo "fsstress $args" | sed -e "s#$out#outdir#"
242 if ! $FSSTRESS_PROG $args | _filter_num
244 echo " fsstress $args returned $?"
245 cat $tmp.out | tee -a $here/$seq.full
256 echo "Testing dirstress"
259 out=$SCRATCH_MNT/dirstress.$$
264 echo "!! couldn't mkdir $out"
269 args="-d $out -f $count -k -p 3 -n 1"
270 echo "dirstress $args" | sed -e "s#$out#outdir#"
271 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
273 echo " dirstress failed"
274 echo "*** dirstress $args" | tee -a $here/$seq.full
275 cat $tmp.out >>$here/$seq.full
280 args="-d $out -f $count -k -p 3 -n 5"
281 echo "dirstress $args" | sed -e "s#$out#outdir#"
282 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
284 echo " dirstress failed"
285 echo "*** dirstress $args" | tee -a $here/$seq.full
286 cat $tmp.out >>$here/$seq.full
294 # get standard environment, filters and checks
304 rm -f $here/$seq.full
307 _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \
308 || _fail "mkfs scratch failed"
309 _scratch_mkfs_xfs -i parent=1 >>$here/$seq.full 2>&1 \
310 || _notrun "parent inodes not supported"
313 _scratch_mount >>$here/$seq.full 2>&1 \
314 || _fail "mount failed: $MOUNT_OPTIONS"
316 # real QA test starts here
325 # stress testing with verification by parent checking programs