Skip to content

Commit

Permalink
kernel: Add support for transactional systems to update_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
czerw committed Oct 23, 2023
1 parent a520cf5 commit 9e25a57
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions tests/kernel/update_kernel.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ use base 'opensusebasetest';
use testapi;
use serial_terminal 'select_serial_terminal';
use utils;
use version_utils qw(is_sle package_version_cmp);
use version_utils qw(is_sle is_transactional package_version_cmp);
use qam;
use kernel 'remove_kernel_packages';
use klp;
use power_action_utils 'power_action';
use repo_tools 'add_qa_head_repo';
use Utils::Backends;
use LTP::utils;
use transactional;

sub check_kernel_package {
my $kernel_name = shift;
Expand Down Expand Up @@ -85,7 +86,11 @@ sub update_kernel {
fully_patch_system;

if (check_var('SLE_PRODUCT', 'slert')) {
zypper_call('in kernel-devel-rt');
if (is_transactional) {
record_info("There is no kernel-devel-rt available on transactional system.");
} else {
zypper_call('in kernel-devel-rt');
}
}
elsif (is_sle('12+')) {
zypper_call('in kernel-devel');
Expand All @@ -106,7 +111,14 @@ sub update_kernel {
}
else {
# Use single patch or patch list
zypper_call("in -l -t patch $patches", exitcode => [0, 102, 103], log => 'zypper.log', timeout => 1400);
if (is_transactional) {
# Proceed with transactional-update patch
trup_call("patch");
# Reboot system after patch, to make sure that further checks are done on updated system
reboot_on_changes;
} else {
zypper_call("in -l -t patch $patches", exitcode => [0, 102, 103], log => 'zypper.log', timeout => 1400);
}
}
}

Expand Down Expand Up @@ -388,7 +400,7 @@ sub boot_to_console {
sub run {
my $self = shift;

if (is_ipmi && get_var('LTP_BAREMETAL')) {
if ((is_ipmi && get_var('LTP_BAREMETAL')) || is_transactional) {
# System is already booted after installation, just switch terminal
select_serial_terminal;
} else {
Expand Down Expand Up @@ -454,7 +466,9 @@ sub run {

check_kernel_package($kernel_package);

if (!get_var('KGRAFT')) {
if (is_transactional) {
reboot_on_changes;
} elsif (!get_var('KGRAFT')) {
power_action('reboot', textmode => 1);
$self->wait_boot if get_var('LTP_BAREMETAL');
}
Expand Down

0 comments on commit 9e25a57

Please sign in to comment.