2 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Copyright (c) 2020 Oracle. All Rights Reserved.
7 # Feed invalid mkfs config files to the mkfs parser to ensure that they are
8 # recognized as invalid.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap '_cleanup; exit $status' 0 1 2 3 15
22 rm -f $tmp.* $def_cfgfile $fsimg
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 # real QA test starts here
34 # Modify as appropriate.
37 _require_scratch_nocheck
38 _require_xfs_mkfs_cfgfile
40 def_cfgfile=$TEST_DIR/a
42 rm -f $def_cfgfile $fsimg
43 $XFS_IO_PROG -c "truncate 20t" -f $fsimg
47 if [ -z "$cfgfile" ] || [ "$cfgfile" = "-" ]; then
51 $MKFS_XFS_PROG -c options=$cfgfile -f -N $fsimg >> $seqres.full 2> $tmp.err
53 echo "Test passed, should have failed! Config file parameters:"
58 echo Spaces in a section name
59 test_mkfs_config << ENDL
63 test_mkfs_config << ENDL
67 test_mkfs_config << ENDL
71 test_mkfs_config << ENDL
75 test_mkfs_config << ENDL
79 test_mkfs_config << ENDL
83 test_mkfs_config << ENDL
87 test_mkfs_config << ENDL
91 test_mkfs_config << ENDL
95 test_mkfs_config << ENDL
99 test_mkfs_config << ENDL
103 test_mkfs_config << ENDL
107 test_mkfs_config << ENDL
112 echo Spaces in the middle of a key name
113 test_mkfs_config << ENDL
119 test_mkfs_config << ENDL
124 echo Nonexistent sections
125 test_mkfs_config << ENDL
130 echo Nonexistent keys
131 test_mkfs_config << ENDL
136 echo Only zero or one
137 test_mkfs_config << ENDL
141 test_mkfs_config << ENDL
146 echo sysctl style files
147 test_mkfs_config << ENDL
152 test_mkfs_config $MKFS_XFS_PROG 2>&1 | sed -e "s#$MKFS_XFS_PROG#MKFS_XFS_PROG#g"
154 echo respecified options
155 test_mkfs_config << ENDL
161 echo respecified sections
162 test_mkfs_config << ENDL
169 echo ambiguous comment/section names
170 test_mkfs_config << ENDL
175 echo ambiguous comment/variable names
176 test_mkfs_config << ENDL
180 test_mkfs_config << ENDL
184 test_mkfs_config << ENDL
188 test_mkfs_config << ENDL
190 crc = 0;This is an eol comment.