1 #include "parser-test.h"
3 #if 0 /* PARSER_EMBEDDED_CONFIG */
7 void run_test(struct parser_test *test)
9 struct discover_boot_option *opt;
10 struct discover_context *ctx;
12 test_add_dir(test, test->ctx->device, "/loader/entries");
14 test_add_file_string(test, test->ctx->device,
15 "/loader/entries/6c063c8e48904f2684abde8eea303f41-4.15.2-302.fc28.x86_64.conf",
16 "title Fedora (4.15.2-302.fc28.x86_64) 28 (Twenty Eight)\n"
17 "linux /vmlinuz-4.15.2-302.fc28.x86_64\n"
18 "initrd /initramfs-4.15.2-302.fc28.x86_64.img\n"
19 "options root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root\n\n");
21 test_add_file_string(test, test->ctx->device,
22 "/loader/entries/6c063c8e48904f2684abde8eea303f41-4.14.18-300.fc28.x86_64.conf",
23 "title Fedora (4.14.18-300.fc28.x86_64) 28 (Twenty Eight)\n"
24 "linux /vmlinuz-4.14.18-300.fc28.x86_64\n"
25 "initrd /initramfs-4.14.18-300.fc28.x86_64.img\n"
26 "options root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root\n");
28 test_read_conf_embedded(test, "/boot/grub2/grub.cfg");
30 test_run_parser(test, "grub2");
34 check_boot_option_count(ctx, 2);
35 opt = get_boot_option(ctx, 0);
37 check_name(opt, "Fedora (4.15.2-302.fc28.x86_64) 28 (Twenty Eight)");
38 check_resolved_local_resource(opt->boot_image, ctx->device,
39 "/vmlinuz-4.15.2-302.fc28.x86_64");
41 opt = get_boot_option(ctx, 1);
43 check_name(opt, "Fedora (4.14.18-300.fc28.x86_64) 28 (Twenty Eight)");
44 check_resolved_local_resource(opt->initrd, ctx->device,
45 "/initramfs-4.14.18-300.fc28.x86_64.img");