fsx/fsstress: round blocksize properly
[xfstests-dev.git] / tests / generic / 316
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Alibaba Group.  All Rights Reserved.
4 #
5 # FS QA Test No. 316
6 #
7 # Test Generic fallocate hole punching w/o unwritten extent
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 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
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
32 _require_test
33 _require_xfs_io_command "fpunch"
34 _require_xfs_io_command "fiemap"
35
36 testfile=$TEST_DIR/$seq.$$
37
38 # Standard punch hole tests
39 _test_generic_punch -u pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
40
41 # Delayed allocation punch hole tests
42 _test_generic_punch -u -d pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
43
44 # Multi hole punch tests
45 _test_generic_punch -u -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
46
47 # Delayed allocation multi punch hole tests
48 _test_generic_punch -u -d -k pwrite fpunch fpunch fiemap _filter_hole_fiemap $testfile
49
50 # success, all done
51 status=0
52 exit