]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-menuentry-formats.c
discover/grub2: Allow to separate the --id argument using a space char
[petitboot] / test / parser / test-grub2-menuentry-formats.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 menuentry "test.0" {linux /vmlinux;}
6 menuentry "test.1" {linux /vmlinux}
7 menuentry "test.2" {linux /vmlinux }
8 menuentry "test.3" { linux /vmlinux; }
9 menuentry "test.4" {linux /vmlinux ;}
10 menuentry "test.5" {
11 linux /vmlinux;}
12 menuentry "test.6" {linux /vmlinux
13 }
14 menuentry "test.7" {
15 linux /vmlinux
16 }
17 menuentry "test.8" {
18  linux /vmlinux
19 }
20 menuentry "test.9" {
21  linux /vmlinux
22  }
23 menuentry "" {
24  linux /vmlinux
25  }
26 #endif
27
28 void run_test(struct parser_test *test)
29 {
30         struct discover_boot_option *opt;
31         char str[] = "test.0";
32         int i;
33
34         test_read_conf_embedded(test, "/grub2/grub.cfg");
35
36         test_run_parser(test, "grub2");
37
38         check_boot_option_count(test->ctx, 11);
39         for (i = 0; i < 8; i++) {
40                 opt = get_boot_option(test->ctx, i);
41                 str[5] = i + '0';
42                 check_name(opt, str);
43         }
44 }