6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=0 # success is the default!
19 pgsize=`$here/src/feature -s`
20 trap "_cleanup; exit \$status" 0 1 2 3 15
25 rm -rf $testdir/randholes.$$.*
31 sed -e "s/-b $pgsize/-b PGSIZE/g"
34 # get standard environment, filters and checks
44 out=$testdir/randholes.$$.$_n
46 echo "randholes.$_n : $_param" | _filter
47 echo "------------------------------------------"
48 if $here/src/randholes $_param $out >$tmp.out
50 # only check if we're not allocating in huge chunks (extsz flag)
51 if _test_inode_flag extsize $out || _test_inode_flag realtime $out
53 echo "holes is in range"
55 # quick check - how many holes did we get?
56 count=`xfs_bmap $out | egrep -c ': hole'`
57 # blocks can end up adjacent, therefore number of holes varies
58 _within_tolerance "holes" $count $_holes 10% -v
61 echo " randholes returned $? - see $seq.out.full"
62 echo "--------------------------------------" >>$here/$seq.out.full
63 echo "$_n - output from randholes:" >>$here/$seq.out.full
64 echo "--------------------------------------" >>$here/$seq.out.full
65 cat $tmp.out >>$here/$seq.out.full
66 echo "--------------------------------------" >>$here/$seq.out.full
67 echo "$_n - output from bmap:" >>$here/$seq.out.full
68 echo "--------------------------------------" >>$here/$seq.out.full
69 xfs_bmap -vvv $out >>$here/$seq.out.full
74 # real QA test starts here
76 _supported_os IRIX Linux
80 rm -f $here/$seq.out.full
82 _do_test 1 50 "-l 5000000 -c 50 -b $pgsize"
83 _do_test 2 100 "-l 10000000 -c 100 -b $pgsize"
84 _do_test 3 100 "-l 10000000 -c 100 -b 512" # test partial pages
86 # rinse, lather, repeat for direct IO
87 _do_test 4 50 "-d -l 5000000 -c 50 -b $pgsize"
88 _do_test 5 100 "-d -l 10000000 -c 100 -b $pgsize"
89 # note: direct IO requires page aligned IO