9b70b2877ffda916a2021c26f1ab2713fa108da2
[xfstests-dev.git] / tests / generic / 008
1 #! /bin/bash
2 # FS QA Test No. 008
3 #
4 # Makes calls to fallocate zero range and checks tossed ranges
5 #
6 # Primarily tests page boundries and boundries that are
7 #  off-by-one to ensure we're only tossing what's expected
8 #
9 #-----------------------------------------------------------------------
10 # Copyright 2014 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
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 seq=`basename $0`
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34 trap "exit \$status" 0 1 2 3 15
35
36 # get standard environment, filters and checks
37 . ./common/rc
38 . ./common/filter
39 . ./common/punch
40
41 # real QA test starts here
42
43 # Modify as appropriate.
44 _supported_os Linux
45
46 _require_xfs_io_command "fzero"
47 _require_test
48
49 testfile=$TEST_DIR/008.$$
50
51 _test_block_boundaries 1024 fzero _filter_xfs_io_unique $testfile
52 _test_block_boundaries 2048 fzero _filter_xfs_io_unique $testfile
53 _test_block_boundaries 4096 fzero _filter_xfs_io_unique $testfile
54 _test_block_boundaries 65536 fzero _filter_xfs_io_unique $testfile
55
56 # success, all done
57 status=0
58 exit