6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2001 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=0 # success is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
38 rm -rf $TEST_DIR/holes.$$.*
43 ls -l $1 | $AWK_PROG '{print " filesize = " $5}'
46 # get standard environment, filters and checks
58 out=$TEST_DIR/holes.$$.$_n
60 echo "holes.$_n : $_param"
61 echo "-----------------------------------------------"
62 if ! $here/src/holes $_param $out >$tmp.out
64 echo " holes returned $? - see $seqres.full"
72 # quick check - how many holes did we get?
73 count=`xfs_bmap $out | egrep -c ': hole'`
74 echo " $count hole(s) detected"
75 # and how big was the file?
78 if [ $count -ne $_count ]
80 echo " unexpected number of holes - see $seqres.full"
88 echo "--------------------------------------" >>$seqres.full
89 echo "$_n - output from holes:" >>$seqres.full
90 echo "--------------------------------------" >>$seqres.full
91 cat $tmp.out >>$seqres.full
92 echo "--------------------------------------" >>$seqres.full
93 echo "$_n - output from bmap:" >>$seqres.full
94 echo "--------------------------------------" >>$seqres.full
95 xfs_bmap -vvv $out >>$seqres.full
96 echo "--------------------------------------" >>$seqres.full
97 echo "$_n - output from ls -li:" >>$seqres.full
98 echo "--------------------------------------" >>$seqres.full
99 ls -li $out >>$seqres.full
104 # real QA test starts here
106 _supported_os IRIX Linux
111 # small & fairly dense
112 _do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100
115 _do_test 2 "-l 409600000 -b 40960 -i 1000 -c 1" 10
117 # no holes, but a very nasty way to write a file (lots of extents)
118 _do_test 3 "-l 40960000 -b 40960 -i 10 -c 10" 0