]> git.ozlabs.org Git - petitboot/blob - test/parser/test-pxe-single.c
discover/kboot-parser: Recognise 'default' parameter
[petitboot] / test / parser / test-pxe-single.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 default linux
6
7 label linux
8 kernel ./pxe/de-ad-de-ad-be-ef.vmlinuz
9 append command line
10 initrd=./pxe/de-ad-de-ad-be-ef.initrd
11 dtb ./pxe/de-ad-de-ad-be-ef.dtb
12 #endif
13
14 void run_test(struct parser_test *test)
15 {
16         struct discover_boot_option *opt;
17         struct discover_context *ctx;
18
19         test_read_conf_embedded_url(test, "tftp://host/dir/conf.txt");
20
21         test_set_event_source(test);
22         test_set_event_param(test->ctx->event, "pxeconffile",
23                         "tftp://host/dir/conf.txt");
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, "linux");
33         check_args(opt, "command line");
34
35         check_resolved_url_resource(opt->boot_image,
36                         "tftp://host/dir/./pxe/de-ad-de-ad-be-ef.vmlinuz");
37         check_resolved_url_resource(opt->initrd,
38                         "tftp://host/dir/./pxe/de-ad-de-ad-be-ef.initrd");
39         check_resolved_url_resource(opt->dtb,
40                         "tftp://host/dir/./pxe/de-ad-de-ad-be-ef.dtb");
41 }