diff --git a/lib/utils.pm b/lib/utils.pm index 69c3d992..b6395bdc 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -6,7 +6,7 @@ use base 'Exporter'; use Exporter; use lockapi; use testapi qw(is_serial_terminal :DEFAULT); -our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login check_software_start/; +our @EXPORT = qw/run_with_error_check type_safely type_very_safely desktop_vt boot_to_login_screen console_login console_switch_layout desktop_switch_layout console_loadkeys_us do_bootloader boot_decrypt check_release menu_launch_type setup_repos repo_setup get_workarounds disable_updates_repos cleanup_workaround_repo console_initial_setup handle_welcome_screen gnome_initial_setup check_desktop quit_firefox advisory_get_installed_packages acnp_handle_output advisory_check_nonmatching_packages start_with_launcher quit_with_shortcut disable_firefox_studies select_rescue_mode copy_devcdrom_as_isofile get_release_number check_left_bar check_top_bar check_prerelease check_version spell_version_number _assert_and_click is_branched rec_log repos_mirrorlist register_application get_registered_applications desktop_launch_terminal solidify_wallpaper check_and_install_git download_testdata make_serial_writable set_update_notification_timestamp kde_doublek_workaround dm_perform_login check_software_start reboot_system set_gnome_nosleep/; # We introduce this global variable to hold the list of applications that have @@ -1844,4 +1844,45 @@ sub check_software_start { assert_screen("desktop_package_tool_update"); } +# Reboots the system using the desktop environment's +# tools to do so. Then it checks that the system has +# reached the login screen +sub reboot_system { + my $desktop = get_var("DESKTOP", "gnome"); + if ($desktop eq 'i3') { + # we are still in i3 if the bar is visible + if (check_screen('i3-bar')) { + logout_user(); + } + assert_and_click('lightdm_power_menu'); + assert_and_click('lightdm_power_menu-reboot'); + assert_and_click('lightdm_power_menu-reboot-confirm'); + } + + # Reboots the system and handles everything until the next GDM screen. + else { + # In a logged in desktop, we access power options through system menu + assert_and_click "system_menu_button"; + # In KDE reboot entry is right here, on GNOME we need to + # enter some kind of power option submenu + assert_screen ["power_entry", "reboot_entry"]; + click_lastmatch; + assert_and_click "reboot_entry" if (match_has_tag("power_entry")); + assert_and_click "restart_confirm"; + } + boot_to_login_screen(); +} + +# For Gnome related tests, this subroutine downloads a drop-in file +# that does describes the settings and copy it into correct location. +sub set_gnome_nosleep { + # Download the drop-in file. + assert_script_run("curl -o /tmp/99_openqa.gschema.override https://pagure.io/fedora-qa/openqa_testdata/raw/thetree/f/configuration/99_openqa.gschema.override"); + # Move the file into the correct directory + assert_script_run("mv /tmp/99_openqa.gschema.override /usr/share/glib-2.0/schemas/99_openqa.gschema.override"); + # Apply the schemas + assert_script_run("glib-compile-schemas /usr/share/glib-2.0/schemas/"); +} + + 1; diff --git a/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json b/needles/gnome/apps/connections/desktop_connected-20250902.json similarity index 83% rename from needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json rename to needles/gnome/apps/connections/desktop_connected-20250902.json index 20e1f3f0..91902151 100644 --- a/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json +++ b/needles/gnome/apps/connections/desktop_connected-20250902.json @@ -17,6 +17,6 @@ ], "properties": [], "tags": [ - "freerdp_desktop_connected" + "desktop_connected" ] -} \ No newline at end of file +} diff --git a/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.png b/needles/gnome/apps/connections/desktop_connected-20250902.png similarity index 100% rename from needles/gnome/apps/connections/freerdp_desktop_connected-20250902.png rename to needles/gnome/apps/connections/desktop_connected-20250902.png diff --git a/needles/gnome/apps/connections/desktop_connected-20250908.json b/needles/gnome/apps/connections/desktop_connected-20250908.json new file mode 100644 index 00000000..9b4a5852 --- /dev/null +++ b/needles/gnome/apps/connections/desktop_connected-20250908.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "width": 148, + "ypos": 245, + "xpos": 190, + "type": "match", + "height": 20 + }, + { + "height": 21, + "xpos": 426, + "type": "match", + "width": 173, + "ypos": 45 + } + ], + "properties": [], + "tags": [ + "desktop_connected" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/desktop_connected-20250908.png b/needles/gnome/apps/connections/desktop_connected-20250908.png new file mode 100644 index 00000000..6b5c5860 Binary files /dev/null and b/needles/gnome/apps/connections/desktop_connected-20250908.png differ diff --git a/templates.fif.json b/templates.fif.json index 5a3779ae..edc180b7 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -2174,7 +2174,7 @@ "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", "NICTYPE": "tap", "POSTINSTALL": "remote_desktop_server", - "POST_STATIC": "172.16.2.177 kaermorhen.test.openqa.fedoraproject.org", + "POST_STATIC": "172.16.2.116 kaermorhen.test.openqa.fedoraproject.org", "ROOT_PASSWORD": "weakpassword", "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%", "WORKER_CLASS": "tap" @@ -2190,7 +2190,7 @@ "NICTYPE": "tap", "POSTINSTALL": "remote_desktop_client", "PARALLEL_WITH": "remote_desktop_server", - "POST_STATIC": "172.16.2.179 visimir.test.openqa.fedoraproject.org", + "POST_STATIC": "172.16.2.117 visimir.test.openqa.fedoraproject.org", "ROOT_PASSWORD": "weakpassword", "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%", "WORKER_CLASS": "tap" diff --git a/tests/_do_install_and_reboot.pm b/tests/_do_install_and_reboot.pm index 8b895d1e..2290ba7a 100644 --- a/tests/_do_install_and_reboot.pm +++ b/tests/_do_install_and_reboot.pm @@ -148,6 +148,7 @@ sub run { push(@actions, 'consoletty0') if (get_var("ARCH") eq "aarch64"); push(@actions, 'abrt') if (get_var("ABRT", '') eq "system"); push(@actions, 'rootpw') if (get_var("INSTALLER_NO_ROOT")); + push(@actions, 'setgnome') if (get_var("DESKTOP") eq "gnome"); # FIXME: remove plymouth from Server install_default_upload on # non-aarch64 to work around RHBZ #1933378 unless (get_var("ARCH") eq "aarch64") { @@ -244,6 +245,10 @@ sub run { } } } + if (grep { $_ eq 'setgnome' } @actions) { + # Do Gnome settings + set_gnome_nosleep(); + } type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions); } diff --git a/tests/desktop_login.pm b/tests/desktop_login.pm index 875abec0..1f2a6959 100644 --- a/tests/desktop_login.pm +++ b/tests/desktop_login.pm @@ -174,31 +174,6 @@ sub switch_user { } } -sub reboot_system { - if ($desktop eq 'i3') { - # we are still in i3 if the bar is visible - if (check_screen('i3-bar')) { - logout_user(); - } - assert_and_click('lightdm_power_menu'); - assert_and_click('lightdm_power_menu-reboot'); - assert_and_click('lightdm_power_menu-reboot-confirm'); - } - - # Reboots the system and handles everything until the next GDM screen. - else { - # In a logged in desktop, we access power options through system menu - assert_and_click "system_menu_button"; - # In KDE reboot entry is right here, on GNOME we need to - # enter some kind of power option submenu - assert_screen ["power_entry", "reboot_entry"]; - click_lastmatch; - assert_and_click "reboot_entry" if (match_has_tag("power_entry")); - assert_and_click "restart_confirm"; - } - boot_to_login_screen(); -} - sub power_off { # Powers-off the machine. if (get_var('DESKTOP') eq 'i3') { diff --git a/tests/remote_desktop_client.pm b/tests/remote_desktop_client.pm index 1c927234..dd56168f 100644 --- a/tests/remote_desktop_client.pm +++ b/tests/remote_desktop_client.pm @@ -13,7 +13,7 @@ sub run { my $password = get_var("USER_PASSWORD", "weakpassword"); my $rdpuser = get_var("RDP_USER", "geralt"); my $rdppass = get_var("RDP_PASS", "ciriofcintra"); - my $ip = get_var("RDP_SERVER_IP", "172.16.2.177"); + my $ip = get_var("RDP_SERVER_IP", "172.16.2.116"); # Wait until the RDP server is ready # and lock parallel connection. @@ -48,6 +48,12 @@ sub run { type_very_safely("$password\n"); wait_still_screen(2); + # When SELinux is on, the authentication dialog has appeared. + # Wait for it a minute and deal it away. + if (check_screen("auth_required_password", timeout => 60)) { + type_very_safely("$password\n"); + } + # Start the terminal type_very_safely("terminal\n"); wait_still_screen(3); diff --git a/tests/remote_desktop_server.pm b/tests/remote_desktop_server.pm index f5acd307..e2028e66 100644 --- a/tests/remote_desktop_server.pm +++ b/tests/remote_desktop_server.pm @@ -13,13 +13,15 @@ sub run { $self->root_console(tty => 3); # Make necessary settings for the RDP server. + # FIXME: Check that we run with SElinux enabled, + # if it does not work, uncomment the following line + # and report the issue to the Gnome developers. # Set SElinux to permissive to workaround a Fedora issue - assert_script_run("setenforce 0"); - # Check that SElinux is in permissive mode - validate_script_output("getenforce", sub { m/Permissive/ }); + # assert_script_run("setenforce 0"); # In Workstation, the RDP port should be opened per se, - # but let's open it explicitely, to make sure it is open. + # (all ports are basically opened) but let's open it explicitely, + # to make sure it is open if the situation changes in the future. assert_script_run("firewall-cmd --add-port=3389/tcp"); # Change to Desktop @@ -34,12 +36,8 @@ sub run { assert_and_click("settings_remote_desktop"); assert_and_click("settings_remote_login"); assert_and_click("gnome_button_unlock"); - if (check_screen("auth_required_password", timeout => 60)) { - type_very_safely("$password\n"); - } - else { - die("Authentication dialogue is not visible but was expected."); - } + assert_screen("auth_required_password", timeout => 60); + type_very_safely("$password\n"); # Set up remote login in Gnome Settings. assert_and_click("settings_switch_remote"); @@ -55,11 +53,7 @@ sub run { # RDP does not allow connections when the user is still logged in # locally, so let's reboot the machine to start from anew. - assert_and_click("system_menu_button"); - assert_and_click("leave_button"); - assert_and_click("reboot_entry"); - assert_and_click("gnome_reboot_confirm"); - assert_screen("graphical_login", 240); + reboot_system(); # Check that the service is running. If the service was not running,