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
34 if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
42 echo "Print out hardlink names for given path, $1"
45 xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
54 # Test out some creations
66 p=dir2/dir3/dir4/file4
69 #_print_names $p >>$here/$seq.full
70 _print_names $p | tee -a $here/$seq.full
72 _check_paths $SCRATCH_MNT/$p
78 echo "Testing symlink"
89 _check_paths $SCRATCH_MNT/symlink1
90 _check_paths $SCRATCH_MNT/hlink1
91 _check_paths $SCRATCH_MNT/hlink2
92 _check_paths $SCRATCH_MNT/hlink3
96 # create hardlinks from the same dir
97 # and some from different dirs
99 # test out removing hardlinks too
104 echo "Testing hardlink"
115 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
120 _print_names $p >>$here/$seq.full
123 echo "print out names and check after created hardlinks"
126 _print_names $x | tee -a $here/$seq.full
127 _check_paths $SCRATCH_MNT/$x
132 echo "now try removing half of the hardlinks"
134 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
139 if [ $j -eq 0 ]; then
146 echo "print out names and check after removed hardlinks"
150 _print_names $x | tee -a $here/$seq.full
151 _check_paths $SCRATCH_MNT/$x
158 # in dir, file1 to file2 where file2 does not exist
159 # in dir, file1 to file2 where file2 does exist
160 # dir/file1 to dir2/file2 where file2 does not exist
161 # dir/file1 to dir2/file2 where file2 does exist
162 # dir to dir2 where dir2 does not exist
163 # dir to dir/dir3 - not allowed
169 echo "Testing rename"
173 echo "1. in dir, file1 to file2 where file2 does not exist"
175 d1=$SCRATCH_MNT/ren1/ren2/ren3/ren4
184 echo "2. in dir, file1 to file2 where file2 does exist"
191 echo "3. dir/file1 to dir2/file2 where file2 does not exist"
193 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
201 echo "4. dir/file1 to dir2/file2 where file2 does exist"
203 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
210 echo "5. dir to dir2 where dir2 does not exist"
212 d3=$SCRATCH_MNT/ren1/ren2/ren3/ren6
219 tee -a $here/$seq.full |\
220 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
221 -e 's/[0-9][0-9]* paths/P paths/g' \
222 -e 's/seed = [0-9][0-9]*/seed = S/'
229 echo "Testing fsstress"
232 out=$SCRATCH_MNT/fsstress.$$
235 -f rmdir=10 -f link=10 -f creat=10 \
236 -f mkdir=10 -f rename=30 -f unlink=10 \
238 -n $count -d $out -p 3"
240 echo "ltp/fsstress $args" | sed -e "s#$out#outdir#"
241 if ! $here/ltp/fsstress $args | _filter_num
243 echo " fsstress $args returned $?"
244 cat $tmp.out | tee -a $here/$seq.full
255 echo "Testing dirstress"
258 out=$SCRATCH_MNT/dirstress.$$
263 echo "!! couldn't mkdir $out"
268 args="-d $out -f $count -k -p 3 -n 1"
269 echo "src/dirstress $args" | sed -e "s#$out#outdir#"
270 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
272 echo " dirstress failed"
273 echo "*** dirstress $args" | tee -a $here/$seq.full
274 cat $tmp.out >>$here/$seq.full
279 args="-d $out -f $count -k -p 3 -n 5"
280 echo "src/dirstress $args" | sed -e "s#$out#outdir#"
281 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
283 echo " dirstress failed"
284 echo "*** dirstress $args" | tee -a $here/$seq.full
285 cat $tmp.out >>$here/$seq.full
293 # get standard environment, filters and checks
303 rm -f $here/$seq.full
306 _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \
307 || _fail "mkfs scratch failed"
308 export MKFS_OPTIONS="$MKFS_OPTIONS -i parent=1"
309 _scratch_mkfs_xfs >>$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