Skip to content

Commit

Permalink
Fix forkbomb time out on saptune 3.1.3
Browse files Browse the repository at this point in the history
TEAM-9573 - Test qam-sles4sap_online_dvd_gnome_hana_nvdimm failing in multiple service packs in forkbomb sub-test
  • Loading branch information
lilyeyes committed Aug 6, 2024
1 parent 7b4632e commit 6da116c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/sles4sap/forkbomb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use serial_terminal 'select_serial_terminal';
use Utils::Backends;
use strict;
use warnings;
use version_utils qw(package_version_cmp);

sub run {
my ($self) = @_;
Expand All @@ -27,6 +28,24 @@ sub run {
my $sid = get_required_var('INSTANCE_SID');
my $instance_id = get_required_var('INSTANCE_ID');
my $sapadm = $self->set_sap_info($sid, $instance_id);

my $package_version = script_output "rpm -q --qf '%{VERSION}' saptune";
record_info('saptune version', $package_version);
record_info('Original kernel.pid_max', script_output('sysctl -a | grep kernel.pid_max', proceed_on_failure => 1));
if (package_version_cmp($package_version, '3.1.3') >= 0) {
# Reset kernel.pid_max according to the changes of SAP Note 2578899
# See https://github.com/SUSE/saptune/commit/a81168759681a05437e60429de0ddc1e19c703f4
# Or see https://github.com/SUSE/saptune/releases/tag/3.1.3 for more details
my $note_id = '2578899';
assert_script_run("saptune note revert $note_id");
assert_script_run("cp /usr/share/saptune/notes/$note_id /etc/saptune/override/");
assert_script_run("sed -i -r \'s/^kernel.pid_max=.*/kernel.pid_max=32768/g\' /etc/saptune/override/$note_id");
record_info("Override $note_id", script_output("grep kernel.pid_max /etc/saptune/override/$note_id", proceed_on_failure => 1));
assert_script_run("saptune note override $note_id");
record_info('Override kernel.pid_max', script_output('sysctl -a | grep kernel.pid_max', proceed_on_failure => 1));
assert_script_run("saptune note revert $note_id");
record_info('Revert kernel.pid_max', script_output('sysctl -a | grep kernel.pid_max', proceed_on_failure => 1));
}
$self->test_forkbomb;
}

Expand Down

0 comments on commit 6da116c

Please sign in to comment.