summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-11-07 13:12:37 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-11-07 13:12:55 +0800
commit9d966d3d4a0d37ff8e3ca17e8cbca34feb4828dd (patch)
treeab420e65984792dfd4d00c18be7443c1f3abeb01 /test
parent6b0d0a38421c6ff044d005042d7309cbf36aface (diff)
downloadtalos-petitboot-9d966d3d4a0d37ff8e3ca17e8cbca34feb4828dd.tar.gz
talos-petitboot-9d966d3d4a0d37ff8e3ca17e8cbca34feb4828dd.zip
test/parser: Add local PXE test
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'test')
-rw-r--r--test/parser/Makefile.am3
-rw-r--r--test/parser/test-pxe-local.c18
2 files changed, 20 insertions, 1 deletions
diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am
index c02fd91..dbf626a 100644
--- a/test/parser/Makefile.am
+++ b/test/parser/Makefile.am
@@ -54,7 +54,8 @@ TESTS = \
test-pxe-initrd-in-append \
test-pxe-mac-without-conf \
test-pxe-ip-without-conf \
- test-pxe-non-url-conf
+ test-pxe-non-url-conf \
+ test-pxe-local
$(TESTS): %: %.embedded-config.o
$(TESTS): LDADD += $@.embedded-config.o
diff --git a/test/parser/test-pxe-local.c b/test/parser/test-pxe-local.c
new file mode 100644
index 0000000..3a85645
--- /dev/null
+++ b/test/parser/test-pxe-local.c
@@ -0,0 +1,18 @@
+#include "parser-test.h"
+
+#if 0 /* PARSER_EMBEDDED_CONFIG */
+menuentry 'Linux' {
+ linux /vmlinux
+ initrd /initrd
+}
+#endif
+
+/* check that the PXE parser won't break on a local device */
+void run_test(struct parser_test *test)
+{
+ test_read_conf_embedded(test, "/grub2/grub.cfg");
+
+ test_run_parser(test, "pxe");
+
+ check_boot_option_count(test->ctx, 0);
+}
OpenPOWER on IntegriCloud