lib/: spdx license conversion
[xfstests-dev.git] / tests / ext4 / 001
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright 2014 (C) Red Hat, Inc., Lukas Czerner <lczerner@redhat.com>
4 #
5 # FS QA Test No. 001
6 #
7 # Test fallocate FALLOC_FL_ZERO_RANGE
8 #
9 seqfull=$0
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17
18 _cleanup()
19 {
20     rm -f $tmp.*
21 }
22
23 trap "_cleanup ; exit \$status" 0 1 2 3 15
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/punch
29
30 # real QA test starts here
31 _supported_fs ext4
32 _supported_os Linux
33 _require_xfs_io_command "fzero"
34 _require_test
35
36 # Select appropriate golden output based on mount options
37 _link_out_file
38
39 testfile=$TEST_DIR/001.$$
40
41 # Standard zero range tests
42 _test_generic_punch falloc fzero fzero fiemap _filter_fiemap $testfile
43
44 # Delayed allocation zero range tests
45 _test_generic_punch -d falloc fzero fzero fiemap _filter_fiemap $testfile
46
47 # Multi zero range tests
48 _test_generic_punch -k falloc fzero fzero fiemap _filter_fiemap $testfile
49
50 # Delayed allocation multi zero range tests
51 _test_generic_punch -d -k falloc fzero fzero fiemap _filter_fiemap $testfile
52
53 status=0 ; exit