2 #include "parser-test.h"
4 #if 0 /* PARSER_EMBEDDED_CONFIG */
7 if [ -f /file_that_does_not_exist -a $status = success ]
10 if [ -f /dir -a $status = success ]
13 if [ ! -f /empty_file -a $status = success ]
17 if [ -s /file_that_does_not_exist -a $status = success ]
20 if [ ! -s /dir -a $status = success ]
23 if [ -s /empty_file -a $status = success ]
26 if [ ! -s /non_empty_file -a $status = success ]
30 if [ -d /file_that_does_not_exist -a $status = success ]
33 if [ ! -d /dir -a $status = success ]
36 if [ -d /empty_file -a $status = success ]
45 void run_test(struct parser_test *test)
47 struct discover_boot_option *opt;
48 struct discover_context *ctx;
52 test_read_conf_embedded(test, "/grub2/grub.cfg");
53 test_add_file_data(test, ctx->device, "/empty_file", "", 0);
54 test_add_file_data(test, ctx->device, "/non_empty_file", "1", 1);
55 test_add_dir(test, ctx->device, "/dir");
57 test_run_parser(test, "grub2");
59 check_boot_option_count(ctx, 1);
60 opt = get_boot_option(ctx, 0);
62 check_name(opt, "success");