mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2025-09-18 20:28:52 +00:00
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.
77 lines
2.5 KiB
Perl
77 lines
2.5 KiB
Perl
use base "installedtest";
|
|
use strict;
|
|
use testapi;
|
|
use utils;
|
|
use lockapi;
|
|
use mmapi;
|
|
|
|
sub run {
|
|
my $self = shift;
|
|
my $password = get_var("USER_PASSWORD", "weakpassword");
|
|
my $rdpuser = get_var("RDP_USER", "geralt");
|
|
my $rdppass = get_var("RDP_PASS", "ciriofcintra");
|
|
|
|
$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");
|
|
|
|
# In Workstation, the RDP port should be opened per se,
|
|
# (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
|
|
desktop_vt();
|
|
|
|
# Open Settings and navigate to Remote Login
|
|
menu_launch_type("Settings");
|
|
send_key("ctrl-f");
|
|
sleep(2);
|
|
type_very_safely("system");
|
|
assert_and_click("settings_system");
|
|
assert_and_click("settings_remote_desktop");
|
|
assert_and_click("settings_remote_login");
|
|
assert_and_click("gnome_button_unlock");
|
|
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");
|
|
wait_still_screen(3);
|
|
assert_and_click("settings_remote_username");
|
|
type_very_safely($rdpuser);
|
|
assert_and_click("settings_remote_password");
|
|
type_very_safely($rdppass);
|
|
assert_and_click("gnome_reveil_password");
|
|
wait_still_screen(3);
|
|
assert_and_click("settings_button_back");
|
|
send_key("alt-f4");
|
|
|
|
# RDP does not allow connections when the user is still logged in
|
|
# locally, so let's reboot the machine to start from anew.
|
|
reboot_system();
|
|
|
|
|
|
# Check that the service is running. If the service was not running,
|
|
# let's record a soft failure and start the RDP service.
|
|
$self->root_console(tty => 3);
|
|
if (script_run("systemctl status gnome-remote-desktop --no-pager")) {
|
|
record_soft_failure("The Gnome Remote Desktop service is not running.");
|
|
assert_script_run("systemctl enable --now gnome-remote-desktop");
|
|
}
|
|
|
|
# Create mutex to synchronise with the children.
|
|
mutex_create("kaermorhen_opened");
|
|
wait_for_children();
|
|
}
|
|
|
|
sub test_flags {
|
|
return {fatal => 1};
|
|
}
|
|
1;
|
|
# vim: set sw=4 et:
|