4 # Check some unwritten extent boundary conditions
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2003 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 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
34 umount $SCRATCH_MNT 2>/dev/null
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # real QA test starts here
48 _supported_os IRIX Linux
50 [ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found"
55 umount $SCRATCH_DEV >/dev/null 2>&1
57 _scratch_mkfs_xfs >/dev/null || _fail "mkfs failed"
58 _scratch_mount >/dev/null || _fail "mount failed"
60 # check there's enough freespace on $SCRATCH_MNT ... (1GiB + 1MiB)
61 avail=`df -P $SCRATCH_MNT | awk 'END {print $4}'`
62 [ "$avail" -ge 1049600 ] || _notrun "Scratch device is too small ($avail KiB)"
64 echo Silence is golden
66 # reserve 1GiB, truncate at 100bytes
67 $XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 100' $SCRATCH_MNT/ouch
68 rm -f $SCRATCH_MNT/ouch
70 # reserve 1GiB, truncate at 1GiB
71 $XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 1g' $SCRATCH_MNT/ouch
72 rm -f $SCRATCH_MNT/ouch
74 # reserve 1GiB, truncate at 2GiB
75 $XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 2g' $SCRATCH_MNT/ouch
76 rm -f $SCRATCH_MNT/ouch
78 # reserve 1GiB, 1GiB hole, reserve 1MiB, truncate at 3GiB
79 $XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'resvsp 2g 1m' -c 'truncate 3g' $SCRATCH_MNT/ouch
80 rm -f $SCRATCH_MNT/ouch