]> git.ozlabs.org Git - petitboot/blob - test/parser/test-yaboot-root-override.c
discover/pxe: check for a valid boot option before adding
[petitboot] / test / parser / test-yaboot-root-override.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 default=linux
6 root=/dev/sda1
7
8 image=/vmlinux
9         label=linux 1
10
11 image=/vmlinux
12         label=linux 2
13         root=/dev/sda2
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);
22         test_run_parser(test, "yaboot");
23
24         ctx = test->ctx;
25
26         check_boot_option_count(ctx, 2);
27
28         opt = get_boot_option(ctx, 0);
29         check_name(opt, "linux 1");
30         check_args(opt, "root=/dev/sda1");
31
32         opt = get_boot_option(ctx, 1);
33         check_name(opt, "linux 2");
34         check_args(opt, "root=/dev/sda2");
35 }