Project

General

Profile

action #88750

Updated by JERiveraMoya about 3 years ago

As a Quality Engineer I would like to automate [yast2 bootloader](https://openqa.suse.de/tests/5473105#step/yast2_bootloader/10) with REST API 
 libyui (no needles required) and validate properly setting written in the system with this module. 

 Let's start with in 'Boot Code Options' as follows: 

  1. Open yast2 bootloader We could edit most relevant options on those three tabs (we can exclude legacy ones) and validate the configuration files that were changed in the UI system after clicking OK. 
 Prepare test data that the default options from installation 
     which we are going to manipulate are properly processed by the module and has correct initial values. reflect all those possible changes. 

 Suggestions: 

 + Boot Code Options tab: 
    - Boot Loader: Bootloader -> if GRUB2 for EFI is selected and there are some error because there is not EFI partition but '/etc/default/grub' will contain 'GRUB_USE_LINUXEFI="true"' 
    - Write to Partition: no Also check 'LOADER_TYPE' in '/etc/sysconfig/bootloader' 
    - Boot Code Location / Write to Master Boot Record: yes Record (/dev/vda) -> 'dd if=/dev/vda bs=512 count=1 | hexdump -C | grep GRUB' 
    - Set active Flag in Partition: yes 
    - Write generic Boot Code Location / Write to MBR: no 
  2. Check with command line than GRUB is written in the MBR of the disk: 
	 - Validate file: `/etc/default/grub_installdevice` (YaST use it to control most of the settings) 
	 - Run: `dd if=/dev/vda Partition (/dev/vda2) -> 'dd if=/dev/vda2 bs=512 count=1 | hexdump -C | grep GRUB` 
  3. Open yast2 bootloader and GRUB' 
	  -> check 'Write generic Boot Code to MBR' and apply changes. 
  4. From console check if the fact that GRUB cannot be removed with yast is still in a bug. 
	   -> with all unselected the MBR because it has priority over generic code. 
  5. Open yast2 bootloader and unselect 'Write to MBR' and apply changes. 
  6. Check that GRUB code is not deleted but there anymore and generic boot from syslinux is written. 
     Output of not warning in the following commands should be the same: 

     ``` 
     dd if=/dev/vda bs=440 count=1 | hexdump -C 
     cat /usr/share/syslinux/gptmbr.bin | hexdump -C 
     ``` 
  8. Optionally we could do some extra actions with UI: 
    - Get a warning if we try to switch to GRUB2 for EFI. 
    - Click on Edit Disk Boot Order UI, is that correct? 

 + Kernel Parameters tab: 
	 Optional Kernel command line parameters and delete all disks, click on delete on empty list if possible (see [bsc#1183218](https://bugzilla.suse.com/show_bug.cgi?id=1183218)). 
  7. On the CPU Mitigations -> 'cat /proc/cmdline' 
	 Use graphical console check the map between BIOS drives and console resolution: 'GRUB_TERMINAL="gfxterm" in '/etc/default/grub' 
	 Console theme: 'GRUB_THEME' in '/etc/default/grub' 

 + Bootloader Options tab: 
	 Timeout in Seconds -> 'GRUB_TIMEOUT' in '/etc/default/grub' 
	 Probe Foreign OS devices ->    'GRUB_DISABLE_OS_PROBER' in /boot/grub2/device.map is correct for your hard disk(s). 
     Additionally '/etc/default/grub' 
	 Hide Menu on Boot -> ? 
	 Default Boot Section -> 'GRUB_DEFAULT=saved' in '/etc/default/grub' and 'grub2-editenv list' 
	 Protect Boot Loader with Password -> '/etc/grub.d/42_password'  

 Note: we could check a BIOS limitation by adding fake disks until you have a list greater than 8 disks. 
  8. Open yast2 bootloader again, go should revert to Edit Disk Boot Order and verify that all the fake line where interpreted initial state at the end, there is some option in openQA AFIR, other option could be reflect the initial status by opening the module as disks, 
    then apply changes and a warning should be displayed preventing to add more than 8 devices instead of an Internal error (see [bsc#1183218](https://bugzilla.suse.com/show_bug.cgi?id=1183218)). 
 again.

Back