Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Masami Hiramatsu and committed by
Steven Rostedt (VMware)
81464192 a2de2f86

+25
+3
tools/bootconfig/samples/bad-override.bconf
··· 1 + key.subkey = value 2 + # We can not override pre-defined subkeys with value 3 + key := value
+3
tools/bootconfig/samples/bad-override2.bconf
··· 1 + key = value 2 + # We can not override pre-defined value with subkey 3 + key.subkey := value
+6
tools/bootconfig/samples/good-override.bconf
··· 1 + # Override the value 2 + key.word = 1,2,4 3 + key.word := 2,3 4 + 5 + # No pre-defined key 6 + key.new.word := "new"
+13
tools/bootconfig/test-bootconfig.sh
··· 117 117 xpass grep -q "baz" $OUTFILE 118 118 xpass grep -q "qux" $OUTFILE 119 119 120 + echo "Override same-key values" 121 + cat > $TEMPCONF << EOF 122 + key = bar, baz 123 + key := qux 124 + EOF 125 + echo > $INITRD 126 + 127 + xpass $BOOTCONF -a $TEMPCONF $INITRD 128 + $BOOTCONF $INITRD > $OUTFILE 129 + xfail grep -q "bar" $OUTFILE 130 + xfail grep -q "baz" $OUTFILE 131 + xpass grep -q "qux" $OUTFILE 132 + 120 133 echo "Double/single quotes test" 121 134 echo "key = '\"string\"';" > $TEMPCONF 122 135 $BOOTCONF -a $TEMPCONF $INITRD