1
0
Fork 0

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: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
5.9.x+fslc
Masami Hiramatsu 2020-07-16 01:00:38 +09:00 committed by Steven Rostedt (VMware)
parent a2de2f86ae
commit 8146419283
4 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,3 @@
key.subkey = value
# We can not override pre-defined subkeys with value
key := value

View File

@ -0,0 +1,3 @@
key = value
# We can not override pre-defined value with subkey
key.subkey := value

View File

@ -0,0 +1,6 @@
# Override the value
key.word = 1,2,4
key.word := 2,3
# No pre-defined key
key.new.word := "new"

View File

@ -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