mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-21 23:16:50 +08:00
bootconfig: Add bootconfig tests about braces
Add more bootconfig tests for checking the error message of non closing brace and max number of nested braces. Link: https://lore.kernel.org/all/177337553551.416919.11217619471547711262.stgit@devnote2/ Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
This commit is contained in:
4
tools/bootconfig/samples/bad-non-closed-brace.bconf
Normal file
4
tools/bootconfig/samples/bad-non-closed-brace.bconf
Normal file
@@ -0,0 +1,4 @@
|
||||
foo {
|
||||
bar {
|
||||
buz
|
||||
}
|
||||
19
tools/bootconfig/samples/bad-over-max-brace.bconf
Normal file
19
tools/bootconfig/samples/bad-over-max-brace.bconf
Normal file
@@ -0,0 +1,19 @@
|
||||
key1 {
|
||||
key2 {
|
||||
key3 {
|
||||
key4 {
|
||||
key5 {
|
||||
key6 {
|
||||
key7 {
|
||||
key8 {
|
||||
key9 {
|
||||
key10 {
|
||||
key11 {
|
||||
key12 {
|
||||
key13 {
|
||||
key14 {
|
||||
key15 {
|
||||
key16 {
|
||||
key17 {
|
||||
}}}}}}}}}}}}}}}}}
|
||||
|
||||
1
tools/bootconfig/samples/exp-good-nested-brace.bconf
Normal file
1
tools/bootconfig/samples/exp-good-nested-brace.bconf
Normal file
@@ -0,0 +1 @@
|
||||
key1.key2.key3.key4.key5.key6.key7.key8.key9.key10.key11.key12.key13.key14.key15.key16;
|
||||
18
tools/bootconfig/samples/good-nested-brace.bconf
Normal file
18
tools/bootconfig/samples/good-nested-brace.bconf
Normal file
@@ -0,0 +1,18 @@
|
||||
key1 {
|
||||
key2 {
|
||||
key3 {
|
||||
key4 {
|
||||
key5 {
|
||||
key6 {
|
||||
key7 {
|
||||
key8 {
|
||||
key9 {
|
||||
key10 {
|
||||
key11 {
|
||||
key12 {
|
||||
key13 {
|
||||
key14 {
|
||||
key15 {
|
||||
key16 {
|
||||
}}}}}}}}}}}}}}}}
|
||||
|
||||
@@ -171,6 +171,15 @@ $BOOTCONF $INITRD > $OUTFILE
|
||||
xfail grep -q 'val[[:space:]]' $OUTFILE
|
||||
xpass grep -q 'val2[[:space:]]' $OUTFILE
|
||||
|
||||
echo "Showing correct line:column of no closing brace"
|
||||
cat > $TEMPCONF << EOF
|
||||
foo {
|
||||
bar {
|
||||
}
|
||||
EOF
|
||||
$BOOTCONF -a $TEMPCONF $INITRD 2> $OUTFILE
|
||||
xpass grep -q "1:1" $OUTFILE
|
||||
|
||||
echo "=== expected failure cases ==="
|
||||
for i in samples/bad-* ; do
|
||||
xfail $BOOTCONF -a $i $INITRD
|
||||
|
||||
Reference in New Issue
Block a user