]> git.ozlabs.org Git - petitboot/commitdiff
test/parser: Add Fedora 20 ppc64 parser testcase
authorJeremy Kerr <jk@ozlabs.org>
Tue, 28 Jan 2014 01:42:28 +0000 (09:42 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Thu, 30 Jan 2014 13:59:10 +0000 (21:59 +0800)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
test/parser/Makefile.am
test/parser/data/grub2-f20-ppc.conf [new file with mode: 0644]
test/parser/test-grub2-f20-ppc64.c [new file with mode: 0644]

index 7940f9d96a501dbcee54d1efdc34b8915753d325..9393b2a99b286fb7042e9296eb6751f58928da4d 100644 (file)
@@ -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 (file)
index 0000000..ed598e2
--- /dev/null
@@ -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 (file)
index 0000000..fdba933
--- /dev/null
@@ -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);
+}