summaryrefslogtreecommitdiff
path: root/tools/bootconfig/test-bootconfig.sh
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-09-21 12:45:11 +0300
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-09-22 04:57:12 +0300
commit2f5fb555637eff4a3e5579f2323cd358c77efdc8 (patch)
tree0af397c124e9f986eb1ade99519da61603546e1f /tools/bootconfig/test-bootconfig.sh
parent1d210c166b693c3a659abbac4b58385c2d4cf887 (diff)
downloadlinux-2f5fb555637eff4a3e5579f2323cd358c77efdc8.tar.xz
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 <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'tools/bootconfig/test-bootconfig.sh')
-rwxr-xr-xtools/bootconfig/test-bootconfig.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/bootconfig/test-bootconfig.sh b/tools/bootconfig/test-bootconfig.sh
index 95eec768b503..d295e406a756 100755
--- a/tools/bootconfig/test-bootconfig.sh
+++ b/tools/bootconfig/test-bootconfig.sh
@@ -149,6 +149,19 @@ xpass $BOOTCONF -a $TEMPCONF $INITRD
$BOOTCONF $INITRD > $OUTFILE
xpass grep -q "bar" $OUTFILE
+
+echo "Remove/keep tailing spaces"
+cat > $TEMPCONF << EOF
+foo = val # comment
+bar = "val2 " # comment
+EOF
+echo > $INITRD
+
+xpass $BOOTCONF -a $TEMPCONF $INITRD
+$BOOTCONF $INITRD > $OUTFILE
+xfail grep -q val[[:space:]] $OUTFILE
+xpass grep -q val2[[:space:]] $OUTFILE
+
echo "=== expected failure cases ==="
for i in samples/bad-* ; do
xfail $BOOTCONF -a $i $INITRD