1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-10-22 18:14:21 +00:00

keyring: simplify and make more robust

This avoids some magic waits by asserting screens (which is much
more reliable), and combines KDE and GNOME flows in the
passwordless test by adding some needle tags to the nautilus
needles.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2024-10-05 10:02:04 -07:00
parent c65071f879
commit 6d2974f722
16 changed files with 56 additions and 68 deletions

View File

@ -1,15 +0,0 @@
{
"area": [
{
"xpos": 226,
"ypos": 271,
"width": 164,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"keyring_askpass_password"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 KiB

View File

@ -0,0 +1,15 @@
{
"area": [
{
"height": 21,
"width": 170,
"ypos": 240,
"xpos": 550,
"type": "match"
}
],
"properties": [],
"tags": [
"keyring_askpass_yesno"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 KiB

View File

@ -10,6 +10,8 @@
],
"properties": [],
"tags": [
"nautilus_autounlock_password"
"nautilus_autounlock_password",
"keyring_askpass_remember",
"DESKTOP-gnome"
]
}

View File

@ -10,6 +10,8 @@
],
"properties": [],
"tags": [
"nautilus_remember_password"
"nautilus_remember_password",
"keyring_askpass_remember",
"DESKTOP-gnome"
]
}

View File

@ -10,6 +10,8 @@
],
"properties": [],
"tags": [
"nautilus_unlock"
"nautilus_unlock",
"keyring_askpass_confirm",
"DESKTOP-gnome"
]
}

View File

@ -10,6 +10,8 @@
],
"properties": [],
"tags": [
"nautilus_unlock"
"nautilus_unlock",
"keyring_askpass_confirm",
"DESKTOP-gnome"
]
}

View File

@ -10,6 +10,7 @@
],
"properties": [],
"tags": [
"keyring_askpass_confirm"
"keyring_askpass_confirm",
"DESKTOP-kde"
]
}

View File

@ -1,15 +0,0 @@
{
"area": [
{
"xpos": 379,
"ypos": 322,
"width": 167,
"height": 19,
"type": "match"
}
],
"properties": [],
"tags": [
"keyring_askpass_password"
]
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 KiB

View File

@ -10,6 +10,7 @@
],
"properties": [],
"tags": [
"keyring_askpass_remember"
"keyring_askpass_remember",
"DESKTOP-kde"
]
}

View File

@ -10,6 +10,7 @@
],
"properties": [],
"tags": [
"keyring_askpass_yesno"
"keyring_askpass_yesno",
"DESKTOP-kde"
]
}

View File

@ -11,6 +11,7 @@
],
"properties": [],
"tags": [
"keyring_askpass_yesno"
"keyring_askpass_yesno",
"DESKTOP-kde"
]
}

View File

@ -46,10 +46,10 @@ sub connect_localhost {
# in the password. We will also try to remember the
# password and confirm the connection.
if ($type ne "reconnect") {
wait_still_screen(3);
assert_screen("keyring_askpass_remember");
type_very_safely($pass);
assert_and_click("nautilus_remember_password");
assert_and_click("nautilus_unlock");
click_lastmatch;
assert_and_click("keyring_askpass_confirm");
}
# When the connection has been established,
# a new connection icon will appear.
@ -83,9 +83,9 @@ sub connect_localhost {
# 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");
assert_screen("keyring_askpass_remember");
type_very_safely("$pass");
assert_and_click("keyring_askpass_remember");
click_lastmatch;
assert_and_click("keyring_askpass_confirm");
}
# Check that we have logged in and exit the application.
@ -154,7 +154,7 @@ sub run {
# Boot to login screen and type in the password.
boot_to_login_screen();
dm_perform_login($desktop, $pass);
check_desktop;
check_desktop(timeout => 120);
# Repeat the connection procedure, but skip the password
# handling process as this will be done by the keyring.

View File

@ -46,25 +46,16 @@ sub connect_localhost {
# 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");
}
assert_screen("keyring_askpass_yesno");
type_very_safely("yes\n");
assert_screen("keyring_askpass_remember");
type_very_safely("sshpassword");
click_lastmatch;
assert_and_click("keyring_askpass_confirm");
}
# The connection should have been established if everything has worked
@ -105,7 +96,7 @@ sub run {
# Log in.
boot_to_login_screen();
dm_perform_login($desktop, $pass);
check_desktop;
check_desktop(timeout => 120);
# Reconnect without using password. We still should be
# able to log in.