xfstests: resolve symlinked devices to real paths
[xfstests-dev.git] / 176
1 #! /bin/bash
2 # FSQA Test No. 176
3 #
4 # Check if resvsp on file create effects bmap output after hole punch.
5 # 967674: hole not show when file is created with resvsp
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
8 #
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.
12 #
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.
17 #
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
21 #
22 #-----------------------------------------------------------------------
23 #
24 owner=ddiss@sgi.com
25
26 seq=`basename $0`
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 rm -f $seq.full
32 status=1    # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34
35 _cleanup()
36 {
37         rm -f $tmp/*
38 }
39
40 # get standard environment, filters and checks
41 . ./common.rc
42 . ./common.filter
43 . ./common.dmapi
44 . ./common.punch
45
46 # real QA test starts here
47 _supported_fs xfs
48 _supported_os Linux
49
50 _require_scratch
51
52 # test that we have DMAPI support
53 _dmapi_scratch_mount
54 umount $SCRATCH_MNT > /dev/null 2>&1
55
56 # _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
57 #                                       "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
58 #                                       "w p p w p" resvsp
59
60 echo "-- test dmpunch-hole with resvsp on file create --"
61 _test_punch 4096 0 256 "240" "16" "d" "0" "256" "w p"
62
63 echo
64 echo "-- this time dont use resvsp --"
65 _test_punch 4096 0 256 "240" "16" "d" "0" "256" "w p" noresv
66
67 echo
68 echo
69 echo "-- test unresvsp hole punch with resvsp on file create --"
70 _test_punch 4096 0 256 "240" "16" "u" "0" "256" "w p"
71
72 echo
73 echo "-- this time dont use resvsp --"
74 _test_punch 4096 0 256 "240" "16" "u" "0" "256" "w p" noresv
75
76 status=0
77 exit