mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2025-10-13 15:18:50 +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:
parent
389fe554f9
commit
4d2b7be389
43
lib/utils.pm
43
lib/utils.pm
@ -6,7 +6,7 @@ use base 'Exporter';
|
|||||||
use Exporter;
|
use Exporter;
|
||||||
use lockapi;
|
use lockapi;
|
||||||
use testapi qw(is_serial_terminal :DEFAULT);
|
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
|
# 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");
|
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;
|
1;
|
||||||
|
@ -17,6 +17,6 @@
|
|||||||
],
|
],
|
||||||
"properties": [],
|
"properties": [],
|
||||||
"tags": [
|
"tags": [
|
||||||
"freerdp_desktop_connected"
|
"desktop_connected"
|
||||||
]
|
]
|
||||||
}
|
}
|
Before Width: | Height: | Size: 249 KiB After Width: | Height: | Size: 249 KiB |
@ -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"
|
||||||
|
]
|
||||||
|
}
|
BIN
needles/gnome/apps/connections/desktop_connected-20250908.png
Normal file
BIN
needles/gnome/apps/connections/desktop_connected-20250908.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 324 KiB |
@ -2174,7 +2174,7 @@
|
|||||||
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
|
"HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",
|
||||||
"NICTYPE": "tap",
|
"NICTYPE": "tap",
|
||||||
"POSTINSTALL": "remote_desktop_server",
|
"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",
|
"ROOT_PASSWORD": "weakpassword",
|
||||||
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%",
|
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%",
|
||||||
"WORKER_CLASS": "tap"
|
"WORKER_CLASS": "tap"
|
||||||
@ -2190,7 +2190,7 @@
|
|||||||
"NICTYPE": "tap",
|
"NICTYPE": "tap",
|
||||||
"POSTINSTALL": "remote_desktop_client",
|
"POSTINSTALL": "remote_desktop_client",
|
||||||
"PARALLEL_WITH": "remote_desktop_server",
|
"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",
|
"ROOT_PASSWORD": "weakpassword",
|
||||||
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%",
|
"START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%",
|
||||||
"WORKER_CLASS": "tap"
|
"WORKER_CLASS": "tap"
|
||||||
|
@ -148,6 +148,7 @@ sub run {
|
|||||||
push(@actions, 'consoletty0') if (get_var("ARCH") eq "aarch64");
|
push(@actions, 'consoletty0') if (get_var("ARCH") eq "aarch64");
|
||||||
push(@actions, 'abrt') if (get_var("ABRT", '') eq "system");
|
push(@actions, 'abrt') if (get_var("ABRT", '') eq "system");
|
||||||
push(@actions, 'rootpw') if (get_var("INSTALLER_NO_ROOT"));
|
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
|
# FIXME: remove plymouth from Server install_default_upload on
|
||||||
# non-aarch64 to work around RHBZ #1933378
|
# non-aarch64 to work around RHBZ #1933378
|
||||||
unless (get_var("ARCH") eq "aarch64") {
|
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);
|
type_string "reboot\n" if (grep { $_ eq 'reboot' } @actions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {
|
sub power_off {
|
||||||
# Powers-off the machine.
|
# Powers-off the machine.
|
||||||
if (get_var('DESKTOP') eq 'i3') {
|
if (get_var('DESKTOP') eq 'i3') {
|
||||||
|
@ -13,7 +13,7 @@ sub run {
|
|||||||
my $password = get_var("USER_PASSWORD", "weakpassword");
|
my $password = get_var("USER_PASSWORD", "weakpassword");
|
||||||
my $rdpuser = get_var("RDP_USER", "geralt");
|
my $rdpuser = get_var("RDP_USER", "geralt");
|
||||||
my $rdppass = get_var("RDP_PASS", "ciriofcintra");
|
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
|
# Wait until the RDP server is ready
|
||||||
# and lock parallel connection.
|
# and lock parallel connection.
|
||||||
@ -48,6 +48,12 @@ sub run {
|
|||||||
type_very_safely("$password\n");
|
type_very_safely("$password\n");
|
||||||
wait_still_screen(2);
|
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
|
# Start the terminal
|
||||||
type_very_safely("terminal\n");
|
type_very_safely("terminal\n");
|
||||||
wait_still_screen(3);
|
wait_still_screen(3);
|
||||||
|
@ -13,13 +13,15 @@ sub run {
|
|||||||
|
|
||||||
$self->root_console(tty => 3);
|
$self->root_console(tty => 3);
|
||||||
# Make necessary settings for the RDP server.
|
# 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
|
# Set SElinux to permissive to workaround a Fedora issue
|
||||||
assert_script_run("setenforce 0");
|
# assert_script_run("setenforce 0");
|
||||||
# Check that SElinux is in permissive mode
|
|
||||||
validate_script_output("getenforce", sub { m/Permissive/ });
|
|
||||||
|
|
||||||
# In Workstation, the RDP port should be opened per se,
|
# 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");
|
assert_script_run("firewall-cmd --add-port=3389/tcp");
|
||||||
|
|
||||||
# Change to Desktop
|
# Change to Desktop
|
||||||
@ -34,12 +36,8 @@ sub run {
|
|||||||
assert_and_click("settings_remote_desktop");
|
assert_and_click("settings_remote_desktop");
|
||||||
assert_and_click("settings_remote_login");
|
assert_and_click("settings_remote_login");
|
||||||
assert_and_click("gnome_button_unlock");
|
assert_and_click("gnome_button_unlock");
|
||||||
if (check_screen("auth_required_password", timeout => 60)) {
|
assert_screen("auth_required_password", timeout => 60);
|
||||||
type_very_safely("$password\n");
|
type_very_safely("$password\n");
|
||||||
}
|
|
||||||
else {
|
|
||||||
die("Authentication dialogue is not visible but was expected.");
|
|
||||||
}
|
|
||||||
|
|
||||||
# Set up remote login in Gnome Settings.
|
# Set up remote login in Gnome Settings.
|
||||||
assert_and_click("settings_switch_remote");
|
assert_and_click("settings_switch_remote");
|
||||||
@ -55,11 +53,7 @@ sub run {
|
|||||||
|
|
||||||
# RDP does not allow connections when the user is still logged in
|
# RDP does not allow connections when the user is still logged in
|
||||||
# locally, so let's reboot the machine to start from anew.
|
# locally, so let's reboot the machine to start from anew.
|
||||||
assert_and_click("system_menu_button");
|
reboot_system();
|
||||||
assert_and_click("leave_button");
|
|
||||||
assert_and_click("reboot_entry");
|
|
||||||
assert_and_click("gnome_reboot_confirm");
|
|
||||||
assert_screen("graphical_login", 240);
|
|
||||||
|
|
||||||
|
|
||||||
# Check that the service is running. If the service was not running,
|
# Check that the service is running. If the service was not running,
|
||||||
|
Loading…
Reference in New Issue
Block a user