From 25920d804948a21dc848b07c1082100b6197ad0b Mon Sep 17 00:00:00 2001 From: rfan1 Date: Wed, 24 Jan 2024 22:50:13 -0500 Subject: [PATCH] DESKTOP=gnome System's ram must be at least 4GB https://progress.opensuse.org/issues/153808 --- lib/utils.pm | 24 +++++++++++++++++++++++- tests/boot/boot_to_desktop.pm | 4 ++++ tests/installation/first_boot.pm | 4 ++++ variables.md | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/lib/utils.pm b/lib/utils.pm index 56e0d67a2cd1..cc927b0cf851 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -11,7 +11,7 @@ use warnings; use testapi qw(is_serial_terminal :DEFAULT); use lockapi 'mutex_wait'; use mm_network; -use version_utils qw(is_alp is_sle_micro is_microos is_leap is_leap_micro is_public_cloud is_sle is_sle12_hdd_in_upgrade is_storage_ng is_jeos package_version_cmp is_transactional is_bootloader_sdboot); +use version_utils qw(is_alp is_sle_micro is_microos is_tumbleweed is_leap is_leap_micro is_public_cloud is_sle is_sle12_hdd_in_upgrade is_storage_ng is_jeos package_version_cmp is_transactional is_bootloader_sdboot); use Utils::Architectures; use Utils::Systemd qw(systemctl disable_and_stop_service); use Utils::Backends; @@ -114,6 +114,7 @@ our @EXPORT = qw( write_sut_file @all_tests_results ping_size_check + handle_gnome_memory_ge_4g ); our @EXPORT_OK = qw( @@ -2927,4 +2928,25 @@ sub write_sut_file { assert_script_run("curl -v -o $path $url"); } +=head2 handle_gnome_memory_ge_4g + + handle_gnome_memory_ge_4g([fatal_flag => $fatal_flag]) + +Handle gnome test on sle, system's ram must be at least 4GB +https://progress.opensuse.org/issues/153808. + +=cut + +sub handle_gnome_memory_ge_4g { + my (%args) = @_; + $args{fatal_flag} //= 1; + + my $os_handled = is_tumbleweed || is_leap('>=15.5') || is_sle('>=15-SP5'); + my $backend_handled = is_qemu || is_svirt; + if (check_var('DESKTOP', 'gnome') && get_var('GNOME_MEMORY_GE_4G', '1') && $os_handled && $backend_handled && (get_var('QEMURAM', 1024) < 4096)) { + die "DESKTOP=gnome System's ram must be at least 4GB, see poo#153808" if ($args{fatal_flag}); + record_soft_failure "DESKTOP=gnome System's ram should be at least 4GB, see poo#153808"; + } +} + 1; diff --git a/tests/boot/boot_to_desktop.pm b/tests/boot/boot_to_desktop.pm index 1ad07c479778..3f37f3193021 100644 --- a/tests/boot/boot_to_desktop.pm +++ b/tests/boot/boot_to_desktop.pm @@ -17,8 +17,12 @@ use testapi; use Utils::Architectures; use Utils::Backends; use version_utils qw(is_upgrade is_sles4sap is_sle is_alp is_sle_micro); +use utils 'handle_gnome_memory_ge_4g'; sub run { + # https://progress.opensuse.org/issues/153808 + handle_gnome_memory_ge_4g(fatal_flag => 0); + my ($self) = @_; $self->{in_boot_desktop} = 1; # We have tests that boot from HDD and wait for DVD boot menu's timeout, so diff --git a/tests/installation/first_boot.pm b/tests/installation/first_boot.pm index f72ca1c9587d..8e4063ebc3d2 100644 --- a/tests/installation/first_boot.pm +++ b/tests/installation/first_boot.pm @@ -18,8 +18,12 @@ use warnings; use base 'bootbasetest'; use testapi; use x11utils 'turn_off_plasma_tooltips'; +use utils 'handle_gnome_memory_ge_4g'; sub run { + # https://progress.opensuse.org/issues/153808 + handle_gnome_memory_ge_4g(); + shift->wait_boot_past_bootloader; # This only works with generic-desktop. In the opensuse-welcome case, # the opensuse-welcome module will handle it instead. diff --git a/variables.md b/variables.md index 569dd0d9b5a1..85379b17f65d 100644 --- a/variables.md +++ b/variables.md @@ -370,6 +370,7 @@ PUBLIC_CLOUD_PY_BACKPORTS_REPO | string | "" | PY Backport repo URL for azure_mo PUBLIC_CLOUD_PY_AZURE_REPO | string | "" | PY azure repo URL for azure_more_cli_test. PUBLIC_CLOUD_TOOLS_REPO | string | "" | cloud tools repo URL for azure_more_cli_test. PUBLIC_CLOUD_EMBARGOED_UPDATES_DETECTED | boolean | true | Internal variable written by the code and readed by the code . Should NOT be set manually +GNOME_MEMORY_GE_4G | boolean | 1 | DESKTOP=gome System's ram must be at least 4GB unless explicitly asked ### Wicked testsuite specifc variables