]> git.ozlabs.org Git - petitboot/blob - test/parser/test-syslinux-global-append.c
docker/build-pb: Add --interactive flag
[petitboot] / test / parser / test-syslinux-global-append.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5
6 APPEND console=ttyS0
7
8 LABEL linux
9 LINUX /vmlinuz
10 APPEND console=tty0
11
12 LABEL backup
13 KERNEL /backup/vmlinuz
14 APPEND root=/dev/sdb
15 INITRD /boot/initrd
16
17 LABEL hyphen
18 KERNEL /test/vmlinuz
19 APPEND -
20
21 #endif
22
23 void run_test(struct parser_test *test)
24 {
25         struct discover_boot_option *opt;
26         struct discover_context *ctx;
27
28         test_read_conf_embedded(test, "/syslinux/syslinux.cfg");
29
30         test_run_parser(test, "syslinux");
31
32         ctx = test->ctx;
33
34         check_boot_option_count(ctx, 3);
35         opt = get_boot_option(ctx, 2);
36
37         check_name(opt, "linux");
38         check_resolved_local_resource(opt->boot_image, ctx->device, "/vmlinuz");
39         check_is_default(opt);
40         check_args(opt, "console=ttyS0 console=tty0");
41         check_not_present_resource(opt->initrd);
42
43         opt = get_boot_option(ctx, 1);
44
45         check_name(opt, "backup");
46         check_resolved_local_resource(opt->boot_image, ctx->device, "/backup/vmlinuz");
47         check_args(opt, "console=ttyS0 root=/dev/sdb");
48         check_resolved_local_resource(opt->initrd, ctx->device, "/boot/initrd");
49
50         opt = get_boot_option(ctx, 0);
51
52         check_name(opt, "hyphen");
53         check_resolved_local_resource(opt->boot_image, ctx->device, "/test/vmlinuz");
54         check_args(opt, "");
55         check_not_present_resource(opt->initrd);
56 }