From: Jeremy Kerr Date: Tue, 28 Jan 2014 01:42:28 +0000 (+0800) Subject: test/parser: Add Fedora 20 ppc64 parser testcase X-Git-Tag: v1.0.0~251 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=d239d484e3d34da52024f6e97e7046774d7b299d test/parser: Add Fedora 20 ppc64 parser testcase Signed-off-by: Jeremy Kerr --- diff --git a/test/parser/Makefile.am b/test/parser/Makefile.am index 7940f9d..9393b2a 100644 --- a/test/parser/Makefile.am +++ b/test/parser/Makefile.am @@ -39,6 +39,7 @@ TESTS = \ test-grub2-saved-default \ test-grub2-nondefault-prefix \ test-grub2-f18-ppc64 \ + test-grub2-f20-ppc64 \ test-grub2-ubuntu-13_04-x86 \ test-grub2-lexer-error \ test-grub2-parser-error \ @@ -105,6 +106,7 @@ check_PROGRAMS = $(TESTS) libtest.ro check_DATA = \ data/grub2-f18-ppc64.conf \ + data/grub2-f20-ppc.conf \ data/grub2-ubuntu-13_04-x86.conf \ data/yaboot-rh8-ppc64.conf diff --git a/test/parser/data/grub2-f20-ppc.conf b/test/parser/data/grub2-f20-ppc.conf new file mode 100644 index 0000000..ed598e2 --- /dev/null +++ b/test/parser/data/grub2-f20-ppc.conf @@ -0,0 +1,34 @@ +set default=0 +set timeout=5 + +echo -e "\nWelcome to the Fedora 20 installer!\n\n" + +for BITS in 32 64; do + if [ -d "/ppc/ppc${BITS}" ]; then + menuentry "Install Fedora 20 (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os { + linux /ppc/ppc${2}/vmlinuz ro + initrd /ppc/ppc${2}/initrd.img + } + + menuentry "Test this media & install Fedora 20 (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os { + linux /ppc/ppc${2}/vmlinuz rd.live.check ro + initrd /ppc/ppc${2}/initrd.img + } + + menuentry "Rescue a Fedora system (${BITS}-bit kernel)" $BITS --class fedora --class gnu-linux --class gnu --class os { + linux /ppc/ppc${2}/vmlinuz rescue ro + initrd /ppc/ppc${2}/initrd.img + } + fi +done + +submenu 'Other options...' { + menuentry 'Reboot' { + reboot + } + + menuentry 'Exit to Open Firmware' { + exit + } +} + diff --git a/test/parser/test-grub2-f20-ppc64.c b/test/parser/test-grub2-f20-ppc64.c new file mode 100644 index 0000000..fdba933 --- /dev/null +++ b/test/parser/test-grub2-f20-ppc64.c @@ -0,0 +1,18 @@ + +#include "parser-test.h" + +void run_test(struct parser_test *test) +{ + struct discover_context *ctx; + + test_add_dir(test, test->ctx->device, "/ppc/ppc64"); + + test_read_conf_file(test, "grub2-f20-ppc.conf", + "/boot/grub/grub.cfg"); + + test_run_parser(test, "grub2"); + + ctx = test->ctx; + + check_boot_option_count(ctx, 3); +}