discover/grub2: Allow to separate the --id argument using a space char
[petitboot] / test / parser / test-grub2-blscfg-default-filename.c
1 #include "parser-test.h"
2
3 #if 0 /* PARSER_EMBEDDED_CONFIG */
4 set default=6c063c8e48904f2684abde8eea303f41-4.15.2-302.fc28.x86_64
5 blscfg
6 #endif
7
8 void run_test(struct parser_test *test)
9 {
10         struct discover_boot_option *opt;
11         struct discover_context *ctx;
12
13         test_add_dir(test, test->ctx->device, "/boot/loader/entries");
14
15         test_add_file_string(test, test->ctx->device,
16                              "/boot/loader/entries/6c063c8e48904f2684abde8eea303f41-4.15.2-302.fc28.x86_64.conf",
17                              "title Fedora (4.15.2-302.fc28.x86_64) 28 (Twenty Eight)\n"
18                              "linux /boot/vmlinuz-4.15.2-302.fc28.x86_64\n"
19                              "initrd /boot/initramfs-4.15.2-302.fc28.x86_64.img\n"
20                              "options root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/root\n");
21
22         test_read_conf_embedded(test, "/boot/grub2/grub.cfg");
23
24         test_run_parser(test, "grub2");
25
26         ctx = test->ctx;
27
28         opt = get_boot_option(ctx, 0);
29
30         check_is_default(opt);
31 }