xfstests: randholes: encapsulate direct I/O setup code
[xfstests-dev.git] / 222
1 #! /bin/bash
2 # FS QA Test No. 222
3 #
4 # xfs_fsr QA tests
5 # run xfs_fsr over the test filesystem to give it a wide and varied set of
6 # inodes to try to defragment. This is effectively a crash/assert failure
7 # test looking for corruption induced by xfs_fsr runs.
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2010 Dave Chinner.  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 # creator
28 owner=david@fromorbit.com
29
30 seq=`basename $0`
31 echo "QA output created by $seq"
32
33 here=`pwd`
34 tmp=/tmp/$$
35 status=1        # failure is the default!
36
37 _cleanup()
38 {
39     rm -f $tmp.*
40 }
41
42 trap "_cleanup ; exit \$status" 0 1 2 3 15
43
44 # get standard environment, filters and checks
45 . ./common.rc
46 . ./common.filter
47
48 # real QA test starts here
49 _supported_fs xfs
50 _supported_os Linux
51
52 [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
53
54 xfs_fsr -d -v $TEST_MNT > $seq.full 2>&1
55
56 echo "--- silence is golden ---"
57 status=0 ; exit