summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSam Mendoza-Jonas <sam@mendozajonas.com>2016-01-12 15:58:13 +1100
committerSam Mendoza-Jonas <sam@mendozajonas.com>2016-02-09 13:39:50 +1100
commita1ec0710b6abad1a932d09f23010e3eb4662e8c9 (patch)
tree3ccc849f1f6c5027a31bb05361fabcab6f500be7 /test
parente25641dc14753cc070ecf50e10809ce3ce8b9ecd (diff)
downloadtalos-petitboot-a1ec0710b6abad1a932d09f23010e3eb4662e8c9.zip
talos-petitboot-a1ec0710b6abad1a932d09f23010e3eb4662e8c9.tar.gz
discover/grub: Fix handling of empty strings
If "" or '' are used in a statement to omit a word, we must still return a TOKEN_WORD for an empty string. In particular this fixes an issue where Petitboot would fail to parse the grub.cfg included in the Debian 8.2 install image, which includes a menuentry statement with an empty name. Signed-off-by: Sam Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'test')
-rw-r--r--test/parser/test-grub2-menuentry-formats.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/parser/test-grub2-menuentry-formats.c b/test/parser/test-grub2-menuentry-formats.c
index 132ce8d..3c6f4d7 100644
--- a/test/parser/test-grub2-menuentry-formats.c
+++ b/test/parser/test-grub2-menuentry-formats.c
@@ -20,6 +20,9 @@ menuentry "test.8" {
menuentry "test.9" {
linux /vmlinux
}
+menuentry "" {
+ linux /vmlinux
+ }
#endif
void run_test(struct parser_test *test)
@@ -32,7 +35,7 @@ void run_test(struct parser_test *test)
test_run_parser(test, "grub2");
- check_boot_option_count(test->ctx, 10);
+ check_boot_option_count(test->ctx, 11);
for (i = 0; i < 8; i++) {
opt = get_boot_option(test->ctx, i);
str[5] = i + '0';
OpenPOWER on IntegriCloud