[PATCH 03/10] Fix for grub on SuSE systems: test lba and boot info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This adds a test for the code that fetches the lba and boot info
on SuSE systems. To properly test it, it's necessary to ship more
files than other existing tests.

Signed-off-by: Cleber Rosa <crosa@xxxxxxxxxx>
---
 test.sh                                         |    6 ++++
 test/grub.12                                    |   32 +++++++++++++++++++++++
 test/grub.12-support_files/boot/grub/device.map |    1 +
 test/grub.12-support_files/etc/SuSE-release     |    3 ++
 test/grub.12-support_files/etc/grub.conf        |    2 +
 test/results/info/g12.1                         |    8 +++++
 6 files changed, 52 insertions(+), 0 deletions(-)
 create mode 100644 test/grub.12
 create mode 100644 test/grub.12-support_files/boot/grub/device.map
 create mode 100644 test/grub.12-support_files/etc/SuSE-release
 create mode 100644 test/grub.12-support_files/etc/grub.conf
 create mode 100644 test/results/info/g12.1

diff --git a/test.sh b/test.sh
index 1678782..2b46082 100755
--- a/test.sh
+++ b/test.sh
@@ -305,6 +305,12 @@ grubTest grub.11 updargs/g11.2 --boot-filesystem=/    \
     --update-kernel=/vmlinuz-2.4.7-2smp \
     --args "ro root=LABEL=/ single"
 
+testing="GRUB lba and root information on SuSE systems"
+GRUBBY_SUSE_RELEASE=test/grub.12-support_files/etc/SuSE-release \
+    GRUBBY_SUSE_GRUB_CONF=test/grub.12-support_files/etc/grub.conf \
+    GRUBBY_GRUB_DEVICE_MAP=test/grub.12-support_files/boot/grub/device.map \
+    grubTest grub.12 info/g12.1 --info=0
+
 testing="LILO update kernel argument handling"
 liloTest lilo.1 updargs/l1.1 --update-kernel=/boot/vmlinuz-2.4.18-4 \
     --args="root=/dev/md1"
diff --git a/test/grub.12 b/test/grub.12
new file mode 100644
index 0000000..3cd2819
--- /dev/null
+++ b/test/grub.12
@@ -0,0 +1,32 @@
+# Modified by YaST2. Last modification on Thu Mar  8 16:06:03 BRT 2012
+# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
+# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader
+
+default 0
+timeout 8
+##YaST - generic_mbr
+##YaST - activate
+
+###Don't change this comment - YaST2 identifier: Original name: linux###
+title Desktop -- openSUSE 12.1 - 3.1.9-1.4
+    root (hd0,1)
+    kernel /boot/vmlinuz-3.1.9-1.4-desktop root=/dev/vda2 resume=/dev/vda1 splash=silent quiet showopts vga=0x314
+    initrd /boot/initrd-3.1.9-1.4-desktop
+
+###Don't change this comment - YaST2 identifier: Original name: failsafe###
+title Failsafe -- openSUSE 12.1 - 3.1.9-1.4 (desktop)
+    root (hd0,1)
+    kernel /boot/vmlinuz-3.1.9-1.4-desktop root=/dev/vda2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
+    initrd /boot/initrd-3.1.9-1.4-desktop
+
+###Don't change this comment - YaST2 identifier: Original name: linux###
+title openSUSE 12.1 - 3.1.9-1.4
+    root (hd0,1)
+    kernel /boot/vmlinuz-3.1.9-1.4-default root=/dev/vda2 resume=/dev/vda1 splash=silent quiet showopts vga=0x314
+    initrd /boot/initrd-3.1.9-1.4-default
+
+###Don't change this comment - YaST2 identifier: Original name: failsafe###
+title Failsafe -- openSUSE 12.1 - 3.1.9-1.4 (default)
+    root (hd0,1)
+    kernel /boot/vmlinuz-3.1.9-1.4-default root=/dev/vda2 showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x314
+    initrd /boot/initrd-3.1.9-1.4-default
diff --git a/test/grub.12-support_files/boot/grub/device.map b/test/grub.12-support_files/boot/grub/device.map
new file mode 100644
index 0000000..e2b208c
--- /dev/null
+++ b/test/grub.12-support_files/boot/grub/device.map
@@ -0,0 +1 @@
+(hd0)	/dev/vda
diff --git a/test/grub.12-support_files/etc/SuSE-release b/test/grub.12-support_files/etc/SuSE-release
new file mode 100644
index 0000000..ddd0acd
--- /dev/null
+++ b/test/grub.12-support_files/etc/SuSE-release
@@ -0,0 +1,3 @@
+openSUSE 12.1 (x86_64)
+VERSION = 12.1
+CODENAME = Asparagus
diff --git a/test/grub.12-support_files/etc/grub.conf b/test/grub.12-support_files/etc/grub.conf
new file mode 100644
index 0000000..9af4c20
--- /dev/null
+++ b/test/grub.12-support_files/etc/grub.conf
@@ -0,0 +1,2 @@
+setup --stage2=/boot/grub/stage2 --force-lba (hd0,1) (hd0,1)
+quit
diff --git a/test/results/info/g12.1 b/test/results/info/g12.1
new file mode 100644
index 0000000..25d7ab6
--- /dev/null
+++ b/test/results/info/g12.1
@@ -0,0 +1,8 @@
+lba
+boot=/dev/vda
+index=0
+kernel=/boot/vmlinuz-3.1.9-1.4-desktop
+args="resume=/dev/vda1 splash=silent quiet showopts vga=0x314"
+root=/dev/vda2
+initrd=/boot/initrd-3.1.9-1.4-desktop
+title=Desktop -- openSUSE 12.1 - 3.1.9-1.4
-- 
1.7.6.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux