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 seqres=$RESULT_DIR/$seq
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=0 # success is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
40 rm -rf $testdir/holes.$$.*
46 ls -l $1 | $AWK_PROG '{print " filesize = " $5}'
49 # get standard environment, filters and checks
61 out=$testdir/holes.$$.$_n
63 echo "holes.$_n : $_param"
64 echo "-----------------------------------------------"
65 if ! $here/src/holes $_param $out >$tmp.out
67 echo " holes returned $? - see $seq.out.full"
75 # quick check - how many holes did we get?
76 count=`xfs_bmap $out | egrep -c ': hole'`
77 echo " $count hole(s) detected"
78 # and how big was the file?
81 if [ $count -ne $_count ]
83 echo " unexpected number of holes - see $seq.out.full"
91 echo "--------------------------------------" >>$here/$seq.out.full
92 echo "$_n - output from holes:" >>$here/$seq.out.full
93 echo "--------------------------------------" >>$here/$seq.out.full
94 cat $tmp.out >>$here/$seq.out.full
95 echo "--------------------------------------" >>$here/$seq.out.full
96 echo "$_n - output from bmap:" >>$here/$seq.out.full
97 echo "--------------------------------------" >>$here/$seq.out.full
98 xfs_bmap -vvv $out >>$here/$seq.out.full
99 echo "--------------------------------------" >>$here/$seq.out.full
100 echo "$_n - output from ls -li:" >>$here/$seq.out.full
101 echo "--------------------------------------" >>$here/$seq.out.full
102 ls -li $out >>$here/$seq.out.full
107 # real QA test starts here
109 _supported_os IRIX Linux
113 rm -f $here/$seq.out.full
115 # small & fairly dense
116 _do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100
119 _do_test 2 "-l 409600000 -b 40960 -i 1000 -c 1" 10
121 # no holes, but a very nasty way to write a file (lots of extents)
122 _do_test 3 "-l 40960000 -b 40960 -i 10 -c 10" 0