4 # Test some parent ptr stuff
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would 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 the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
25 owner=tes@crackle.melbourne.sgi.com
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
44 _path=$1 # might want to only check this path
49 if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
57 echo "Print out hardlink names for given path, $1"
60 xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
69 # Test out some creations
81 p=dir2/dir3/dir4/file4
84 #_print_names $p >>$here/$seq.full
85 _print_names $p | tee -a $here/$seq.full
87 _check_paths $SCRATCH_MNT/$p
93 echo "Testing symlink"
104 _check_paths $SCRATCH_MNT/symlink1
105 _check_paths $SCRATCH_MNT/hlink1
106 _check_paths $SCRATCH_MNT/hlink2
107 _check_paths $SCRATCH_MNT/hlink3
111 # create hardlinks from the same dir
112 # and some from different dirs
114 # test out removing hardlinks too
119 echo "Testing hardlink"
130 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
135 _print_names $p >>$here/$seq.full
138 echo "print out names and check after created hardlinks"
141 _print_names $x | tee -a $here/$seq.full
142 _check_paths $SCRATCH_MNT/$x
147 echo "now try removing half of the hardlinks"
149 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
154 if [ $j -eq 0 ]; then
161 echo "print out names and check after removed hardlinks"
165 _print_names $x | tee -a $here/$seq.full
166 _check_paths $SCRATCH_MNT/$x
173 # in dir, file1 to file2 where file2 does not exist
174 # in dir, file1 to file2 where file2 does exist
175 # dir/file1 to dir2/file2 where file2 does not exist
176 # dir/file1 to dir2/file2 where file2 does exist
177 # dir to dir2 where dir2 does not exist
178 # dir to dir/dir3 - not allowed
184 echo "Testing rename"
188 echo "1. in dir, file1 to file2 where file2 does not exist"
190 d1=$SCRATCH_MNT/ren1/ren2/ren3/ren4
199 echo "2. in dir, file1 to file2 where file2 does exist"
206 echo "3. dir/file1 to dir2/file2 where file2 does not exist"
208 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
216 echo "4. dir/file1 to dir2/file2 where file2 does exist"
218 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
225 echo "5. dir to dir2 where dir2 does not exist"
227 d3=$SCRATCH_MNT/ren1/ren2/ren3/ren6
234 tee -a $here/$seq.full |\
235 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
236 -e 's/[0-9][0-9]* paths/P paths/g' \
237 -e 's/seed = [0-9][0-9]*/seed = S/'
244 echo "Testing fsstress"
247 out=$SCRATCH_MNT/fsstress.$$
250 -f rmdir=10 -f link=10 -f creat=10 \
251 -f mkdir=10 -f rename=30 -f unlink=10 \
253 -n $count -d $out -p 3"
255 echo "fsstress $args" | sed -e "s#$out#outdir#"
256 if ! $FSSTRESS_PROG $args | _filter_num
258 echo " fsstress $args returned $?"
259 cat $tmp.out | tee -a $here/$seq.full
270 echo "Testing dirstress"
273 out=$SCRATCH_MNT/dirstress.$$
278 echo "!! couldn't mkdir $out"
283 args="-d $out -f $count -k -p 3 -n 1"
284 echo "dirstress $args" | sed -e "s#$out#outdir#"
285 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
287 echo " dirstress failed"
288 echo "*** dirstress $args" | tee -a $here/$seq.full
289 cat $tmp.out >>$here/$seq.full
294 args="-d $out -f $count -k -p 3 -n 5"
295 echo "dirstress $args" | sed -e "s#$out#outdir#"
296 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
298 echo " dirstress failed"
299 echo "*** dirstress $args" | tee -a $here/$seq.full
300 cat $tmp.out >>$here/$seq.full
308 # get standard environment, filters and checks
318 rm -f $here/$seq.full
321 _scratch_mkfs_xfs >>$here/$seq.full 2>&1 \
322 || _fail "mkfs scratch failed"
323 _scratch_mkfs_xfs -i parent=1 >>$here/$seq.full 2>&1 \
324 || _notrun "parent inodes not supported"
327 _scratch_mount >>$here/$seq.full 2>&1 \
328 || _fail "mount failed: $MOUNT_OPTIONS"
330 # real QA test starts here
339 # stress testing with verification by parent checking programs