1 #include "parser-test.h"
3 #include <talloc/talloc.h>
5 #if 0 /* PARSER_EMBEDDED_CONFIG */
29 void run_test(struct parser_test *test)
31 struct discover_boot_option *opt[4];
32 struct discover_device *dev[4];
33 struct discover_context *ctx;
37 test_read_conf_embedded(test, "/etc/yaboot.conf");
39 test_run_parser(test, "yaboot");
43 check_boot_option_count(ctx, 4);
45 for (i = 0; i < 4; i++)
46 opt[i] = get_boot_option(ctx, i);
48 check_name(opt[0], "linux.1");
49 check_unresolved_resource(opt[0]->boot_image);
50 check_unresolved_resource(opt[0]->initrd);
52 check_name(opt[1], "linux.2");
53 check_unresolved_resource(opt[1]->boot_image);
54 check_unresolved_resource(opt[1]->initrd);
56 check_name(opt[2], "linux.3");
57 check_unresolved_resource(opt[2]->boot_image);
58 check_unresolved_resource(opt[2]->initrd);
60 check_name(opt[3], "linux.4");
61 check_unresolved_resource(opt[3]->boot_image);
62 check_unresolved_resource(opt[3]->initrd);
64 /* hotplug all dependent devices */
65 for (i = 0; i < 4; i++) {
66 devname = talloc_asprintf(test, "sda%d", i + 1);
67 dev[i] = test_create_device(test, devname);
68 test_hotplug_device(test, dev[i]);
71 check_resolved_local_resource(opt[0]->boot_image, dev[0], "/vmlinux.1");
72 check_resolved_local_resource(opt[1]->boot_image, dev[1], "/vmlinux.2");
73 check_resolved_local_resource(opt[2]->boot_image, dev[2], "/vmlinux.3");
74 check_resolved_local_resource(opt[3]->boot_image, dev[3], "/vmlinux.4");
76 check_resolved_local_resource(opt[0]->initrd, dev[0], "/initrd.1");
77 check_resolved_local_resource(opt[1]->initrd, dev[1], "/initrd.2");
78 check_resolved_local_resource(opt[2]->initrd, dev[2], "/initrd.3");
79 check_resolved_local_resource(opt[3]->initrd, dev[2], "/initrd.4");