Commit 81464192 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Steven Rostedt (VMware)
Browse files

tools/bootconfig: Add testcases for value override operator

Add some testcases and examples for value override operator.

Link: https://lkml.kernel.org/r/159482883824.126704.2166030493721357163.stgit@devnote2



Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent a2de2f86
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
key.subkey = value
# We can not override pre-defined subkeys with value
key := value
+3 −0
Original line number Diff line number Diff line
key = value
# We can not override pre-defined value with subkey
key.subkey := value
+6 −0
Original line number Diff line number Diff line
# Override the value
key.word = 1,2,4
key.word := 2,3

# No pre-defined key
key.new.word := "new"
+13 −0
Original line number Diff line number Diff line
@@ -117,6 +117,19 @@ xpass grep -q "bar" $OUTFILE
xpass grep -q "baz" $OUTFILE
xpass grep -q "qux" $OUTFILE

echo "Override same-key values"
cat > $TEMPCONF << EOF
key = bar, baz
key := qux
EOF
echo > $INITRD

xpass $BOOTCONF -a $TEMPCONF $INITRD
$BOOTCONF $INITRD > $OUTFILE
xfail grep -q "bar" $OUTFILE
xfail grep -q "baz" $OUTFILE
xpass grep -q "qux" $OUTFILE

echo "Double/single quotes test"
echo "key = '\"string\"';" > $TEMPCONF
$BOOTCONF -a $TEMPCONF $INITRD