test/parser: Add check_not_present_resource
[petitboot] / test / parser / test-yaboot-external.c
1
2 #include "parser-test.h"
3
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
5 default=
6
7 image=external:/vmlinux
8         label=linux
9         initrd=external:/initrd
10 #endif
11
12 void run_test(struct parser_test *test)
13 {
14         struct discover_boot_option *opt;
15         struct discover_context *ctx;
16         struct discover_device *dev;
17
18         test_read_conf_embedded(test);
19         test_run_parser(test, "yaboot");
20
21         ctx = test->ctx;
22
23         check_boot_option_count(ctx, 1);
24
25         opt = get_boot_option(ctx, 0);
26
27         check_name(opt, "linux");
28         check_unresolved_resource(opt->boot_image);
29         check_unresolved_resource(opt->initrd);
30
31         dev = test_create_device(ctx, "external");
32         test_hotplug_device(test, dev);
33
34         check_resolved_local_resource(opt->boot_image, dev, "/vmlinux");
35         check_resolved_local_resource(opt->initrd, dev, "/initrd");
36 }