summaryrefslogtreecommitdiffstats
path: root/test/parser/test-grub2-multiple-resolve.c
blob: 3bf4eab5560b83a09aa222d00cad57369ffdeb6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

#include "parser-test.h"

#if 0 /* PARSER_EMBEDDED_CONFIG */
menuentry 'Linux 1' {
	search --set=root 48c1b787-20ad-47ce-b9eb-b108dddc3535
	linux   /vmlinux
}

menuentry 'Linux 2' {
	search --set=root 48c1b787-20ad-47ce-b9eb-b108dddc3535
	linux   /vmlinux
}
#endif

void run_test(struct parser_test *test)
{
	struct discover_boot_option *opt[2];
	struct discover_context *ctx;
	struct discover_device *dev;

	test_read_conf_embedded(test);
	test_run_parser(test, "grub2");

	ctx = test->ctx;

	check_boot_option_count(ctx, 2);

	opt[0] = get_boot_option(ctx, 0);
	opt[1] = get_boot_option(ctx, 1);

	check_unresolved_resource(opt[0]->boot_image);
	check_unresolved_resource(opt[1]->boot_image);

	dev = test_create_device(ctx, "external");
	dev->uuid = "48c1b787-20ad-47ce-b9eb-b108dddc3535";
	test_hotplug_device(test, dev);

	check_resolved_local_resource(opt[0]->boot_image, dev, "/vmlinux");
	check_resolved_local_resource(opt[1]->boot_image, dev, "/vmlinux");
}
OpenPOWER on IntegriCloud