Skip to content

Commit 8146419

Browse files
mhiramatrostedt
authored andcommitted
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 <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent a2de2f8 commit 8146419

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
key.subkey = value
2+
# We can not override pre-defined subkeys with value
3+
key := value
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
key = value
2+
# We can not override pre-defined value with subkey
3+
key.subkey := value
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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"

tools/bootconfig/test-bootconfig.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ xpass grep -q "bar" $OUTFILE
117117
xpass grep -q "baz" $OUTFILE
118118
xpass grep -q "qux" $OUTFILE
119119

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+
120133
echo "Double/single quotes test"
121134
echo "key = '\"string\"';" > $TEMPCONF
122135
$BOOTCONF -a $TEMPCONF $INITRD

0 commit comments

Comments
 (0)