]> git.ozlabs.org Git - petitboot/blob - test/parser/test-pxe-ipxe-default.c
discover/grub2: Allow to separate the --id argument using a space char
[petitboot] / test / parser / test-pxe-ipxe-default.c
1 #include "parser-test.h"
2
3 #if 0 /* PARSER_EMBEDDED_CONFIG */
4 #!ipxe
5 kernel vmlinux --name test-option
6 initrd initrd
7 boot
8 #endif
9
10 /**
11  * Test that we recognise an ipxe-formatted script obtained from bootfile_url
12  * (DHCPv6 option 59) that some vendors use, and that we set it as default.
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/dir1/conf");
21
22         test_set_event_source(test);
23         test_set_event_param(test->ctx->event, "bootfile_url", "tftp://host/dir1/conf");
24
25         test_run_parser(test, "pxe");
26
27         ctx = test->ctx;
28
29         check_boot_option_count(ctx, 1);
30         opt = get_boot_option(ctx, 0);
31
32         check_name(opt, "test-option");
33
34         check_resolved_url_resource(opt->boot_image,
35                         "tftp://host/dir1/vmlinux");
36         check_resolved_url_resource(opt->initrd,
37                         "tftp://host/dir1/initrd");
38         check_args(opt, NULL);
39         check_is_default(opt);
40 }