2 # SPDX-License-Identifier: GPL-2.0-or-later
3 # Copyright (c) 2020 Oracle. All Rights Reserved.
7 # Feed valid mkfs config files to the mkfs parser to ensure that they are
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
52 cat $tmp.err | _filter_test_dir
55 echo Simplest config file
56 cat > $def_cfgfile << ENDL
60 test_mkfs_config $def_cfgfile
62 echo Piped-in config file
63 test_mkfs_config << ENDL
67 test_mkfs_config << ENDL
72 echo Full line comment
73 test_mkfs_config << ENDL
74 # This is a full line comment.
78 test_mkfs_config << ENDL
79 # This is a full line comment.
83 test_mkfs_config << ENDL
84 #This is a full line comment.
89 echo End of line comment
90 test_mkfs_config << ENDL
92 crc = 0 ; This is an eol comment.
94 test_mkfs_config << ENDL
96 crc = 0 ;This is an eol comment.
99 echo Multiple directives
100 test_mkfs_config << ENDL
106 echo Multiple sections
107 test_mkfs_config << ENDL
115 echo No directives at all
116 test_mkfs_config << ENDL
120 echo Space around the section name
121 test_mkfs_config << ENDL
125 test_mkfs_config << ENDL
129 test_mkfs_config << ENDL
134 echo Single space around the key/value directive
135 test_mkfs_config << ENDL
139 test_mkfs_config << ENDL
143 test_mkfs_config << ENDL
147 test_mkfs_config << ENDL
152 echo Two spaces around the key/value directive
153 test_mkfs_config << ENDL
157 test_mkfs_config << ENDL
161 test_mkfs_config << ENDL
165 test_mkfs_config << ENDL
169 test_mkfs_config << ENDL
173 test_mkfs_config << ENDL
178 echo Three spaces around the key/value directive
179 test_mkfs_config << ENDL
183 test_mkfs_config << ENDL
187 test_mkfs_config << ENDL
192 echo Four spaces around the key/value directive
193 test_mkfs_config << ENDL
198 echo Arbitrary spaces and tabs
199 test_mkfs_config << ENDL
204 echo ambiguous comment/section names
205 test_mkfs_config << ENDL
211 echo ambiguous comment/variable names
212 test_mkfs_config << ENDL
214 #foo = 0 ; is this a comment or a key '#foo' ?