X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=test%2Fparser%2Ftest-grub2-f18-ppc64.c;h=94eb6a48b694cad56fcdb79063c527370e844a99;hp=4d7c8eca3886656647313dad09495deb0df481e9;hb=70ad7ba01b43404585c76512bffe99ede0c0f55a;hpb=ca4dc846bddf8feaafacbdb9c6ebb086a9d99723 diff --git a/test/parser/test-grub2-f18-ppc64.c b/test/parser/test-grub2-f18-ppc64.c index 4d7c8ec..94eb6a4 100644 --- a/test/parser/test-grub2-f18-ppc64.c +++ b/test/parser/test-grub2-f18-ppc64.c @@ -5,6 +5,7 @@ void run_test(struct parser_test *test) { struct discover_boot_option *opt; struct discover_context *ctx; + struct discover_device *dev; int i; test_read_conf_file(test, "grub2-f18-ppc64.conf"); @@ -17,10 +18,8 @@ void run_test(struct parser_test *test) for (i = 0; i < 2; i++) { opt = get_boot_option(ctx, i); - check_resolved_local_resource(opt->boot_image, ctx->device, - "/vmlinuz-3.6.10-4.fc18.ppc64p7"); - check_resolved_local_resource(opt->initrd, ctx->device, - "/initramfs-3.6.10-4.fc18.ppc64p7.img"); + check_unresolved_resource(opt->boot_image); + check_unresolved_resource(opt->initrd); check_args(opt, "root=/dev/mapper/fedora_ltcfbl8eb-root ro " "rd.lvm.lv=fedora_ltcfbl8eb/swap rd.dm=0 " @@ -30,5 +29,25 @@ void run_test(struct parser_test *test) check_name(opt, i == 0 ? "Fedora" : "Fedora, with Linux 3.6.10-4.fc18.ppc64p7"); + if (i == 0) + check_name(opt, "Fedora"); + else + check_name(opt, "Fedora, " + "with Linux 3.6.10-4.fc18.ppc64p7"); + } + + /* hotplug a device with a maching UUID, and check that our + * resources become resolved */ + dev = test_create_device(ctx, "external"); + dev->uuid = "773653a7-660e-490e-9a74-d9fdfc9bbbf6"; + test_hotplug_device(test, dev); + + for (i = 0; i < 2; i++) { + opt = get_boot_option(ctx, i); + + check_resolved_local_resource(opt->boot_image, dev, + "/vmlinuz-3.6.10-4.fc18.ppc64p7"); + check_resolved_local_resource(opt->initrd, dev, + "/initramfs-3.6.10-4.fc18.ppc64p7.img"); } }