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. Changes from v1: * Skip directories while running "parse/write comparison" tests so that it's not attempted on grub.12-support-files. Signed-off-by: Cleber Rosa <crosa@xxxxxxxxxx> --- test.sh | 17 ++++++++++++ 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, 63 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 e10ee84..875a3b6 100755 --- a/test.sh +++ b/test.sh @@ -129,6 +129,7 @@ export MALLOC_CHECK_=2 testing="Parse/write comparison" for n in test/*.[0-9]*; do + [ -d $n ] && continue n=${n#*/} # remove test/ b=${n%.*} # remove suffix [[ $b == $opt_bootloader ]] || continue @@ -203,6 +204,11 @@ grubTest grub.4 default/g4.1 --boot-filesystem=/ --set-default=/boot/vmlinuz-2.4 grubTest grub.4 default/g4.2 --boot-filesystem=/ --set-default=/boot/vmlinuz-2.4.7-ac3 --remove-kernel /boot/vmlinuz-2.4.7-2.5 --add-kernel=/boot/new-kernel --copy-default --title New_Title grubTest grub.6 default/g6.1 --remove-kernel=/boot/vmlinuz-2.4.7-2.9 --boot-filesystem=/ +testing="GRUB default index directive" +grubTest grub.13 setdefaultindex/g.13.0 --set-default-index=0 +grubTest grub.13 setdefaultindex/g.13.1 --set-default-index=1 +grubTest grub.13 setdefaultindex/g.13.9 --set-default-index=9 + testing="GRUB display default index" grubDisplayTest grub.1 defaultindex/0 --default-index grubDisplayTest grub.2 defaultindex/0 --default-index @@ -305,6 +311,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" @@ -400,6 +412,11 @@ grub2Test grub2.4 remove/g2-1.2 --remove-kernel=2 testing="GRUB2 (submenu) remove kernel via title" grub2Test grub2.4 remove/g2-1.2 --remove-kernel="TITLE=title2" +testing="GRUB2 default index directive" +grub2Test grub2.1 setdefaultindex/g2.1.0 --set-default-index=0 +grub2Test grub2.1 setdefaultindex/g2.1.1 --set-default-index=1 +grub2Test grub2.1 setdefaultindex/g2.1.9 --set-default-index=9 + testing="YABOOT add kernel" yabootTest yaboot.1 add/y1.1 --copy-default --boot-filesystem=/ --add-kernel=/boot/new-kernel \ --title=newtitle 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