]> git.ozlabs.org Git - petitboot/blob - test/parser/test-grub2-f18-ppc64.c
discover/platform-powerpc: Remove unused max_partition_size
[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                         "/boot/grub2/grub.cfg");
13
14         test_run_parser(test, "grub2");
15
16         ctx = test->ctx;
17
18         check_boot_option_count(ctx, 2);
19
20         for (i = 0; i < 2; i++) {
21                 opt = get_boot_option(ctx, i);
22
23                 check_unresolved_resource(opt->boot_image);
24                 check_unresolved_resource(opt->initrd);
25
26                 check_args(opt, "root=/dev/mapper/fedora_ltcfbl8eb-root ro "
27                                 "rd.lvm.lv=fedora_ltcfbl8eb/swap rd.dm=0 "
28                                 "rd.lvm.lv=fedora_ltcfbl8eb/root rd.md=0 "
29                                 "rd.luks=0 vconsole.keymap=us rhgb quiet");
30
31                 check_name(opt, i == 0 ?
32                                 "Fedora" :
33                                 "Fedora, with Linux 3.6.10-4.fc18.ppc64p7");
34                 if (i == 0)
35                         check_name(opt, "Fedora");
36                 else
37                         check_name(opt, "Fedora, "
38                                         "with Linux 3.6.10-4.fc18.ppc64p7");
39         }
40
41         /* hotplug a device with a maching UUID, and check that our
42          * resources become resolved */
43         dev = test_create_device(test, "external");
44         dev->uuid = "773653a7-660e-490e-9a74-d9fdfc9bbbf6";
45         test_hotplug_device(test, dev);
46
47         for (i = 0; i < 2; i++) {
48                 opt = get_boot_option(ctx, i);
49
50                 check_resolved_local_resource(opt->boot_image, dev,
51                                 "/vmlinuz-3.6.10-4.fc18.ppc64p7");
52                 check_resolved_local_resource(opt->initrd, dev,
53                                 "/initramfs-3.6.10-4.fc18.ppc64p7.img");
54         }
55 }