4 #include <talloc/talloc.h>
6 #include "parser-test.h"
8 #if 0 /* PARSER_EMBEDDED_CONFIG */
10 save_env -f env_file hello
13 static const char *envsig = "# GRUB Environment Block\n";
15 void run_test(struct parser_test *test)
17 const char *env_before, *env_after;
19 /* The environment file must be preallocated */
21 /* The padding at the end of the environment block is the length of
23 env_before = talloc_asprintf(test, "%s%s", envsig,
25 test_add_file_data(test, test->ctx->device, "/boot/grub/env_file",
26 env_before, strlen(env_before));
28 env_after = talloc_asprintf(test, "%s%s", envsig,
31 test_read_conf_embedded(test, "/boot/grub/grub.cfg");
33 test_run_parser(test, "grub2");
35 check_file_contents(test, test->ctx->device, "/boot/grub/env_file",
36 env_after, strlen(env_after));