lib/process: Add process_get_stdout
[petitboot] / test / parser / test-pxe-path-resolve-absolute.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 label linux
6 kernel ::vmlinux
7 initrd ::/initrd
8 #endif
9
10 void run_test(struct parser_test *test)
11 {
12         struct discover_boot_option *opt;
13         struct discover_context *ctx;
14
15         test_read_conf_embedded_url(test, "tftp://host/path/conf.txt");
16
17         test_set_event_source(test);
18         test_set_event_param(test->ctx->event, "siaddr", "host");
19         test_set_event_param(test->ctx->event, "pxeconffile", "path/conf.txt");
20
21         test_run_parser(test, "pxe");
22
23         ctx = test->ctx;
24
25         check_boot_option_count(ctx, 1);
26         opt = get_boot_option(ctx, 0);
27
28         check_name(opt, "linux");
29
30         /* even though the initrd is specifed as /initrd, pxelinux treats
31          * this as relative. */
32         check_resolved_url_resource(opt->boot_image,
33                         "tftp://host/vmlinux");
34         check_resolved_url_resource(opt->initrd,
35                         "tftp://host/initrd");
36 }