fstests: move test group info to test files
[xfstests-dev.git] / tests / xfs / 526
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. 526
6 #
7 # Test formatting with conflicts between the config file and the cli.
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
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 cfgfile=$TEST_DIR/a
31 rm -rf $cfgfile
32
33 # disable crc in config file, enable rmapbt (which requires crc=1) in cli
34 cat > $cfgfile << ENDL
35 [metadata]
36 crc = 0
37 ENDL
38
39 $MKFS_XFS_PROG -c options=$cfgfile -f -m rmapbt=1 $SCRATCH_DEV > $tmp.mkfs 2>&1
40 cat $tmp.mkfs >> $seqres.full
41 grep 'rmapbt not supported without CRC support' $tmp.mkfs
42
43 # enable rmapbt (which requires crc=1) in config file, disable crc in cli
44 cat > $cfgfile << ENDL
45 [metadata]
46 rmapbt = 1
47 ENDL
48
49 $MKFS_XFS_PROG -c options=$cfgfile -f -m crc=0 $SCRATCH_DEV > $tmp.mkfs 2>&1
50 cat $tmp.mkfs >> $seqres.full
51 grep 'rmapbt not supported without CRC support' $tmp.mkfs
52
53 # success, all done
54 status=0
55 exit