Skip to content

Commit 2f5fb55

Browse files
mhiramatrostedt
authored andcommitted
tools/bootconfig: Add testcase for tailing space
Add testcases for removing/keeping tailing space in the value. Link: https://lkml.kernel.org/r/160068151151.1088739.3469541807296024227.stgit@devnote2 Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 1d210c1 commit 2f5fb55

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/bootconfig/test-bootconfig.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,19 @@ xpass $BOOTCONF -a $TEMPCONF $INITRD
149149
$BOOTCONF $INITRD > $OUTFILE
150150
xpass grep -q "bar" $OUTFILE
151151

152+
153+
echo "Remove/keep tailing spaces"
154+
cat > $TEMPCONF << EOF
155+
foo = val # comment
156+
bar = "val2 " # comment
157+
EOF
158+
echo > $INITRD
159+
160+
xpass $BOOTCONF -a $TEMPCONF $INITRD
161+
$BOOTCONF $INITRD > $OUTFILE
162+
xfail grep -q val[[:space:]] $OUTFILE
163+
xpass grep -q val2[[:space:]] $OUTFILE
164+
152165
echo "=== expected failure cases ==="
153166
for i in samples/bad-* ; do
154167
xfail $BOOTCONF -a $i $INITRD

0 commit comments

Comments
 (0)