2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc. All Rights Reserved.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=0 # success is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
22 rm -rf $TEST_DIR/holes.$$.*
27 ls -l $1 | $AWK_PROG '{print " filesize = " $5}'
30 # get standard environment, filters and checks
42 out=$TEST_DIR/holes.$$.$_n
44 echo "holes.$_n : $_param"
45 echo "-----------------------------------------------"
46 if ! $here/src/holes $_param $out >$tmp.out
48 echo " holes returned $? - see $seqres.full"
56 # quick check - how many holes did we get?
57 count=`xfs_bmap $out | egrep -c ': hole'`
58 echo " $count hole(s) detected"
59 # and how big was the file?
62 if [ $count -ne $_count ]
64 echo " unexpected number of holes - see $seqres.full"
72 echo "--------------------------------------" >>$seqres.full
73 echo "$_n - output from holes:" >>$seqres.full
74 echo "--------------------------------------" >>$seqres.full
75 cat $tmp.out >>$seqres.full
76 echo "--------------------------------------" >>$seqres.full
77 echo "$_n - output from bmap:" >>$seqres.full
78 echo "--------------------------------------" >>$seqres.full
79 xfs_bmap -vvv $out >>$seqres.full
80 echo "--------------------------------------" >>$seqres.full
81 echo "$_n - output from ls -li:" >>$seqres.full
82 echo "--------------------------------------" >>$seqres.full
83 ls -li $out >>$seqres.full
88 # real QA test starts here
94 # small & fairly dense
95 _do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100
98 _do_test 2 "-l 409600000 -b 40960 -i 1000 -c 1" 10
100 # no holes, but a very nasty way to write a file (lots of extents)
101 _do_test 3 "-l 40960000 -b 40960 -i 10 -c 10" 0