]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-multiple-resolve.c
po/en: Fix inconsistencies with trailing colons
[petitboot] / test / parser / test-grub2-multiple-resolve.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 menuentry 'Linux 1' {
6         search --set=root 48c1b787-20ad-47ce-b9eb-b108dddc3535
7         linux   /vmlinux
8 }
9
10 menuentry 'Linux 2' {
11         search --set=root 48c1b787-20ad-47ce-b9eb-b108dddc3535
12         linux   /vmlinux
13 }
14 #endif
15
16 void run_test(struct parser_test *test)
17 {
18         struct discover_boot_option *opt[2];
19         struct discover_context *ctx;
20         struct discover_device *dev;
21
22         test_read_conf_embedded(test, "/grub.cfg");
23
24         test_run_parser(test, "grub2");
25
26         ctx = test->ctx;
27
28         check_boot_option_count(ctx, 2);
29
30         opt[0] = get_boot_option(ctx, 0);
31         opt[1] = get_boot_option(ctx, 1);
32
33         check_unresolved_resource(opt[0]->boot_image);
34         check_not_present_resource(opt[0]->initrd);
35         check_unresolved_resource(opt[1]->boot_image);
36         check_not_present_resource(opt[1]->initrd);
37
38         dev = test_create_device(test, "external");
39         dev->uuid = "48c1b787-20ad-47ce-b9eb-b108dddc3535";
40         test_hotplug_device(test, dev);
41
42         check_resolved_local_resource(opt[0]->boot_image, dev, "/vmlinux");
43         check_not_present_resource(opt[0]->initrd);
44         check_resolved_local_resource(opt[1]->boot_image, dev, "/vmlinux");
45         check_not_present_resource(opt[1]->initrd);
46 }