Skip to content

Commit

Permalink
Ensure that zfs is not available on SLE but on openSUSE
Browse files Browse the repository at this point in the history
  • Loading branch information
asdil12 committed Apr 13, 2023
1 parent d476e08 commit 6f0d9d7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/boot/grub2_test.pm
Expand Up @@ -96,6 +96,12 @@ 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"';
}

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';
Expand Down
11 changes: 11 additions & 0 deletions tests/console/zfs.pm
Expand Up @@ -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' | awk '{print \$3}'"));
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);
Expand Down

0 comments on commit 6f0d9d7

Please sign in to comment.