]> git.ozlabs.org Git - petitboot/commitdiff
test/parser: Add local PXE test
authorJeremy Kerr <jk@ozlabs.org>
Thu, 7 Nov 2013 05:12:37 +0000 (13:12 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 7 Nov 2013 05:12:55 +0000 (13:12 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
test/parser/Makefile.am
test/parser/test-pxe-local.c [new file with mode: 0644]

index c02fd91ca7984f90db74df2778e042ca874cd3b0..dbf626a42fed755e581db4efafe6f0d42b65e775 100644 (file)
@@ -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 (file)
index 0000000..3a85645
--- /dev/null
@@ -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);
+}