lib/url: Include port in pb_url_to_string()
[petitboot] / test / parser / test-pxe-pathprefix-port.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 default linux
6
7 label linux
8 kernel ./kernel
9 append command line
10 initrd /initrd
11 #endif
12
13 void run_test(struct parser_test *test)
14 {
15         struct discover_boot_option *opt;
16         struct discover_context *ctx;
17
18         test_read_conf_embedded_url(test,
19                         "http://host:8080/path/to/pxelinux.cfg/default");
20
21         test_set_event_source(test);
22         test_set_event_param(test->ctx->event, "ip", "192.168.0.1");
23         test_set_event_param(test->ctx->event, "pxepathprefix",
24                         "http://host:8080/path/to/");
25
26         test_run_parser(test, "pxe");
27
28         ctx = test->ctx;
29
30         check_boot_option_count(ctx, 1);
31         opt = get_boot_option(ctx, 0);
32
33         check_name(opt, "linux");
34         check_args(opt, "command line");
35
36         check_resolved_url_resource(opt->boot_image,
37                         "http://host:8080/path/to/./kernel");
38         check_resolved_url_resource(opt->initrd,
39                         "http://host:8080/path/to/initrd");
40 }