mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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>
This commit is contained in:
parent
a2de2f86ae
commit
8146419283
3
tools/bootconfig/samples/bad-override.bconf
Normal file
3
tools/bootconfig/samples/bad-override.bconf
Normal file
@ -0,0 +1,3 @@
|
||||
key.subkey = value
|
||||
# We can not override pre-defined subkeys with value
|
||||
key := value
|
3
tools/bootconfig/samples/bad-override2.bconf
Normal file
3
tools/bootconfig/samples/bad-override2.bconf
Normal file
@ -0,0 +1,3 @@
|
||||
key = value
|
||||
# We can not override pre-defined value with subkey
|
||||
key.subkey := value
|
6
tools/bootconfig/samples/good-override.bconf
Normal file
6
tools/bootconfig/samples/good-override.bconf
Normal 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"
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user