lib/: spdx license conversion
[xfstests-dev.git] / tests / generic / 255
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Red Hat.  All Rights Reserved.
4 #
5 # FS QA Test No. 255
6 #
7 # Test Generic fallocate hole punching
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16
17 _cleanup()
18 {
19     rm -f $tmp.*
20 }
21
22 trap "_cleanup ; exit \$status" 0 1 2 3 15
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27 . ./common/punch
28
29 # real QA test starts here
30 _supported_fs generic 
31 _supported_os Linux
32
33 _require_test
34 _require_xfs_io_command "fpunch"
35 _require_xfs_io_command "falloc"
36 _require_xfs_io_command "fiemap"
37
38 testfile=$TEST_DIR/255.$$
39
40 # Standard punch hole tests
41 _test_generic_punch falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
42
43 # Delayed allocation punch hole tests
44 _test_generic_punch -d falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
45
46 # Multi hole punch tests
47 _test_generic_punch -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
48
49 # Delayed allocation multi punch hole tests
50 _test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_hole_fiemap $testfile
51
52 status=0 ; exit