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);
38 test_run_parser(test, "yaboot");
42 check_boot_option_count(ctx, 4);
44 for (i = 0; i < 4; i++)
45 opt[i] = get_boot_option(ctx, i);
47 check_name(opt[0], "linux.1");
48 check_unresolved_resource(opt[0]->boot_image);
49 check_unresolved_resource(opt[0]->initrd);
51 check_name(opt[1], "linux.2");
52 check_unresolved_resource(opt[1]->boot_image);
53 check_unresolved_resource(opt[1]->initrd);
55 check_name(opt[2], "linux.3");
56 check_unresolved_resource(opt[2]->boot_image);
57 check_unresolved_resource(opt[2]->initrd);
59 check_name(opt[3], "linux.4");
60 check_unresolved_resource(opt[3]->boot_image);
61 check_unresolved_resource(opt[3]->initrd);
63 /* hotplug all dependent devices */
64 for (i = 0; i < 4; i++) {
65 devname = talloc_asprintf(test, "sda%d", i + 1);
66 dev[i] = test_create_device(test, devname);
67 test_hotplug_device(test, dev[i]);
70 check_resolved_local_resource(opt[0]->boot_image, dev[0], "/vmlinux.1");
71 check_resolved_local_resource(opt[1]->boot_image, dev[1], "/vmlinux.2");
72 check_resolved_local_resource(opt[2]->boot_image, dev[2], "/vmlinux.3");
73 check_resolved_local_resource(opt[3]->boot_image, dev[3], "/vmlinux.4");
75 check_resolved_local_resource(opt[0]->initrd, dev[0], "/initrd.1");
76 check_resolved_local_resource(opt[1]->initrd, dev[1], "/initrd.2");
77 check_resolved_local_resource(opt[2]->initrd, dev[2], "/initrd.3");
78 check_resolved_local_resource(opt[3]->initrd, dev[2], "/initrd.4");