]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-menuentry-formats.c
test/parser: Add SLES btrfs snapshot stanza
[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 #endif
24
25 void run_test(struct parser_test *test)
26 {
27         struct discover_boot_option *opt;
28         char str[] = "test.0";
29         int i;
30
31         test_read_conf_embedded(test, "/grub2/grub.cfg");
32
33         test_run_parser(test, "grub2");
34
35         check_boot_option_count(test->ctx, 10);
36         for (i = 0; i < 8; i++) {
37                 opt = get_boot_option(test->ctx, i);
38                 str[5] = i + '0';
39                 check_name(opt, str);
40         }
41 }