2 #include "parser-test.h"
5 void run_test(struct parser_test *test)
7 struct discover_boot_option *opt;
8 struct discover_context *ctx;
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");
14 test_run_parser(test, "syslinux");
18 check_boot_option_count(ctx, 3);
20 opt = get_boot_option(ctx, 1);
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");
28 opt = get_boot_option(ctx, 2);
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");
35 opt = get_boot_option(ctx, 0);
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);