]> git.ozlabs.org Git - petitboot/blob - test/parser/test-kboot-default.c
discover/grub2: Allow to separate the --id argument using a space char
[petitboot] / test / parser / test-kboot-default.c
1
2 #include "parser-test.h"
3
4 static const char config[] =
5         "default=linux\n"
6         "linux='/vmlinux initrd=/initrd arg1=value1 arg2'\n"
7         "hdd='/vmlinux initrd=/initrd'\n";
8
9 void run_test(struct parser_test *test)
10 {
11         struct discover_boot_option *opt;
12         struct discover_context *ctx;
13
14         test_read_conf_data(test, "/kboot.conf", config);
15
16         test_run_parser(test, "kboot");
17
18         ctx = test->ctx;
19
20         check_boot_option_count(ctx, 2);
21         opt = get_boot_option(ctx, 0);
22
23         check_name(opt, "linux");
24         check_resolved_local_resource(opt->boot_image, ctx->device, "/vmlinux");
25         check_resolved_local_resource(opt->initrd, ctx->device, "/initrd");
26
27         check_args(opt, "arg1=value1 arg2");
28
29         check_is_default(opt);
30 }