summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-05-08 16:46:26 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-05-16 11:56:28 +0800
commit70ad7ba01b43404585c76512bffe99ede0c0f55a (patch)
tree29cab1eb47840f662a8468356c59a928a33a2399 /test
parentca4dc846bddf8feaafacbdb9c6ebb086a9d99723 (diff)
downloadpetitboot-70ad7ba01b43404585c76512bffe99ede0c0f55a.zip
petitboot-70ad7ba01b43404585c76512bffe99ede0c0f55a.tar.gz
discover/grub2: handle search commands to specify root filesystems
Add a resource type for grub, allowing us to parse search parameters. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'test')
-rw-r--r--test/parser/test-grub2-f18-ppc64.c27
1 files changed, 23 insertions, 4 deletions
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");
}
}
OpenPOWER on IntegriCloud