xfs: fix old fuzz test invocations of xfs_repair
[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 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 $fsimg
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 echo "Silence is golden"
40
41 def_cfgfile=$TEST_DIR/a
42 fsimg=$TEST_DIR/a.img
43 rm -f $def_cfgfile $fsimg
44 $XFS_IO_PROG -c "truncate 20t" -f $fsimg
45
46 cat > $def_cfgfile << ENDL
47 [metadata]
48 crc = 1
49 rmapbt = 1
50 reflink = 1
51
52 [inode]
53 sparse = 1
54 ENDL
55
56 $MKFS_XFS_PROG -c options=$def_cfgfile -f $SCRATCH_DEV > $tmp.mkfs
57 cat $tmp.mkfs >> $seqres.full
58 grep -q 'crc=1' $tmp.mkfs || echo 'v5 not enabled'
59 grep -q 'rmapbt=1' $tmp.mkfs || echo 'rmap not enabled'
60 grep -q 'reflink=1' $tmp.mkfs || echo 'reflink not enabled'
61 grep -q 'sparse=1' $tmp.mkfs || echo 'sparse inodes not enabled'
62
63 # success, all done
64 status=0
65 exit