]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-pos-param.c
09ac8fc4558ba81ffc4f3bf74bcc6b9bf0c83b23
[petitboot] / test / parser / test-grub2-pos-param.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5
6 function set_params_var {
7         params="$1 $2"
8 }
9 menuentry 'Linux' {
10         set_params_var abc 123
11         linux   test_kernel $params
12 }
13
14 #endif
15
16 void run_test(struct parser_test *test)
17 {
18         struct discover_boot_option *opt;
19         struct discover_context *ctx;
20
21         test_read_conf_embedded(test, "/boot/grub/grub.cfg");
22
23         test_run_parser(test, "grub2");
24
25         ctx = test->ctx;
26
27         check_boot_option_count(ctx, 1);
28         opt = get_boot_option(ctx, 0);
29
30         check_name(opt, "Linux");
31         /* The linux command, $params is expected to have been set when
32          * set_params was called in menuentry.
33          */
34         check_args(opt, "abc 123");
35 }