generic/405: test mkfs against thin provision device
[xfstests-dev.git] / tests / generic / 016
1 #! /bin/bash
2 # FS QA Test No. generic/016
3 #
4 # Delayed allocation multi collapse range tests
5 # This testcase is one of the 4 testcases which tries to
6 # test various corner cases for fcollapse range functionality over different
7 # type of extents. These tests are based on generic/255 test case.
8 # For the type of tests, check the description of _test_generic_punch
9 # in common/rc.
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2013 Samsung Electronics.  All Rights Reserved.
12 #
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
16 #
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 # GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25 #
26 #-----------------------------------------------------------------------
27 #
28
29 seq=`basename $0`
30 seqres=$RESULT_DIR/$seq
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 # we need to include common/punch to get defination fo filter functions
46 . ./common/rc
47 . ./common/filter
48 . ./common/punch
49
50 # real QA test starts here
51 _supported_fs generic
52 _supported_os Linux
53
54 _require_test
55 _require_xfs_io_command "fpunch"
56 _require_xfs_io_command "falloc"
57 _require_xfs_io_command "fiemap"
58 _require_xfs_io_command "fcollapse"
59
60 testfile=$TEST_DIR/$seq.$$
61
62 _test_generic_punch -d -k falloc fpunch fcollapse fiemap _filter_hole_fiemap $testfile
63 _check_test_fs
64
65 status=0
66 exit