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 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
31 status=1 # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
42 _path=$1 # might want to only check this path
47 if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
55 echo "Print out hardlink names for given path, $1"
58 xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
67 # Test out some creations
79 p=dir2/dir3/dir4/file4
82 #_print_names $p >>$seqres.full
83 _print_names $p | tee -a $seqres.full
85 _check_paths $SCRATCH_MNT/$p
91 echo "Testing symlink"
102 _check_paths $SCRATCH_MNT/symlink1
103 _check_paths $SCRATCH_MNT/hlink1
104 _check_paths $SCRATCH_MNT/hlink2
105 _check_paths $SCRATCH_MNT/hlink3
109 # create hardlinks from the same dir
110 # and some from different dirs
112 # test out removing hardlinks too
117 echo "Testing hardlink"
128 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
133 _print_names $p >>$seqres.full
136 echo "print out names and check after created hardlinks"
139 _print_names $x | tee -a $seqres.full
140 _check_paths $SCRATCH_MNT/$x
144 echo "now try removing half of the hardlinks"
146 paths="$d/l1 $d/l2 $d/l3 $d2/l4 $d2/l5 $d2/l6"
151 if [ $j -eq 0 ]; then
158 echo "print out names and check after removed hardlinks"
162 _print_names $x | tee -a $seqres.full
163 _check_paths $SCRATCH_MNT/$x
170 # in dir, file1 to file2 where file2 does not exist
171 # in dir, file1 to file2 where file2 does exist
172 # dir/file1 to dir2/file2 where file2 does not exist
173 # dir/file1 to dir2/file2 where file2 does exist
174 # dir to dir2 where dir2 does not exist
175 # dir to dir/dir3 - not allowed
180 echo "Testing rename"
184 echo "1. in dir, file1 to file2 where file2 does not exist"
186 d1=$SCRATCH_MNT/ren1/ren2/ren3/ren4
195 echo "2. in dir, file1 to file2 where file2 does exist"
202 echo "3. dir/file1 to dir2/file2 where file2 does not exist"
204 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
212 echo "4. dir/file1 to dir2/file2 where file2 does exist"
214 d2=$SCRATCH_MNT/ren1/ren2/ren3/ren5
221 echo "5. dir to dir2 where dir2 does not exist"
223 d3=$SCRATCH_MNT/ren1/ren2/ren3/ren6
230 tee -a $seqres.full |\
231 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
232 -e 's/[0-9][0-9]* paths/P paths/g' \
233 -e 's/seed = [0-9][0-9]*/seed = S/'
239 echo "Testing fsstress"
242 out=$SCRATCH_MNT/fsstress.$$
244 args=`_scale_fsstress_args -z \
245 -f rmdir=10 -f link=10 -f creat=10 \
246 -f mkdir=10 -f rename=30 -f unlink=10 \
248 -n $count -d $out -p 3`
250 echo "fsstress $args" | sed -e "s#$out#outdir#"
251 if ! $FSSTRESS_PROG $args | _filter_num
253 echo " fsstress $args returned $?"
254 cat $tmp.out | tee -a $seqres.full
264 echo "Testing dirstress"
267 out=$SCRATCH_MNT/dirstress.$$
272 echo "!! couldn't mkdir $out"
277 args="-d $out -f $count -k -p 3 -n 1"
278 echo "dirstress $args" | sed -e "s#$out#outdir#"
279 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
281 echo " dirstress failed"
282 echo "*** dirstress $args" | tee -a $seqres.full
283 cat $tmp.out >>$seqres.full
288 args="-d $out -f $count -k -p 3 -n 5"
289 echo "dirstress $args" | sed -e "s#$out#outdir#"
290 if ! $here/src/dirstress $args >$tmp.out 2>&1 | _filter_num
292 echo " dirstress failed"
293 echo "*** dirstress $args" | tee -a $seqres.full
294 cat $tmp.out >>$seqres.full
302 # get standard environment, filters and checks
317 _scratch_mkfs_xfs >>$seqres.full 2>&1 \
318 || _fail "mkfs scratch failed"
319 _scratch_mkfs_xfs -i parent=1 >>$seqres.full 2>&1 \
320 || _notrun "parent inodes not supported"
323 _scratch_mount >>$seqres.full 2>&1 \
324 || _fail "mount failed: $MOUNT_OPTIONS"
326 # real QA test starts here
335 # stress testing with verification by parent checking programs