1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2025-09-18 20:28:52 +00:00

Add various fixes after the review

After the review, when the requirements have been
added, the tests started to behave a little differently
and some fixes had to be added to make it pass with
no problems.

Also, this PR adds a function to change Gnome
default settings.
This commit is contained in:
Lukáš Růžička 2025-09-08 09:56:41 +02:00 committed by adamwill
parent 389fe554f9
commit 4d2b7be389
10 changed files with 89 additions and 46 deletions

View File

@ -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;

View File

@ -17,6 +17,6 @@
],
"properties": [],
"tags": [
"freerdp_desktop_connected"
"desktop_connected"
]
}
}

View File

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 249 KiB

View File

@ -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"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 KiB

View File

@ -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"

View File

@ -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);
}

View File

@ -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') {

View File

@ -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);

View File

@ -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,