#315 Create test suite for Desktop Keyring
Merged a year ago by adamwill. Opened a year ago by lruzicka.

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 271,

+       "ypos": 113,

+       "width": 142,

+       "height": 24,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "apps_run_seahorse"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 226,

+       "ypos": 271,

+       "width": 164,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_password"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 543,

+       "ypos": 236,

+       "width": 170,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_yesno"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 442,

+       "ypos": 261,

+       "width": 126,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_details_shown"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 35,

+       "ypos": 121,

+       "width": 38,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_login"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 33,

+       "ypos": 121,

+       "width": 40,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_login"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 338,

+       "ypos": 111,

+       "width": 169,

+       "height": 26,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_login_details"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 440,

+       "ypos": 262,

+       "width": 111,

+       "height": 22,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_password_shown"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 615,

+       "ypos": 260,

+       "width": 27,

+       "height": 26,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_seahorse_show_password"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "ypos": 292,

+       "height": 37,

+       "xpos": 183,

+       "type": "match",

+       "width": 42

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_sftp_logged"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 382,

+       "ypos": 434,

+       "width": 136,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_autounlock_password"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "type": "match",

+       "height": 21,

+       "xpos": 360,

+       "width": 141,

+       "ypos": 104

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_connection_established"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 361,

+       "ypos": 104,

+       "width": 141,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_connection_established"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 260,

+       "ypos": 608,

+       "width": 138,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_enter_address"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "type": "match",

+       "height": 20,

+       "xpos": 260,

+       "width": 136,

+       "ypos": 611

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_enter_address"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 258,

+       "ypos": 610,

+       "width": 140,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_enter_address"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "ypos": 559,

+       "width": 109,

+       "xpos": 109,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_other_locations"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 109,

+       "ypos": 559,

+       "width": 109,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_other_locations"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 381,

+       "ypos": 434,

+       "width": 142,

+       "height": 21,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_remember_password"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "height": 17,

+       "ypos": 495,

+       "width": 52,

+       "type": "match",

+       "xpos": 587

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_unlock"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 587,

+       "ypos": 495,

+       "width": 52,

+       "height": 17,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "nautilus_unlock"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 554,

+       "ypos": 444,

+       "width": 49,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_confirm"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 379,

+       "ypos": 322,

+       "width": 167,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_password"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 381,

+       "ypos": 414,

+       "width": 92,

+       "height": 16,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_remember"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "ypos": 265,

+       "width": 118,

+       "height": 19,

+       "type": "match",

+       "xpos": 380

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_yesno"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,16 @@ 

+ {

+   "area": [

+     {

+       "type": "match",

+       "xpos": 453,

+       "height": 19,

+       "ypos": 347,

+       "width": 138,

+       "match": 90

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_askpass_yesno"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 59,

+       "ypos": 382,

+       "width": 42,

+       "height": 37,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_sftp_logged"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 450,

+       "ypos": 284,

+       "width": 103,

+       "height": 17,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_wallet_password"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 62,

+       "ypos": 308,

+       "width": 94,

+       "height": 16,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_wallet_password_details"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 456,

+       "ypos": 245,

+       "width": 91,

+       "height": 19,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_wallet_password_reveal"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 26,

+       "ypos": 284,

+       "width": 86,

+       "height": 20,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_wallet_password_stored"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 23,

+       "ypos": 258,

+       "width": 117,

+       "height": 18,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "keyring_wallet_passwords_unfold"

+   ]

+ } 

\ No newline at end of file

@@ -0,0 +1,15 @@ 

+ {

+   "area": [

+     {

+       "xpos": 459,

+       "ypos": 96,

+       "width": 104,

+       "height": 23,

+       "type": "match"

+     }

+   ],

+   "properties": [],

+   "tags": [

+     "kwalletmanager_runs"

+   ]

+ } 

\ No newline at end of file

empty or binary file added
file modified
+14
@@ -1357,6 +1357,20 @@ 

                  "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"

              }

          },

+         "desktop_keyring": {

+             "profiles": {

+                 "fedora-Workstation-live-iso-ppc64le-*-ppc64le": 20,

+                 "fedora-Workstation-live-iso-x86_64-*-64bit": 20,

+                 "fedora-KDE-live-iso-x86_64-*-64bit": 30,

+                 "fedora-Workstation-raw_xz-raw.xz-aarch64-*-aarch64": 22

+             },

+             "settings": {

+                 "BOOTFROM": "c",

+                 "HDD_1": "disk_%FLAVOR%_%MACHINE%.qcow2",

+                 "POSTINSTALL_PATH": "tests/applications/keyring",

+                 "START_AFTER_TEST": "%DEPLOY_UPLOAD_TEST%"

+             }

+         },

          "desktop_update_graphical": {

              "profiles": {

                  "fedora-KDE-live-iso-x86_64-*-64bit": 32,

@@ -0,0 +1,42 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ # This script will do the following:

+ # - install Seahorse when on Gnome

+ # - enable the sshd.service

+ # - create an SSH key for the installed user (~ test)

+ # - set up the SSH key password for that key

+ # - it will set a milestone

+ 

+ sub run {

+     my $self = shift;

+     my $desktop = get_var("DESKTOP");

+     my $user = get_var("USER") || "test";

+ 

+     # Switch to console to perform several setting tasks.

+     $self->root_console(tty => 3);

+ 

+     # Install Seahorse on Gnome.

+     # On KDE, similar application is already installed in the system.

+     if ($desktop eq "gnome") {

+         assert_script_run("dnf -y install seahorse");

+     }

+ 

+     # Enable and start sshd.service and check that is is running.

+     assert_script_run("systemctl enable sshd.service --now");

+     assert_script_run("systemctl status sshd.service --no-pager");

+ 

+     # Create the SSH keys with password for the regular user.

+     # Switch to that user's account.

+     assert_script_run("su $user -c 'ssh-keygen -N sshpassword -f /home/$user/.ssh/id_ed25519'");

+ }

+ 

+ sub test_flags {

+     return {fatal => 1, milestone => 1};

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

@@ -0,0 +1,174 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ # This script will do the following:

+ # - it will establish a connection to the system via sftp

+ # - it will ask for password to the system and store that password

+ # - it will check that the password was stored in the keyring

+ # - it will reboot the system

+ # - it will re-establish the connection without asking for the password

+ 

+ my $user = get_var("USER_LOGIN", "test");

+ my $pass = get_var("USER_PASSWORD", "weakpassword");

+ my $desktop = get_var("DESKTOP", "gnome");

+ 

+ # On KDE, it is possible that Konsole interacts with keyring when

+ # certain variables are set in the system. This subroutine sets up

+ # those variables.

+ sub export_kde_vars {

+     enter_cmd('export SSH_ASKPASS=/usr/bin/ksshaskpass');

+     sleep 2;

+     enter_cmd('export SSH_ASKPASS_REQUIRE=prefer');

+     sleep 2;

+ }

+ 

+ # This will handle the connection to the localhost. The process is different

+ # for KDE and Gnome, as currently Gnome does not save passwords to keyring

+ # from terminal and the KDE has a bug KNetAttach that prevents Dolphin from

+ # establishing the connection like Nautilus does.

+ sub connect_localhost {

+     my $type = shift;

+     # For Gnome, we will use Nautilus to establish an SFTP

+     # connection to the localhost.

+     if (get_var("DESKTOP") eq "gnome") {

+         # Start Nautilus.

+         menu_launch_type("nautilus");

+         assert_screen("apps_run_files");

+         # Add a new network connection.

+         assert_and_click("nautilus_other_locations");

+         assert_and_click("nautilus_enter_address");

+         my $connection = "ssh://$user" . '@localhost';

+         type_very_safely("$connection\n");

+         # When we connect for the first time, a password

+         # dialogue should appear in which we need to type

+         # in the password. We will also try to remember the

+         # password and confirm the connection.

+         if ($type ne "reconnect") {

+             wait_still_screen(3);

+             type_very_safely($pass);

+             assert_and_click("nautilus_remember_password");

+             assert_and_click("nautilus_unlock");

+         }

+         # When the connection has been established,

+         # a new connection icon will appear.

+         assert_screen("nautilus_connection_established");

+     }

+     else {

+         # On KDE, Dolphin has a bug that prevents the application

+         # from connecting easily (as in Gnome). Manually, this is

+         # not a big deal, as one could react accordingly, but with

+         # automation, this approach is basically useless.

+         # Therefore, we will use a different approach - we will enable

+         # CLI keyring integration and perform an SFTP connection

+         # in Konsole.

+         menu_launch_type("konsole");

+         assert_screen("konsole_runs");

+         # Export the environmental variables, this is needed for the process

+         # to work correctly.

+         export_kde_vars();

+         # Connect the sftp.

+         my $command = "sftp $user" . '@localhost';

+         enter_cmd($command);

+         # If performed for the first time, also deal with the

+         # password storing which is a little painful on KDE.

+         if ($type ne "reconnect") {

+             # First, we check that the yes no dialogue is present

+             # and type "yes" into it.

+             assert_screen("keyring_askpass_yesno");

+             type_very_safely("yes\n");

+             # Then similarly to Gnome, the password dialogue will appear

+             # and we type in the password. Also, we click on Remember

+             # and confirm with the OK button.

+             assert_screen("keyring_askpass_password");

+             type_very_safely("$pass");

+             assert_and_click("keyring_askpass_remember");

+             assert_and_click("keyring_askpass_confirm");

+         }

+         # Check that we have logged in and exit the application.

+         assert_and_click("keyring_sftp_logged");

+         type_very_safely("bye\n");

+     }

+ }

+ 

+ sub check_stored {

+     # This subroutine will run the keyring application on either

+     # desktop and check that the password has been stored there.

+     # On KDE, we will use the KWalletManager.

+     if (get_var("DESKTOP") eq "kde") {

+         menu_launch_type("kwalletmanager");

+         assert_screen("kwalletmanager_runs");

+         send_key("super-pgup");

+         # Navigate to the stored entry and check

+         # that the credentials are stored there.

+         assert_and_dclick("keyring_wallet_passwords_unfold");

+         assert_and_dclick("keyring_wallet_password_stored");

+         assert_and_click("keyring_wallet_password_details");

+         assert_and_click("keyring_wallet_password_reveal");

+         assert_screen("keyring_wallet_password");

+     }

+     else {

+         # Start the Seahorse application and maximize it.

+         menu_launch_type("seahorse");

+         assert_screen("apps_run_seahorse");

+         send_key("super-up");

+ 

+         # Navigate to the stored entry and check

+         # that the credentials are stored there.

+         assert_and_click("keyring_seahorse_login");

+         assert_and_dclick("keyring_seahorse_login_details");

+         assert_screen("keyring_seahorse_details_shown");

+         assert_and_click("keyring_seahorse_show_password");

+         assert_screen("keyring_seahorse_password_shown");

+     }

+ }

+ 

+ sub perform_login {

+     my $password = shift;

+     send_key("ret") if ($desktop eq "gnome");

+     type_very_safely("$password\n");

+     wait_still_screen(3);

+     send_key("esc");

+ }

+ 

+ sub run {

+     my $self = shift;

+ 

+     # We are still at the root console, but for the following steps,

+     # there is nothing we should be doing there, so we switch back

+     # to the graphical desktop.

+     desktop_vt();

+ 

+     if (check_screen("login_screen", timeout => 30)) {

+         perform_login($pass);

+     }

+ 

+     # Lets connect to localhost via SSH. This should result in

+     # asking for a password and storing the credentials for later use.

+     # The following routine uses different approaches on different

+     # desktops.

+     connect_localhost("connect");

+     # Check that the password has been stored.

+     check_stored();

+ 

+     # Reboot the machine, log onto the session again.

+     $self->root_console(tty => 3);

+     enter_cmd("reboot");

+ 

+     # Boot to login screen and type in the password.

+     boot_to_login_screen();

+     perform_login($pass);

+ 

+     # Repeat the connection procedure, but skip the password

+     # handling process as this will be done by the keyring.

+     connect_localhost("reconnect");

+ }

+ 

+ sub test_flags {

+     return {fatal => 0, always_rollback => 1};

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

@@ -0,0 +1,125 @@ 

+ use base "installedtest";

+ use strict;

+ use testapi;

+ use utils;

+ 

+ # This script will do the following:

+ #  - set up the system for paswordless connection using

+ #    the SSH authorized keys.

+ #  - open the ssh key and establish the connection

+ #  - store that password in the keyring

+ #  - reboot the system

+ #  - re-establish the connection, this time without the need to open the password

+ 

+ my $desktop = get_var("DESKTOP");

+ my $user = get_var("USER_LOGIN", "test");

+ my $pass = get_var("USER_PASSWORD", "weakpassword");

+ 

+ sub export_kde_vars {

+     # On KDE, it is possible to update and reuse the keyring

+     # on Konsole if correct environmental variables are set.

+     # Set them now.

+     enter_cmd('export SSH_ASKPASS=/usr/bin/ksshaskpass');

+     sleep 2;

+     enter_cmd('export SSH_ASKPASS_REQUIRE=prefer');

+     sleep 2;

+ }

+ 

+ sub connect_localhost {

+     my $type = shift;

+ 

+     # Start the terminal application. On KDE also export the variables.

+     if (get_var("DESKTOP") eq "gnome") {

+         menu_launch_type("terminal");

+         assert_screen("apps_run_terminal");

+     }

+     else {

+         menu_launch_type("konsole");

+         assert_screen("konsole_runs");

+         export_kde_vars();

+     }

+ 

+     # Establish the SFTP connection to the localhost.

+     # A dialogue should appear to collect credentials to open

+     # the SSH key.

+     my $command = "sftp $user" . '@localhost';

+     enter_cmd($command);

+     sleep 2;

+ 

+     # When connecting for the first time, we will remember

+     # the key password and store it in the keyring.

+     if ($type ne "reconnect") {

+         if ($desktop eq "gnome") {

+             type_very_safely("yes\n");

+             wait_still_screen(2);

+             type_very_safely("sshpassword");

+             assert_and_click("nautilus_autounlock_password");

+             assert_and_click("nautilus_unlock");

+         }

+         else {

+             type_very_safely("yes\n");

+             wait_still_screen(2);

+             type_very_safely("sshpassword");

+             assert_and_click("keyring_askpass_remember");

+             assert_and_click("keyring_askpass_confirm");

+         }

+     }

+ 

+     # The connection should have been established if everything has worked

+     # so far.

+     assert_screen("keyring_sftp_logged");

+     # Finish the connection.

+     enter_cmd("bye");

+     # Exit the terminal app.

+     enter_cmd("exit");

+ }

+ 

+ sub perform_login {

+     my $password = shift;

+     send_key("ret") if ($desktop eq "gnome");

+     type_very_safely("$password\n");

+     wait_still_screen(3);

+     send_key("esc");

+ }

+ 

+ sub run {

+     my $self = shift;

+ 

+     # We are still at the root console and for the following steps,

+     # Set up the SSH daemon

+ 

+     # Authorize the SSH key.

+     enter_cmd("su -l $user");

+     enter_cmd('echo $(cat ~/.ssh/id_ed25519.pub) > ~/.ssh/authorized_keys');

+     enter_cmd("exit");

+ 

+     # Return to desktop

+     desktop_vt();

+ 

+     # If we arrive to a login screen, perform login

+     if (check_screen("login_screen", timeout => 30)) {

+         perform_login($pass);

+     }

+ 

+     # Use SSH to connect to the localhost.

+     connect_localhost("connect");

+ 

+     # Reboot the machine.

+     $self->root_console(tty => 3);

+     enter_cmd("reboot");

+     # Log in.

+     boot_to_login_screen();

+     perform_login($pass);

+ 

+     # Reconnect without using password. We still should be

+     # able to log in.

+     connect_localhost("reconnect");

+ }

+ 

+ sub test_flags {

+     return {fatal => 0, always_rollback => 1};

+ }

+ 

+ 1;

+ 

+ # vim: set sw=4 et:

This adds both the Gnome and the KDE tests to test the
Desktop Keyring. After a discussion with the Brno team,
how this could be tested without the need to rely on
external servers to log into, we set up a local FTP server,
we will log into it and remember the credentials and verify
that the credentials will be stored in the keyring correctly.

a thought: could we use sshd instead of setting up an ftp server? create an ssh key, configure it as authorized, then ssh to localhost using it? shouldn't that also get stored in the keyring?

a thought: could we use sshd instead of setting up an ftp server? create an ssh key, configure it as authorized, then ssh to localhost using it? shouldn't that also get stored in the keyring?

We probably could. I spoke with @kparal before starting this and he suggested SSH or FTP. I thought that the FTP would be better because it adds some strange element into the equation, that keeps the system users and the FTP users apart, so it feels to me like it resembles the reality a little bit better.

I understand that doing just SSH is simple, shorter, and maybe the test will be more stable. I somehow still like the FTP more.

Shall I rewrite it, then?

rebased onto fbaf1652d8a0e0e20ae5ff178ee3f418bf24336c

a year ago

Metadata Update from @lruzicka:
- Request assigned

a year ago

I guess I'm just worried that this adds a dependency on a non-critical component (the FTP server) to test a critical one (the keyring). if pureftpd breaks or the way you set it up changes, we have to deal with that somehow or we have no keyring test. whereas if sshd breaks it's gonna get fixed pretty fast :P i'm not sure the benefit of testing a slightly different path in the keyring stuff is worth that cost.

for ssh, i think we can also test both password-based and key-based auth and make sure the keyring handles both? i haven't tried it, but...it should be possible?

oh, btw, I think tests/applications/okular/night_mode.pm should not be in this PR at all, I assume it's a stray file from some other branch?

I guess I'm just worried that this adds a dependency on a non-critical component (the FTP server) to test a critical one (the keyring). if pureftpd breaks or the way you set it up changes, we have to deal with that somehow or we have no keyring test. whereas if sshd breaks it's gonna get fixed pretty fast :P i'm not sure the benefit of testing a slightly different path in the keyring stuff is worth that cost.

for ssh, i think we can also test both password-based and key-based auth and make sure the keyring handles both? i haven't tried it, but...it should be possible?

Ok, that makes sense. I will change it.

oh, btw, I think tests/applications/okular/night_mode.pm should not be in this PR at all, I assume it's a stray file from some other branch?

Damn.

Still working on this in a new branch. I was having some problems with a bug 22779506. When ready, I will update this one.

rebased onto 22e9217

a year ago

2 new commits added

  • Rewrite the suite to use SSH instead of FTP.
  • Create test suite for Desktop Keyring
a year ago

The latest version performs the following:

Setup SSH

  1. Install Seahorse on GNOME: If the desktop environment is GNOME, install the Seahorse application.
  2. Enable and Start sshd Service: Enable and start the SSH daemon service and ensure it is running.
  3. Create SSH Keys: Switch to a regular user's account, generate an SSH key with a password, and store the password.
  4. Return to Root Console: Exit the regular user account and return to the root console.
  5. Set Test Flags: Set the test as fatal and mark it as a milestone.

Establish an SFTP connection to the localhost using the login and password.

  1. Setup SFTP Connection: Depending on the desktop environment (GNOME or KDE), open a file manager (Nautilus for GNOME or Konsole for KDE), and establish an SFTP connection to localhost.
    - For GNOME, it uses Nautilus to establish the connection and store the password in the keyring.
    - For KDE, it sets environmental variables to enable keyring integration and uses Konsole to establish the connection and store the password.
  2. Check Stored Password: Verify that the password has been stored in the keyring.
    - For KDE, it uses KWalletManager.
    - For GNOME, it uses Seahorse.
  3. Reboot and Reconnect: Reboot the system, log back in, and re-establish the connection without needing to enter the password again.

Setup Passwordless SSH Connection

  1. Install Seahorse on GNOME: If the desktop environment is GNOME, install Seahorse.
  2. Configure SSH Daemon: Create a configuration file to disable password authentication for SSH and restart the SSH daemon.
  3. Authorize SSH Key: As the regular user, add the SSH public key to the authorized keys file.
  4. Establish SFTP Connection: Depending on the desktop environment, open a terminal (GNOME Terminal or Konsole), and establish an SFTP connection to localhost, storing the key password in the keyring.
  5. Reboot and Reconnect: Reboot the system, log back in, and re-establish the connection without entering the password, verifying the connection is passwordless.

rebased onto 3266ac1c0a6691598e1920104d7eba93b82daca0

a year ago

I think we could make this non-interactive and avoid needing the su by doing:
assert_script_run("su $user -c 'ssh-keygen -N sshpassword -f /home/$user/.ssh/id_ed25519'");

is this strictly necessary? the server will prefer key over password auth if it's possible, and it's not like we might false-pass if key auth doesn't work, since the passwords are different...

tests/applications/okular/night_mode.pm seems to be a rogue file from some other branch. aside from that and the couple of minor comments above, this looks good, thanks! I'll deploy it on stg over the weekend and we can see how it runs.

this seems to be mostly working fine, it needed a couple of new needles for GNOME which are in the needles/ directory on staging...if you can add those to the PR, drop the stray night_mode.pm, and look at the other two comments, we can merge this.

rebased onto 9cf8e1b

a year ago

well, I went ahead and added the new needles and wiped the stray file now, still needs the two comments looked at.

rebased onto a36e86f

a year ago

1 new commit added

  • Adjust COPR / tag package info generation for dnf5 properties
a year ago

rebased onto e2fde78

a year ago

Hey, you should have dropped me a line on Messenger or something. I only spotted now that you had replied already.

1 new commit added

  • Use one command to create ssh key.
a year ago

1 new commit added

  • Do not create the drop-in configuration file.
a year ago

This PR fixes #324.

To Adam: this is for kanban tracking purposes :D

5 new commits added

  • Do not create the drop-in configuration file.
  • Use one command to create ssh key.
  • Update some needles for current Rawhide
  • Rewrite the suite to use SSH instead of FTP.
  • Create test suite for Desktop Keyring
a year ago

I have adapted the PR to include the suggested changes and tested locally -> the tests do work well with the latest changes.

rebased onto e2fde78

a year ago

7 new commits added

  • Do not create the drop-in configuration file.
  • Use one command to create ssh key.
  • Update some needles for current Rawhide
  • Rewrite the suite to use SSH instead of FTP.
  • Create test suite for Desktop Keyring
  • Defend even harder against progress spew in updatepkgs.txt
  • Yet more timeout
a year ago

rebased onto 206ffc2

a year ago

Hey, you should have dropped me a line on Messenger or something. I only spotted now that you had replied already.

I think it's normal to make sure you check email notifications for forges where you are actively working. I'm not going to write a comment here and then message you to tell you I wrote a comment, sorry :)

rebased onto 206ffc2

a year ago

It's failing quite a lot on KDE because of the damn KDE 'repeating keypress' bug, but that's happening in some other places too. I've squashed this and will merge it as-is, then do another commit to apply the ugly workaround for the repeated-keypress bug in more places.

Pull-Request has been merged by adamwill

a year ago

Hey, you should have dropped me a line on Messenger or something. I only spotted now that you had replied already.

I think it's normal to make sure you check email notifications for forges where you are actively working. I'm not going to write a comment here and then message you to tell you I wrote a comment, sorry :)

Yeah, you are certainly right.

Metadata
Changes Summary 70
+15
file added
needles/gnome/apps/apps_run_seahorse.json
+0
file added
needles/gnome/apps/apps_run_seahorse.png
+15
file added
needles/gnome/apps/keyring/keyring_askpass_password-gnome.json
+0
file added
needles/gnome/apps/keyring/keyring_askpass_password-gnome.png
+15
file added
needles/gnome/apps/keyring/keyring_askpass_yesno-gnome.json
+0
file added
needles/gnome/apps/keyring/keyring_askpass_yesno-gnome.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_details_shown.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_details_shown.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_login-blue.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_login-blue.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_login.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_login.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_login_details.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_login_details.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_password_shown.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_password_shown.png
+15
file added
needles/gnome/apps/keyring/keyring_seahorse_show_password.json
+0
file added
needles/gnome/apps/keyring/keyring_seahorse_show_password.png
+15
file added
needles/gnome/apps/keyring/keyring_sftp_logged-gnome.json
+0
file added
needles/gnome/apps/keyring/keyring_sftp_logged-gnome.png
+15
file added
needles/gnome/apps/nautilus/nautilus_autounlock_password.json
+0
file added
needles/gnome/apps/nautilus/nautilus_autounlock_password.png
+15
file added
needles/gnome/apps/nautilus/nautilus_connection_established-20240604.json
+0
file added
needles/gnome/apps/nautilus/nautilus_connection_established-20240604.png
+15
file added
needles/gnome/apps/nautilus/nautilus_connection_established.json
+0
file added
needles/gnome/apps/nautilus/nautilus_connection_established.png
+15
file added
needles/gnome/apps/nautilus/nautilus_enter_address-20240429.json
+0
file added
needles/gnome/apps/nautilus/nautilus_enter_address-20240429.png
+15
file added
needles/gnome/apps/nautilus/nautilus_enter_address-20240604.json
+0
file added
needles/gnome/apps/nautilus/nautilus_enter_address-20240604.png
+15
file added
needles/gnome/apps/nautilus/nautilus_enter_address.json
+0
file added
needles/gnome/apps/nautilus/nautilus_enter_address.png
+15
file added
needles/gnome/apps/nautilus/nautilus_other_locations-20240604.json
+0
file added
needles/gnome/apps/nautilus/nautilus_other_locations-20240604.png
+15
file added
needles/gnome/apps/nautilus/nautilus_other_locations.json
+0
file added
needles/gnome/apps/nautilus/nautilus_other_locations.png
+15
file added
needles/gnome/apps/nautilus/nautilus_remember_password.json
+0
file added
needles/gnome/apps/nautilus/nautilus_remember_password.png
+15
file added
needles/gnome/apps/nautilus/nautilus_unlock-20240514.json
+0
file added
needles/gnome/apps/nautilus/nautilus_unlock-20240514.png
+15
file added
needles/gnome/apps/nautilus/nautilus_unlock.json
+0
file added
needles/gnome/apps/nautilus/nautilus_unlock.png
+15
file added
needles/kde/apps/keyring/keyring_askpass_confirm.json
+0
file added
needles/kde/apps/keyring/keyring_askpass_confirm.png
+15
file added
needles/kde/apps/keyring/keyring_askpass_password.json
+0
file added
needles/kde/apps/keyring/keyring_askpass_password.png
+15
file added
needles/kde/apps/keyring/keyring_askpass_remember.json
+0
file added
needles/kde/apps/keyring/keyring_askpass_remember.png
+15
file added
needles/kde/apps/keyring/keyring_askpass_yesno-20240510.json
+0
file added
needles/kde/apps/keyring/keyring_askpass_yesno-20240510.png
+16
file added
needles/kde/apps/keyring/keyring_askpass_yesno.json
+0
file added
needles/kde/apps/keyring/keyring_askpass_yesno.png
+15
file added
needles/kde/apps/keyring/keyring_sftp_logged.json
+0
file added
needles/kde/apps/keyring/keyring_sftp_logged.png
+15
file added
needles/kde/apps/keyring/keyring_wallet_password.json
+0
file added
needles/kde/apps/keyring/keyring_wallet_password.png
+15
file added
needles/kde/apps/keyring/keyring_wallet_password_details.json
+0
file added
needles/kde/apps/keyring/keyring_wallet_password_details.png
+15
file added
needles/kde/apps/keyring/keyring_wallet_password_reveal.json
+0
file added
needles/kde/apps/keyring/keyring_wallet_password_reveal.png
+15
file added
needles/kde/apps/keyring/keyring_wallet_password_stored.json
+0
file added
needles/kde/apps/keyring/keyring_wallet_password_stored.png
+15
file added
needles/kde/apps/keyring/keyring_wallet_passwords_unfold.json
+0
file added
needles/kde/apps/keyring/keyring_wallet_passwords_unfold.png
+15
file added
needles/kde/apps/kwalletmanager_runs.json
+0
file added
needles/kde/apps/kwalletmanager_runs.png
+14 -0
file changed
templates.fif.json
+42
file added
tests/applications/keyring/aaa_setup.pm
+174
file added
tests/applications/keyring/keyring_password.pm
+125
file added
tests/applications/keyring/keyring_passwordless.pm