yaboot configuration files with no option will cause an assertion
failure (or segfault), as we unconditionally call yaboot_finish().
Check for the presence of an option in yaboot_finish() instead of
asserting.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
const char *default_label;
struct boot_option *opt;
- assert(state->opt);
+ if (!state->opt)
+ return;
opt = state->opt->option;
assert(opt);
test-grub2-lexer-error \
test-grub2-parser-error \
test-kboot-single \
+ test-yaboot-empty \
test-yaboot-single \
test-yaboot-partition \
test-yaboot-partition-override \
--- /dev/null
+#include "parser-test.h"
+
+static const char empty[] = "";
+
+void run_test(struct parser_test *test)
+{
+ test_read_conf_data(test, "/etc/yaboot.conf", empty);
+
+ test_run_parser(test, "yaboot");
+
+ check_boot_option_count(test->ctx, 0);
+}