diff --git a/lib/tapnet.pm b/lib/tapnet.pm index 0dfdd225..829a37f6 100644 --- a/lib/tapnet.pm +++ b/lib/tapnet.pm @@ -6,8 +6,12 @@ use base 'Exporter'; use Exporter; use testapi; +use utils; + our @EXPORT = qw/clone_host_file setup_tap_static get_host_dns/; +my $self = shift; + sub clone_host_file { # copy a given file from the host into the guest. Mainly used # for networking config on tap tests. this is pretty crazy, but @@ -29,6 +33,17 @@ sub setup_tap_static { # this is a common thing for tap tests, where we set up networking # for the system with a static IP address and possibly a specific # hostname + + # It is possible on certain tests that this will be running while + # we are inside a graphical session. In this case we need to switch + # to the console before we proceed with the network settings. + my $console = 0; + unless (check_screen("root_console")) { + $console = 1; + send_key("ctrl-alt-f3"); + wait_still_screen(5); + console_login(user => "root"); + } my $ip = shift; my $hostname = shift || ""; if ($hostname) { @@ -53,6 +68,11 @@ sub setup_tap_static { assert_script_run "nmcli con up '$connection'"; # for debugging assert_script_run "nmcli -t con show '$connection'"; + # If we have switched to console from a graphical + # environment, here we come back to it. + if ($console) { + desktop_vt(); + } } sub get_host_dns { diff --git a/needles/gnome/apps/connections/connection_authenticate-20250902.json b/needles/gnome/apps/connections/connection_authenticate-20250902.json new file mode 100644 index 00000000..de9914d3 --- /dev/null +++ b/needles/gnome/apps/connections/connection_authenticate-20250902.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 553, + "ypos": 568, + "width": 99, + "height": 16, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connection_authenticate" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/connection_authenticate-20250902.png b/needles/gnome/apps/connections/connection_authenticate-20250902.png new file mode 100644 index 00000000..57ed7f07 Binary files /dev/null and b/needles/gnome/apps/connections/connection_authenticate-20250902.png differ diff --git a/needles/gnome/apps/connections/connection_username-20250902.json b/needles/gnome/apps/connections/connection_username-20250902.json new file mode 100644 index 00000000..b60db2ab --- /dev/null +++ b/needles/gnome/apps/connections/connection_username-20250902.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 373, + "ypos": 391, + "width": 91, + "height": 23, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connection_username" + ] +} diff --git a/needles/gnome/apps/connections/connection_username-20250902.png b/needles/gnome/apps/connections/connection_username-20250902.png new file mode 100644 index 00000000..5f367c53 Binary files /dev/null and b/needles/gnome/apps/connections/connection_username-20250902.png differ diff --git a/needles/gnome/apps/connections/connection_verify-20250902.json b/needles/gnome/apps/connections/connection_verify-20250902.json new file mode 100644 index 00000000..96ed3234 --- /dev/null +++ b/needles/gnome/apps/connections/connection_verify-20250902.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 617, + "ypos": 218, + "width": 49, + "height": 20, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connection_verify" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/connection_verify-20250902.png b/needles/gnome/apps/connections/connection_verify-20250902.png new file mode 100644 index 00000000..2c3903e6 Binary files /dev/null and b/needles/gnome/apps/connections/connection_verify-20250902.png differ diff --git a/needles/gnome/apps/connections/connections_add_connection-20250801.json b/needles/gnome/apps/connections/connections_add_connection-20250801.json new file mode 100644 index 00000000..59f6a201 --- /dev/null +++ b/needles/gnome/apps/connections/connections_add_connection-20250801.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 13, + "ypos": 44, + "width": 24, + "height": 24, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connections_add_connection" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/connections_add_connection-20250801.png b/needles/gnome/apps/connections/connections_add_connection-20250801.png new file mode 100644 index 00000000..cdee90f9 Binary files /dev/null and b/needles/gnome/apps/connections/connections_add_connection-20250801.png differ diff --git a/needles/gnome/apps/connections/connections_nothanks-20250801.json b/needles/gnome/apps/connections/connections_nothanks-20250801.json new file mode 100644 index 00000000..6199b828 --- /dev/null +++ b/needles/gnome/apps/connections/connections_nothanks-20250801.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 470, + "ypos": 598, + "width": 83, + "height": 19, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connections_nothanks" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/connections_nothanks-20250801.png b/needles/gnome/apps/connections/connections_nothanks-20250801.png new file mode 100644 index 00000000..f683846f Binary files /dev/null and b/needles/gnome/apps/connections/connections_nothanks-20250801.png differ diff --git a/needles/gnome/apps/connections/connections_runs-20250801.json b/needles/gnome/apps/connections/connections_runs-20250801.json new file mode 100644 index 00000000..4deb8d8d --- /dev/null +++ b/needles/gnome/apps/connections/connections_runs-20250801.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 508, + "ypos": 490, + "width": 168, + "height": 29, + "type": "match" + } + ], + "properties": [], + "tags": [ + "connections_runs" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/connections/connections_runs-20250801.png b/needles/gnome/apps/connections/connections_runs-20250801.png new file mode 100644 index 00000000..425af382 Binary files /dev/null and b/needles/gnome/apps/connections/connections_runs-20250801.png differ diff --git a/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json b/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json new file mode 100644 index 00000000..20e1f3f0 --- /dev/null +++ b/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.json @@ -0,0 +1,22 @@ +{ + "area": [ + { + "xpos": 190, + "ypos": 245, + "width": 148, + "height": 20, + "type": "match" + }, + { + "xpos": 426, + "ypos": 45, + "width": 173, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "freerdp_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/freerdp_desktop_connected-20250902.png new file mode 100644 index 00000000..ccb30185 Binary files /dev/null and b/needles/gnome/apps/connections/freerdp_desktop_connected-20250902.png differ diff --git a/needles/gnome/apps/settings/settings_button_back-20250801.json b/needles/gnome/apps/settings/settings_button_back-20250801.json new file mode 100644 index 00000000..e4c393cb --- /dev/null +++ b/needles/gnome/apps/settings/settings_button_back-20250801.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 270, + "ypos": 42, + "width": 27, + "height": 28, + "type": "match" + } + ], + "properties": [], + "tags": [ + "settings_button_back" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_button_back-20250801.png b/needles/gnome/apps/settings/settings_button_back-20250801.png new file mode 100644 index 00000000..f8ba7292 Binary files /dev/null and b/needles/gnome/apps/settings/settings_button_back-20250801.png differ diff --git a/needles/gnome/apps/settings/settings_remote_desktop-20250731.json b/needles/gnome/apps/settings/settings_remote_desktop-20250731.json new file mode 100644 index 00000000..328dc1b4 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_desktop-20250731.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 400, + "height": 21, + "type": "match", + "width": 113, + "ypos": 276 + } + ], + "properties": [], + "tags": [ + "settings_remote_desktop" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_desktop-20250731.png b/needles/gnome/apps/settings/settings_remote_desktop-20250731.png new file mode 100644 index 00000000..d89cd41a Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_desktop-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_remote_desktop.json b/needles/gnome/apps/settings/settings_remote_desktop.json new file mode 100644 index 00000000..993284f2 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_desktop.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_remote_desktop" + ], + "area": [ + { + "xpos": 395, + "ypos": 303, + "width": 113, + "height": 21, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_desktop.png b/needles/gnome/apps/settings/settings_remote_desktop.png new file mode 100644 index 00000000..2066105c Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_desktop.png differ diff --git a/needles/gnome/apps/settings/settings_remote_login-20250731.json b/needles/gnome/apps/settings/settings_remote_login-20250731.json new file mode 100644 index 00000000..581f86a0 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_login-20250731.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 663, + "width": 121, + "type": "match", + "ypos": 44, + "height": 23 + } + ], + "properties": [], + "tags": [ + "settings_remote_login" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_login-20250731.png b/needles/gnome/apps/settings/settings_remote_login-20250731.png new file mode 100644 index 00000000..a0c5ce4a Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_login-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_remote_login.json b/needles/gnome/apps/settings/settings_remote_login.json new file mode 100644 index 00000000..4352f967 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_login.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_remote_login" + ], + "area": [ + { + "xpos": 654, + "ypos": 71, + "width": 121, + "height": 23, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_login.png b/needles/gnome/apps/settings/settings_remote_login.png new file mode 100644 index 00000000..eb6d0608 Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_login.png differ diff --git a/needles/gnome/apps/settings/settings_remote_password-20250731.json b/needles/gnome/apps/settings/settings_remote_password-20250731.json new file mode 100644 index 00000000..a8ebdc93 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_password-20250731.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "type": "match", + "width": 463, + "ypos": 558, + "height": 20, + "xpos": 367, + "click_point": { + "xpos": 443.5, + "ypos": 10 + } + } + ], + "properties": [], + "tags": [ + "settings_remote_password" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_password-20250731.png b/needles/gnome/apps/settings/settings_remote_password-20250731.png new file mode 100644 index 00000000..d59381cd Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_password-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_remote_password.json b/needles/gnome/apps/settings/settings_remote_password.json new file mode 100644 index 00000000..da3a9151 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_password.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_remote_password" + ], + "area": [ + { + "xpos": 366, + "ypos": 590, + "width": 69, + "height": 20, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_password.png b/needles/gnome/apps/settings/settings_remote_password.png new file mode 100644 index 00000000..3fc8d60d Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_password.png differ diff --git a/needles/gnome/apps/settings/settings_remote_username-20250731.json b/needles/gnome/apps/settings/settings_remote_username-20250731.json new file mode 100644 index 00000000..614f0f11 --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_username-20250731.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "width": 491, + "type": "match", + "ypos": 503, + "height": 20, + "xpos": 371, + "click_point": { + "xpos": 476.5, + "ypos": 9 + } + } + ], + "properties": [], + "tags": [ + "settings_remote_username" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_username-20250731.png b/needles/gnome/apps/settings/settings_remote_username-20250731.png new file mode 100644 index 00000000..4401dac7 Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_username-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_remote_username.json b/needles/gnome/apps/settings/settings_remote_username.json new file mode 100644 index 00000000..25a7896c --- /dev/null +++ b/needles/gnome/apps/settings/settings_remote_username.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_remote_username" + ], + "area": [ + { + "xpos": 366, + "ypos": 535, + "width": 72, + "height": 20, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_remote_username.png b/needles/gnome/apps/settings/settings_remote_username.png new file mode 100644 index 00000000..a19c2127 Binary files /dev/null and b/needles/gnome/apps/settings/settings_remote_username.png differ diff --git a/needles/gnome/apps/settings/settings_switch_remote-20250731.json b/needles/gnome/apps/settings/settings_switch_remote-20250731.json new file mode 100644 index 00000000..995f8dd5 --- /dev/null +++ b/needles/gnome/apps/settings/settings_switch_remote-20250731.json @@ -0,0 +1,19 @@ +{ + "area": [ + { + "xpos": 371, + "ypos": 179, + "width": 542, + "type": "match", + "height": 22, + "click_point": { + "xpos": 505, + "ypos": 10 + } + } + ], + "properties": [], + "tags": [ + "settings_switch_remote" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_switch_remote-20250731.png b/needles/gnome/apps/settings/settings_switch_remote-20250731.png new file mode 100644 index 00000000..cbe32bda Binary files /dev/null and b/needles/gnome/apps/settings/settings_switch_remote-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_switch_remote.json b/needles/gnome/apps/settings/settings_switch_remote.json new file mode 100644 index 00000000..abb9d594 --- /dev/null +++ b/needles/gnome/apps/settings/settings_switch_remote.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_switch_remote" + ], + "area": [ + { + "xpos": 366, + "ypos": 208, + "width": 165, + "height": 22, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_switch_remote.png b/needles/gnome/apps/settings/settings_switch_remote.png new file mode 100644 index 00000000..bd6a4ad7 Binary files /dev/null and b/needles/gnome/apps/settings/settings_switch_remote.png differ diff --git a/needles/gnome/apps/settings/settings_system-20250731.json b/needles/gnome/apps/settings/settings_system-20250731.json new file mode 100644 index 00000000..840d1435 --- /dev/null +++ b/needles/gnome/apps/settings/settings_system-20250731.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 49, + "height": 20, + "ypos": 136, + "width": 55, + "type": "match" + } + ], + "properties": [], + "tags": [ + "settings_system" + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_system-20250731.png b/needles/gnome/apps/settings/settings_system-20250731.png new file mode 100644 index 00000000..768f896b Binary files /dev/null and b/needles/gnome/apps/settings/settings_system-20250731.png differ diff --git a/needles/gnome/apps/settings/settings_system.json b/needles/gnome/apps/settings/settings_system.json new file mode 100644 index 00000000..0af2c100 --- /dev/null +++ b/needles/gnome/apps/settings/settings_system.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "settings_system" + ], + "area": [ + { + "xpos": 67, + "ypos": 164, + "width": 55, + "height": 20, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/apps/settings/settings_system.png b/needles/gnome/apps/settings/settings_system.png new file mode 100644 index 00000000..7d759a73 Binary files /dev/null and b/needles/gnome/apps/settings/settings_system.png differ diff --git a/needles/gnome/gnome_button_connect-20250801.json b/needles/gnome/gnome_button_connect-20250801.json new file mode 100644 index 00000000..e57b3ce4 --- /dev/null +++ b/needles/gnome/gnome_button_connect-20250801.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 311, + "ypos": 312, + "width": 66, + "height": 21, + "type": "match" + } + ], + "properties": [], + "tags": [ + "gnome_button_connect" + ] +} \ No newline at end of file diff --git a/needles/gnome/gnome_button_connect-20250801.png b/needles/gnome/gnome_button_connect-20250801.png new file mode 100644 index 00000000..14429882 Binary files /dev/null and b/needles/gnome/gnome_button_connect-20250801.png differ diff --git a/needles/gnome/gnome_button_unlock-20250731.json b/needles/gnome/gnome_button_unlock-20250731.json new file mode 100644 index 00000000..4ca9cba6 --- /dev/null +++ b/needles/gnome/gnome_button_unlock-20250731.json @@ -0,0 +1,15 @@ +{ + "area": [ + { + "xpos": 935, + "ypos": 88, + "width": 69, + "height": 22, + "type": "match" + } + ], + "properties": [], + "tags": [ + "gnome_button_unlock" + ] +} \ No newline at end of file diff --git a/needles/gnome/gnome_button_unlock-20250731.png b/needles/gnome/gnome_button_unlock-20250731.png new file mode 100644 index 00000000..fcec6924 Binary files /dev/null and b/needles/gnome/gnome_button_unlock-20250731.png differ diff --git a/needles/gnome/gnome_button_unlock.json b/needles/gnome/gnome_button_unlock.json new file mode 100644 index 00000000..a1ccb712 --- /dev/null +++ b/needles/gnome/gnome_button_unlock.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "gnome_button_unlock" + ], + "area": [ + { + "xpos": 914, + "ypos": 119, + "width": 67, + "height": 19, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/gnome_button_unlock.png b/needles/gnome/gnome_button_unlock.png new file mode 100644 index 00000000..1fad0d6b Binary files /dev/null and b/needles/gnome/gnome_button_unlock.png differ diff --git a/needles/gnome/gnome_reboot_confirm-variant-20250805.json b/needles/gnome/gnome_reboot_confirm-variant-20250805.json new file mode 100644 index 00000000..78cc2db0 --- /dev/null +++ b/needles/gnome/gnome_reboot_confirm-variant-20250805.json @@ -0,0 +1,16 @@ +{ + "area": [ + { + "height": 18, + "ypos": 435, + "type": "match", + "width": 53, + "xpos": 578 + } + ], + "properties": [], + "tags": [ + "DESKTOP-gnome", + "gnome_reboot_confirm" + ] +} \ No newline at end of file diff --git a/needles/gnome/gnome_reboot_confirm-variant-20250805.png b/needles/gnome/gnome_reboot_confirm-variant-20250805.png new file mode 100644 index 00000000..6dce84f1 Binary files /dev/null and b/needles/gnome/gnome_reboot_confirm-variant-20250805.png differ diff --git a/needles/gnome/gnome_reveil_password.json b/needles/gnome/gnome_reveil_password.json new file mode 100644 index 00000000..41da03ca --- /dev/null +++ b/needles/gnome/gnome_reveil_password.json @@ -0,0 +1,15 @@ +{ + "properties": [], + "tags": [ + "gnome_reveil_password" + ], + "area": [ + { + "xpos": 833, + "ypos": 591, + "width": 20, + "height": 20, + "type": "match" + } + ] +} \ No newline at end of file diff --git a/needles/gnome/gnome_reveil_password.png b/needles/gnome/gnome_reveil_password.png new file mode 100644 index 00000000..643aec74 Binary files /dev/null and b/needles/gnome/gnome_reveil_password.png differ diff --git a/templates.fif.json b/templates.fif.json index 6aaddd76..5a3779ae 100644 --- a/templates.fif.json +++ b/templates.fif.json @@ -2165,6 +2165,37 @@ "USER_LOGIN": "false" } }, + "remote_desktop_server": { + "profiles": { + "fedora-Workstation-live-iso-x86_64-*-64bit": 35 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "NICTYPE": "tap", + "POSTINSTALL": "remote_desktop_server", + "POST_STATIC": "172.16.2.177 kaermorhen.test.openqa.fedoraproject.org", + "ROOT_PASSWORD": "weakpassword", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%", + "WORKER_CLASS": "tap" + } + }, + "remote_desktop_client": { + "profiles": { + "fedora-Workstation-live-iso-x86_64-*-64bit": 40 + }, + "settings": { + "BOOTFROM": "c", + "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2", + "NICTYPE": "tap", + "POSTINSTALL": "remote_desktop_client", + "PARALLEL_WITH": "remote_desktop_server", + "POST_STATIC": "172.16.2.179 visimir.test.openqa.fedoraproject.org", + "ROOT_PASSWORD": "weakpassword", + "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%", + "WORKER_CLASS": "tap" + } + }, "rpmostree_overlay": { "profile_groups": { "coreos-iot-silverblue": 20 diff --git a/tests/remote_desktop_client.pm b/tests/remote_desktop_client.pm new file mode 100644 index 00000000..5a5b86fa --- /dev/null +++ b/tests/remote_desktop_client.pm @@ -0,0 +1,67 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +use mmapi; +use lockapi; + +# This test uses a Connections application to establish an +# RDP connection to a remote computer running Gnome Workstation. + +sub run { + my $self = shift; + my $password = get_var("USER_PASSWORD", "weakpassword"); + my $rdpuser = "geralt"; + my $rdppass = "ciriofcintra"; + my $ip = "172.16.2.177"; + + # Wait until the RDP server is ready + # and lock parallel connection. + mutex_lock("kaermorhen_opened"); + + # Unlock the session if it has locked in the meantime. + if (check_screen("panel_screen_locked")) { + send_key("up"); + sleep(1); + type_very_safely("$password\n"); + } + + # Open the Connections and start the connection. + menu_launch_type("connections"); + wait_still_screen(3); + assert_screen("connections_runs"); + assert_and_click("connections_nothanks"); + assert_and_click("connections_add_connection"); + type_very_safely($ip); + assert_and_click("gnome_button_connect"); + + # Log onto the system. + assert_and_click("connection_verify"); + assert_and_click("connection_username"); + type_very_safely($rdpuser); + send_key("tab"); + send_key("tab"); + type_very_safely($rdppass); + assert_and_click("connection_authenticate"); + wait_still_screen(3); + send_key("ret"); + type_very_safely("$password\n"); + wait_still_screen(2); + + # Start the terminal + type_very_safely("terminal\n"); + wait_still_screen(3); + + # Check that we are on the correct computer. + # We can tell from the terminal prompt. + assert_screen("freerdp_desktop_connected"); + + # Unlock the parallel connection + mutex_unlock("karemorhen_opened"); +} + +sub test_flags { + return {fatal => 1, milestone => 1}; +} +1; +# vim: set sw=4 et: diff --git a/tests/remote_desktop_server.pm b/tests/remote_desktop_server.pm new file mode 100644 index 00000000..2275e85d --- /dev/null +++ b/tests/remote_desktop_server.pm @@ -0,0 +1,83 @@ +use base "installedtest"; +use strict; +use testapi; +use utils; +use lockapi; +use mmapi; + +sub run { + my $self = shift; + my $user = get_var("USER_LOGIN", "test"); + my $password = get_var("USER_PASSWORD", "weakpassword"); + my $rdpuser = "geralt"; + my $rdppass = "ciriofcintra"; + + $self->root_console(tty => 3); + # Make necessary settings for the RDP server. + # 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/ }); + + # In Workstation, the RDP port should be opened per se, + # but let's open it explicitely, to make sure it is open. + 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"); + if (check_screen("auth_required_password", timeout => 60)) { + type_very_safely("$password\n"); + } + else { + die("Authentication dialogue is not visible but was expected."); + } + + # 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. + 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); + + + # 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: