]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-load-env.c
discover/grub2: Allow URL resources
[petitboot] / test / parser / test-grub2-load-env.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 load_env
6 menuentry 'Linux' {
7         linux   $kernel
8 }
9 #endif
10
11 void run_test(struct parser_test *test)
12 {
13         struct discover_boot_option *opt;
14         struct discover_context *ctx;
15
16         test_add_file_string(test, test->ctx->device,
17                                 "/boot/grub/grubenv",
18                                 "# GRUB Environment Block\n"
19                                 "kernel=vmlinux-from-env\n");
20
21         test_read_conf_embedded(test);
22         test_run_parser(test, "grub2");
23
24         ctx = test->ctx;
25
26         check_boot_option_count(ctx, 1);
27         opt = get_boot_option(ctx, 0);
28
29         check_name(opt, "Linux");
30         check_resolved_local_resource(opt->boot_image, ctx->device,
31                         "/vmlinux-from-env");
32 }