]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-f18-ppc64.c
0baac052f3b5c140b8fbf414d1fe8cdb451573ca
[petitboot] / test / parser / test-grub2-f18-ppc64.c
1
2 #include "parser-test.h"
3
4 void run_test(struct parser_test *test)
5 {
6         struct discover_boot_option *opt;
7         struct discover_context *ctx;
8         struct discover_device *dev;
9         int i;
10
11         test_read_conf_file(test, "grub2-f18-ppc64.conf");
12         test_run_parser(test, "grub2");
13
14         ctx = test->ctx;
15
16         check_boot_option_count(ctx, 2);
17
18         for (i = 0; i < 2; i++) {
19                 opt = get_boot_option(ctx, i);
20
21                 check_unresolved_resource(opt->boot_image);
22                 check_unresolved_resource(opt->initrd);
23
24                 check_args(opt, "root=/dev/mapper/fedora_ltcfbl8eb-root ro "
25                                 "rd.lvm.lv=fedora_ltcfbl8eb/swap rd.dm=0 "
26                                 "rd.lvm.lv=fedora_ltcfbl8eb/root rd.md=0 "
27                                 "rd.luks=0 vconsole.keymap=us rhgb quiet");
28
29                 check_name(opt, i == 0 ?
30                                 "Fedora" :
31                                 "Fedora, with Linux 3.6.10-4.fc18.ppc64p7");
32                 if (i == 0)
33                         check_name(opt, "Fedora");
34                 else
35                         check_name(opt, "Fedora, "
36                                         "with Linux 3.6.10-4.fc18.ppc64p7");
37         }
38
39         /* hotplug a device with a maching UUID, and check that our
40          * resources become resolved */
41         dev = test_create_device(test, "external");
42         dev->uuid = "773653a7-660e-490e-9a74-d9fdfc9bbbf6";
43         test_hotplug_device(test, dev);
44
45         for (i = 0; i < 2; i++) {
46                 opt = get_boot_option(ctx, i);
47
48                 check_resolved_local_resource(opt->boot_image, dev,
49                                 "/vmlinuz-3.6.10-4.fc18.ppc64p7");
50                 check_resolved_local_resource(opt->initrd, dev,
51                                 "/initramfs-3.6.10-4.fc18.ppc64p7.img");
52         }
53 }