summaryrefslogtreecommitdiff
path: root/tests/xfs/524
blob: fe4d134b7c3753c99af8a5c1c5572e34ece53c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2020 Oracle.  All Rights Reserved.
#
# FS QA Test No. 524
#
# Test formatting with a well known config file.
#
. ./common/preamble
_begin_fstest auto quick mkfs

# Override the default cleanup function.
_cleanup()
{
	cd /
	rm -f $tmp.* $def_cfgfile $fsimg
}

# Import common functions.
. ./common/filter

# real QA test starts here

# Modify as appropriate.
_supported_fs xfs
_require_test
_require_scratch_nocheck
_require_xfs_mkfs_cfgfile

echo "Silence is golden"

def_cfgfile=$TEST_DIR/a
fsimg=$TEST_DIR/a.img
rm -f $def_cfgfile $fsimg
$XFS_IO_PROG -c "truncate 20t" -f $fsimg

cat > $def_cfgfile << ENDL
[metadata]
crc = 1
rmapbt = 1
reflink = 1

[inode]
sparse = 1
ENDL

$MKFS_XFS_PROG -c options=$def_cfgfile -f $SCRATCH_DEV > $tmp.mkfs
cat $tmp.mkfs >> $seqres.full
grep -q 'crc=1' $tmp.mkfs || echo 'v5 not enabled'
grep -q 'rmapbt=1' $tmp.mkfs || echo 'rmap not enabled'
grep -q 'reflink=1' $tmp.mkfs || echo 'reflink not enabled'
grep -q 'sparse=1' $tmp.mkfs || echo 'sparse inodes not enabled'

# success, all done
status=0
exit