4 # Bmap btree corruption regression test
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2011 Red Hat, 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
21 #-----------------------------------------------------------------------
25 seqres=$RESULT_DIR/$seq
26 seqres=$RESULT_DIR/$seq
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
38 umount -d $LOOP_MNT 2>/dev/null
44 # get standard environment, filters and checks
48 # real QA test starts here
53 LOOP_DEV=$TEST_DIR/$seq.fs
54 LOOP_MNT=$TEST_DIR/$seq.mnt
61 # real QA test starts here
63 echo "*** create loop mount point"
64 rmdir $LOOP_MNT 2>/dev/null
65 mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point"
73 dparam="file,name=$LOOP_DEV,size=$size"
74 if [ -n "$agsize" ]; then
75 dparam="$dparam,agsize=$agsize"
78 echo "*** mkfs loop file (size=$size)"
79 $MKFS_XFS_PROG -d $dparam \
80 | _filter_mkfs 2>/dev/null
82 echo "*** mount loop filesystem"
83 mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
85 echo "*** preallocate large file"
86 xfs_io -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
88 echo "*** unmount loop filesystem"
89 umount -d $LOOP_MNT > /dev/null 2>&1
91 echo "*** check loop filesystem"
92 _check_xfs_filesystem $LOOP_DEV none none
95 _test_loop 50g 16m 40G