diff --git a/tests/boot/grub2_test.pm b/tests/boot/grub2_test.pm index 5e1c47c5f82b..cb561c703093 100644 --- a/tests/boot/grub2_test.pm +++ b/tests/boot/grub2_test.pm @@ -96,6 +96,20 @@ sub run { select_console 'root-console'; } + record_info 'grub2 zfs', 'ensure that zfs in grub2 is not available on SLE but on openSUSE'; + if (is_sle()) { + assert_script_run 'zypper se grub2- | grep extras ; test "$?" == "1"'; + assert_script_run 'rpm -qa | grep grub2 | xargs rpm -ql | grep zfs ; test "$?" == "1"'; + } + else { + my @bootloader_rpms = split(/\n/, script_output("zypper se 'grub2-' | grep 'Bootloader with support' | grep '^i' | cut -d' ' -f4")); + for my $rpm (@bootloader_rpms) { + assert_script_run("rpm -ql $rpm | grep zfs ; test \"\$?\" == \"1\""); + zypper_call "in $rpm-extras"; + assert_script_run("rpm -ql $rpm-extras | grep zfs"); + } + } + record_info 'grub2 password', 'set password to boot'; script_run "yast bootloader; echo yast-bootloader-status-\$? > /dev/$serialdev", 0; assert_screen 'test-yast2_bootloader-1'; diff --git a/tests/console/zfs.pm b/tests/console/zfs.pm index 9f61cfaee53b..4d058cc348eb 100644 --- a/tests/console/zfs.pm +++ b/tests/console/zfs.pm @@ -131,6 +131,17 @@ sub reboot { sub run { my $self = shift; select_serial_terminal(); + + if (!is_sle()) { + record_info 'grub2 zfs', 'ensure that zfs in grub2 is not available on SLE but on openSUSE'; + my @bootloader_rpms = split(/\n/, script_output("zypper se 'grub2-' | grep 'Bootloader with support' | grep '^i' | cut -d' ' -f4")); + for my $rpm (@bootloader_rpms) { + assert_script_run("rpm -ql $rpm | grep zfs ; test \"\$?\" == \"1\""); + zypper_call "in $rpm-extras"; + assert_script_run("rpm -ql $rpm-extras | grep zfs"); + } + } + return unless (install_zfs()); # Possible softfailure if module is not yet available (e.g. new Leap version) my $additional = ""; $additional = "--allow-unsupported" if (is_sle);