Blame SOURCES/0053-Add-a-test-case-for-a-failure-rmarshall-saw-in-set-i.patch

903092
From e6d22da1ef26780c73b610c4d64552da84b7fa34 Mon Sep 17 00:00:00 2001
903092
From: Peter Jones <pjones@redhat.com>
903092
Date: Fri, 24 Jun 2016 16:13:41 -0400
903092
Subject: [PATCH 53/55] Add a test case for a failure rmarshall saw in
903092
 --set-index=
903092
903092
Related: rhbz#1285601
903092
903092
Signed-off-by: Peter Jones <pjones@redhat.com>
903092
---
903092
 test.sh                            |   9 ++
903092
 test/grub2-support_files/grubenv.3 |   3 +
903092
 test/grub2.18                      | 154 ++++++++++++++++++++++++++++++++++
903092
 test/results/add/g2-1.18           | 168 +++++++++++++++++++++++++++++++++++++
903092
 4 files changed, 334 insertions(+)
903092
 create mode 100644 test/grub2-support_files/grubenv.3
903092
 create mode 100644 test/grub2.18
903092
 create mode 100644 test/results/add/g2-1.18
903092
903092
diff --git a/test.sh b/test.sh
903092
index 9ac0ec9..dbf7507 100755
903092
--- a/test.sh
903092
+++ b/test.sh
903092
@@ -570,6 +570,15 @@ if [ "$testgrub2" == "y" ]; then
903092
         --copy-default --title 'Red Hat Enterprise Linux Server' \
903092
         --args=root=/dev/mapper/foo--
903092
 
903092
+    # copy a stanza and add arguments as well, while using --set-index=
903092
+    testing="GRUB2 add stanza and new args with --set-index="
903092
+    grub2Test grub2.18 add/g2-1.18  --env grubenv.3 \
903092
+        --add-kernel=/boot/vmlinuz-3.10.0-327.22.2.el7.x86_64.debug \
903092
+        --boot-filesystem=/boot --copy-default \
903092
+        --title "Red Hat Enterprise Linux Server (3.10.0-327.22.2.el7.x86_64.debug) 7.2 (Maipo) with debugging" \
903092
+        --args="root=/dev/mapper/rhel_team--area--222-root systemd.log_level=debug systemd.log_target=kmsg" \
903092
+        --set-index=1
903092
+
903092
     testing="GRUB2 add initrd"
903092
     grub2Test grub2.2 add/g2-1.4 --update-kernel=/boot/new-kernel.img \
903092
         --initrd=/boot/new-initrd --boot-filesystem=/boot/
903092
diff --git a/test/grub2-support_files/grubenv.3 b/test/grub2-support_files/grubenv.3
903092
new file mode 100644
903092
index 0000000..b9a8c79
903092
--- /dev/null
903092
+++ b/test/grub2-support_files/grubenv.3
903092
@@ -0,0 +1,3 @@
903092
+# GRUB Environment Block
903092
+saved_entry=Red Hat Enterprise Linux Server (3.10.0-327.22.2.el7.x86_64.debug) 7.2 (Maipo) with debugging
903092
+#############################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
903092
\ No newline at end of file
903092
diff --git a/test/grub2.18 b/test/grub2.18
903092
new file mode 100644
903092
index 0000000..529608d
903092
--- /dev/null
903092
+++ b/test/grub2.18
903092
@@ -0,0 +1,154 @@
903092
+#
903092
+# DO NOT EDIT THIS FILE
903092
+#
903092
+# It is automatically generated by grub2-mkconfig using templates
903092
+# from /etc/grub.d and settings from /etc/default/grub
903092
+#
903092
+
903092
+### BEGIN /etc/grub.d/00_header ###
903092
+set pager=1
903092
+
903092
+if [ -s $prefix/grubenv ]; then
903092
+  load_env
903092
+fi
903092
+if [ "${next_entry}" ] ; then
903092
+   set default="${next_entry}"
903092
+   set next_entry=
903092
+   save_env next_entry
903092
+   set boot_once=true
903092
+else
903092
+   set default="${saved_entry}"
903092
+fi
903092
+
903092
+if [ x"${feature_menuentry_id}" = xy ]; then
903092
+  menuentry_id_option="--id"
903092
+else
903092
+  menuentry_id_option=""
903092
+fi
903092
+
903092
+export menuentry_id_option
903092
+
903092
+if [ "${prev_saved_entry}" ]; then
903092
+  set saved_entry="${prev_saved_entry}"
903092
+  save_env saved_entry
903092
+  set prev_saved_entry=
903092
+  save_env prev_saved_entry
903092
+  set boot_once=true
903092
+fi
903092
+
903092
+function savedefault {
903092
+  if [ -z "${boot_once}" ]; then
903092
+    saved_entry="${chosen}"
903092
+    save_env saved_entry
903092
+  fi
903092
+}
903092
+
903092
+function load_video {
903092
+  if [ x$feature_all_video_module = xy ]; then
903092
+    insmod all_video
903092
+  else
903092
+    insmod efi_gop
903092
+    insmod efi_uga
903092
+    insmod ieee1275_fb
903092
+    insmod vbe
903092
+    insmod vga
903092
+    insmod video_bochs
903092
+    insmod video_cirrus
903092
+  fi
903092
+}
903092
+
903092
+terminal_output console
903092
+if [ x$feature_timeout_style = xy ] ; then
903092
+  set timeout_style=menu
903092
+  set timeout=5
903092
+# Fallback normal timeout code in case the timeout_style feature is
903092
+# unavailable.
903092
+else
903092
+  set timeout=5
903092
+fi
903092
+### END /etc/grub.d/00_header ###
903092
+
903092
+### BEGIN /etc/grub.d/00_tuned ###
903092
+set tuned_params=""
903092
+### END /etc/grub.d/00_tuned ###
903092
+
903092
+### BEGIN /etc/grub.d/01_users ###
903092
+if [ -f ${prefix}/user.cfg ]; then
903092
+  source ${prefix}/user.cfg
903092
+  if [ -n ${GRUB2_PASSWORD} ]; then
903092
+    set superusers="root"
903092
+    export superusers
903092
+    password_pbkdf2 root ${GRUB2_PASSWORD}
903092
+  fi
903092
+fi
903092
+### END /etc/grub.d/01_users ###
903092
+
903092
+### BEGIN /etc/grub.d/10_linux ###
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-327.22.2.el7.x86_64.debug) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-327.22.2.el7.x86_64.debug root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet LANG=en_US.UTF-8
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-327.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet LANG=en_US.UTF-8
903092
+	initrd16 /initramfs-3.10.0-327.el7.x86_64.img
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-925cd320373b6a4a9a66a26371afccd2) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-925cd320373b6a4a9a66a26371afccd2-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-0-rescue-925cd320373b6a4a9a66a26371afccd2 root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet
903092
+	initrd16 /initramfs-0-rescue-925cd320373b6a4a9a66a26371afccd2.img
903092
+}
903092
+
903092
+### END /etc/grub.d/10_linux ###
903092
+
903092
+### BEGIN /etc/grub.d/20_linux_xen ###
903092
+### END /etc/grub.d/20_linux_xen ###
903092
+
903092
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
903092
+### END /etc/grub.d/20_ppc_terminfo ###
903092
+
903092
+### BEGIN /etc/grub.d/30_os-prober ###
903092
+### END /etc/grub.d/30_os-prober ###
903092
+
903092
+### BEGIN /etc/grub.d/40_custom ###
903092
+# This file provides an easy way to add custom menu entries.  Simply type the
903092
+# menu entries you want to add after this comment.  Be careful not to change
903092
+# the 'exec tail' line above.
903092
+### END /etc/grub.d/40_custom ###
903092
+
903092
+### BEGIN /etc/grub.d/41_custom ###
903092
+if [ -f  ${config_directory}/custom.cfg ]; then
903092
+  source ${config_directory}/custom.cfg
903092
+elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
903092
+  source $prefix/custom.cfg;
903092
+fi
903092
+### END /etc/grub.d/41_custom ###
903092
diff --git a/test/results/add/g2-1.18 b/test/results/add/g2-1.18
903092
new file mode 100644
903092
index 0000000..ca5fe23
903092
--- /dev/null
903092
+++ b/test/results/add/g2-1.18
903092
@@ -0,0 +1,168 @@
903092
+#
903092
+# DO NOT EDIT THIS FILE
903092
+#
903092
+# It is automatically generated by grub2-mkconfig using templates
903092
+# from /etc/grub.d and settings from /etc/default/grub
903092
+#
903092
+
903092
+### BEGIN /etc/grub.d/00_header ###
903092
+set pager=1
903092
+
903092
+if [ -s $prefix/grubenv ]; then
903092
+  load_env
903092
+fi
903092
+if [ "${next_entry}" ] ; then
903092
+   set default="${next_entry}"
903092
+   set next_entry=
903092
+   save_env next_entry
903092
+   set boot_once=true
903092
+else
903092
+   set default="${saved_entry}"
903092
+fi
903092
+
903092
+if [ x"${feature_menuentry_id}" = xy ]; then
903092
+  menuentry_id_option="--id"
903092
+else
903092
+  menuentry_id_option=""
903092
+fi
903092
+
903092
+export menuentry_id_option
903092
+
903092
+if [ "${prev_saved_entry}" ]; then
903092
+  set saved_entry="${prev_saved_entry}"
903092
+  save_env saved_entry
903092
+  set prev_saved_entry=
903092
+  save_env prev_saved_entry
903092
+  set boot_once=true
903092
+fi
903092
+
903092
+function savedefault {
903092
+  if [ -z "${boot_once}" ]; then
903092
+    saved_entry="${chosen}"
903092
+    save_env saved_entry
903092
+  fi
903092
+}
903092
+
903092
+function load_video {
903092
+  if [ x$feature_all_video_module = xy ]; then
903092
+    insmod all_video
903092
+  else
903092
+    insmod efi_gop
903092
+    insmod efi_uga
903092
+    insmod ieee1275_fb
903092
+    insmod vbe
903092
+    insmod vga
903092
+    insmod video_bochs
903092
+    insmod video_cirrus
903092
+  fi
903092
+}
903092
+
903092
+terminal_output console
903092
+if [ x$feature_timeout_style = xy ] ; then
903092
+  set timeout_style=menu
903092
+  set timeout=5
903092
+# Fallback normal timeout code in case the timeout_style feature is
903092
+# unavailable.
903092
+else
903092
+  set timeout=5
903092
+fi
903092
+### END /etc/grub.d/00_header ###
903092
+
903092
+### BEGIN /etc/grub.d/00_tuned ###
903092
+set tuned_params=""
903092
+### END /etc/grub.d/00_tuned ###
903092
+
903092
+### BEGIN /etc/grub.d/01_users ###
903092
+if [ -f ${prefix}/user.cfg ]; then
903092
+  source ${prefix}/user.cfg
903092
+  if [ -n ${GRUB2_PASSWORD} ]; then
903092
+    set superusers="root"
903092
+    export superusers
903092
+    password_pbkdf2 root ${GRUB2_PASSWORD}
903092
+  fi
903092
+fi
903092
+### END /etc/grub.d/01_users ###
903092
+
903092
+### BEGIN /etc/grub.d/10_linux ###
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-327.22.2.el7.x86_64.debug) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-327.22.2.el7.x86_64.debug root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet LANG=en_US.UTF-8
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-327.22.2.el7.x86_64.debug) 7.2 (Maipo) with debugging' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-327.22.2.el7.x86_64.debug root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet LANG=en_US.UTF-8 systemd.log_level=debug systemd.log_target=kmsg
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (3.10.0-327.el7.x86_64) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-327.el7.x86_64-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	set gfxpayload=keep
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-3.10.0-327.el7.x86_64 root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet LANG=en_US.UTF-8
903092
+	initrd16 /initramfs-3.10.0-327.el7.x86_64.img
903092
+}
903092
+menuentry 'Red Hat Enterprise Linux Server (0-rescue-925cd320373b6a4a9a66a26371afccd2) 7.2 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-925cd320373b6a4a9a66a26371afccd2-advanced-91b16928-66bf-4801-8aed-fab3f1a6876c' {
903092
+	load_video
903092
+	insmod gzio
903092
+	insmod part_msdos
903092
+	insmod xfs
903092
+	set root='hd0,msdos1'
903092
+	if [ x$feature_platform_search_hint = xy ]; then
903092
+	  search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	else
903092
+	  search --no-floppy --fs-uuid --set=root 7e972fc0-6cf8-4a58-ace6-1b381e52733d
903092
+	fi
903092
+	linux16 /vmlinuz-0-rescue-925cd320373b6a4a9a66a26371afccd2 root=/dev/mapper/rhel_team--area--222-root ro crashkernel=auto rd.lvm.lv=rhel_team-area-222/root rd.lvm.lv=rhel_team-area-222/swap rhgb quiet
903092
+	initrd16 /initramfs-0-rescue-925cd320373b6a4a9a66a26371afccd2.img
903092
+}
903092
+
903092
+### END /etc/grub.d/10_linux ###
903092
+
903092
+### BEGIN /etc/grub.d/20_linux_xen ###
903092
+### END /etc/grub.d/20_linux_xen ###
903092
+
903092
+### BEGIN /etc/grub.d/20_ppc_terminfo ###
903092
+### END /etc/grub.d/20_ppc_terminfo ###
903092
+
903092
+### BEGIN /etc/grub.d/30_os-prober ###
903092
+### END /etc/grub.d/30_os-prober ###
903092
+
903092
+### BEGIN /etc/grub.d/40_custom ###
903092
+# This file provides an easy way to add custom menu entries.  Simply type the
903092
+# menu entries you want to add after this comment.  Be careful not to change
903092
+# the 'exec tail' line above.
903092
+### END /etc/grub.d/40_custom ###
903092
+
903092
+### BEGIN /etc/grub.d/41_custom ###
903092
+if [ -f  ${config_directory}/custom.cfg ]; then
903092
+  source ${config_directory}/custom.cfg
903092
+elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
903092
+  source $prefix/custom.cfg;
903092
+fi
903092
+### END /etc/grub.d/41_custom ###
903092
-- 
903092
2.5.5
903092