syslinux: add syslinux parser support
[petitboot] / test / parser / test-syslinux-nested-config.c
1
2 #include "parser-test.h"
3
4
5 void run_test(struct parser_test *test)
6 {
7         struct discover_boot_option *opt;
8         struct discover_context *ctx;
9
10         test_read_conf_file(test, "syslinux-include-root.cfg", "/boot/syslinux/syslinux.cfg");
11         test_read_conf_file(test, "syslinux-include-nest-1.cfg", "/syslinux-include-nest-1.cfg");
12         test_read_conf_file(test, "syslinux-include-nest-2.cfg", "/boot/syslinux/syslinux-include-nest-2.cfg");
13
14         test_run_parser(test, "syslinux");
15
16         ctx = test->ctx;
17
18         check_boot_option_count(ctx, 3);
19
20         opt = get_boot_option(ctx, 1);
21
22         check_name(opt, "boot");
23         check_resolved_local_resource(opt->boot_image, ctx->device, "/bzImage-boot");
24         check_is_default(opt);
25         check_args(opt, "console=ttyS0 root=/dev/sda");
26         check_resolved_local_resource(opt->initrd, ctx->device, "/initrd-boot");
27
28         opt = get_boot_option(ctx, 2);
29
30         check_name(opt, "backup");
31         check_resolved_local_resource(opt->boot_image, ctx->device, "/backup/vmlinuz");
32         check_args(opt, "console=ttyS0 root=/dev/sdb");
33         check_resolved_local_resource(opt->initrd, ctx->device, "/boot/initrd");
34
35         opt = get_boot_option(ctx, 0);
36
37         check_name(opt, "linux");
38         check_resolved_local_resource(opt->boot_image, ctx->device, "/boot/bzImage");
39         check_args(opt, "console=ttyS0 root=/dev/sdc");
40         check_not_present_resource(opt->initrd);
41 }