xfstests: introduce a common directory
[xfstests-dev.git] / tests / xfs / 175
1 #! /bin/bash
2 # FSQA Test No. 175
3 #
4 # Hole punching with extsize hints, holes may not reported by xfs_bmap.
5 # This is not good for certain backup apps, as they rely on the hole
6 # being visible in the file so later on they know where to migrate
7 # back the data from the tape.
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #
25 #-----------------------------------------------------------------------
26 #
27
28 seq=`basename $0`
29 seqres=$RESULT_DIR/$seq
30 seqres=$RESULT_DIR/$seq
31 seqres=$RESULT_DIR/$seq
32 echo "QA output created by $seq"
33
34 here=`pwd`
35 tmp=/tmp/$$
36 rm -f $seqres.full
37 status=1    # failure is the default!
38 trap "_cleanup; exit \$status" 0 1 2 3 15
39
40 _cleanup()
41 {
42         rm -f $tmp/*
43 }
44
45 # get standard environment, filters and checks
46 . ./common/rc
47 . ./common/filter
48 . ./common/dmapi
49 . ./common/punch
50
51 # real QA test starts here
52 _supported_fs xfs
53 _supported_os Linux
54
55 _require_scratch
56
57 # test that we have DMAPI support
58 _dmapi_scratch_mount
59 umount $SCRATCH_MNT > /dev/null 2>&1
60
61 # _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
62 #                                       "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
63 #                                       "w p p w p" resvsp
64
65 echo "-- test dmpunch-hole without an extent size hint --"
66 _test_punch 4096 0 256 "240" "16" "d" "0" "256" "w p" noresv
67
68 echo
69 echo "-- this time use a 4k (one block) extent size hint --"
70 _test_punch 4096 1 256 "240" "16" "d" "0" "256" "w p" noresv
71
72 status=0
73 exit