summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--discover/pxe-parser.c3
-rw-r--r--test/parser/Makefile.am1
-rw-r--r--test/parser/test-pxe-empty.c19
3 files changed, 22 insertions, 1 deletions
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index 1f6eb0f..ca0f4b5 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -12,7 +12,8 @@
static void pxe_finish(struct conf_context *conf)
{
- discover_context_add_boot_option(conf->dc, conf->parser_info);
+ if (conf->parser_info)
+ discover_context_add_boot_option(conf->dc, conf->parser_info);
}
static void pxe_process_pair(struct conf_context *ctx,
diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am
index 9029544..e221bf2 100644
--- a/test/parser/Makefile.am
+++ b/test/parser/Makefile.am
@@ -41,6 +41,7 @@ TESTS = \
test-yaboot-device-override \
test-yaboot-default \
test-yaboot-rh8-ppc64 \
+ test-pxe-empty \
test-pxe-single \
test-pxe-initrd-in-append
diff --git a/test/parser/test-pxe-empty.c b/test/parser/test-pxe-empty.c
new file mode 100644
index 0000000..eb3b758
--- /dev/null
+++ b/test/parser/test-pxe-empty.c
@@ -0,0 +1,19 @@
+
+#include "parser-test.h"
+
+#if 0 /* PARSER_EMBEDDED_CONFIG */
+
+#endif
+
+void run_test(struct parser_test *test)
+{
+ struct discover_context *ctx;
+
+ test_read_conf_embedded(test);
+ test_set_conf_source(test, "tftp://host/dir/conf.txt");
+ test_run_parser(test, "pxe");
+
+ ctx = test->ctx;
+
+ check_boot_option_count(ctx, 0);
+}
OpenPOWER on IntegriCloud