xfs/007: fix regressions on V4 filesystems
[xfstests-dev.git] / tests / xfs / 524
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Copyright (c) 2020 Oracle.  All Rights Reserved.
4 #
5 # FS QA Test No. 524
6 #
7 # Test formatting with a well known config file.
8 #
9 . ./common/preamble
10 _begin_fstest auto quick mkfs
11
12 # Override the default cleanup function.
13 _cleanup()
14 {
15         cd /
16         rm -f $tmp.* $def_cfgfile $fsimg
17 }
18
19 # Import common functions.
20 . ./common/filter
21
22 # real QA test starts here
23
24 # Modify as appropriate.
25 _supported_fs xfs
26 _require_test
27 _require_scratch_nocheck
28 _require_xfs_mkfs_cfgfile
29
30 echo "Silence is golden"
31
32 def_cfgfile=$TEST_DIR/a
33 fsimg=$TEST_DIR/a.img
34 rm -f $def_cfgfile $fsimg
35 $XFS_IO_PROG -c "truncate 20t" -f $fsimg
36
37 cat > $def_cfgfile << ENDL
38 [metadata]
39 crc = 1
40 rmapbt = 1
41 reflink = 1
42
43 [inode]
44 sparse = 1
45 ENDL
46
47 $MKFS_XFS_PROG -c options=$def_cfgfile -f $SCRATCH_DEV > $tmp.mkfs
48 cat $tmp.mkfs >> $seqres.full
49 grep -q 'crc=1' $tmp.mkfs || echo 'v5 not enabled'
50 grep -q 'rmapbt=1' $tmp.mkfs || echo 'rmap not enabled'
51 grep -q 'reflink=1' $tmp.mkfs || echo 'reflink not enabled'
52 grep -q 'sparse=1' $tmp.mkfs || echo 'sparse inodes not enabled'
53
54 # success, all done
55 status=0
56 exit