]> git.ozlabs.org Git - petitboot/blob - test/parser/test-pxe-discover-bootfile-relative-conffile.c
discover/network: Fix incorrect udhcpc command if we have no platform definition
[petitboot] / test / parser / test-pxe-discover-bootfile-relative-conffile.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 /**
11  * Test that a pxeconffile option (DHCP opt 209) takes precedence over
12  * configuration discovery, and is resolved relative to bootfile
13  */
14
15 void run_test(struct parser_test *test)
16 {
17         struct discover_boot_option *opt;
18         struct discover_context *ctx;
19
20         test_read_conf_embedded_url(test, "tftp://host/dir/conf.text");
21
22         test_set_event_source(test);
23         test_set_event_param(test->ctx->event, "bootfile", "dir/binary");
24         test_set_event_param(test->ctx->event, "pxeconffile", "conf.text");
25         test_set_event_param(test->ctx->event, "tftp", "host");
26
27         test_run_parser(test, "pxe");
28
29         ctx = test->ctx;
30
31         check_boot_option_count(ctx, 1);
32         opt = get_boot_option(ctx, 0);
33
34         check_name(opt, "linux");
35
36         check_resolved_url_resource(opt->boot_image, "tftp://host/dir/vmlinux");
37         check_resolved_url_resource(opt->initrd, "tftp://host/dir/initrd");
38 }