xfs: Check for extent overflow when trivally adding a new extent
[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 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.* $def_cfgfile
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # remove previous $seqres.full before test
29 rm -f $seqres.full
30
31 # real QA test starts here
32
33 # Modify as appropriate.
34 _supported_fs xfs
35 _require_test
36 _require_scratch_nocheck
37 _require_xfs_mkfs_cfgfile
38
39 cfgfile=$TEST_DIR/a
40 rm -rf $cfgfile
41
42 # disable crc in config file, enable rmapbt (which requires crc=1) in cli
43 cat > $cfgfile << ENDL
44 [metadata]
45 crc = 0
46 ENDL
47
48 $MKFS_XFS_PROG -c options=$cfgfile -f -m rmapbt=1 $SCRATCH_DEV > $tmp.mkfs 2>&1
49 cat $tmp.mkfs >> $seqres.full
50 grep 'rmapbt not supported without CRC support' $tmp.mkfs
51
52 # enable rmapbt (which requires crc=1) in config file, disable crc in cli
53 cat > $cfgfile << ENDL
54 [metadata]
55 rmapbt = 1
56 ENDL
57
58 $MKFS_XFS_PROG -c options=$cfgfile -f -m crc=0 $SCRATCH_DEV > $tmp.mkfs 2>&1
59 cat $tmp.mkfs >> $seqres.full
60 grep 'rmapbt not supported without CRC support' $tmp.mkfs
61
62 # success, all done
63 status=0
64 exit