]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-default-index.c
discover/syslinux-parser: consistent cmdline arg processing
[petitboot] / test / parser / test-grub2-default-index.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 set default=1
6 menuentry 'test-option-0' {
7         linux   /vmlinux.0
8 }
9 menuentry 'test-option-1' {
10         linux   /vmlinux.1
11 }
12 menuentry 'test-option-2' {
13         linux   /vmlinux.2
14 }
15 #endif
16
17 void run_test(struct parser_test *test)
18 {
19         struct discover_boot_option *opt;
20         struct discover_context *ctx;
21
22         test_read_conf_embedded(test, "/boot/grub2/grub.cfg");
23         test_run_parser(test, "grub2");
24
25         ctx = test->ctx;
26
27         check_boot_option_count(ctx, 3);
28         opt = get_boot_option(ctx, 1);
29
30         check_name(opt, "test-option-1");
31         check_resolved_local_resource(opt->boot_image, ctx->device,
32                                         "/vmlinux.1");
33         check_is_default(opt);
34 }