Save progress on keyring.

This commit is contained in:
Lukáš Růžička 2024-04-09 11:24:29 +02:00
parent ef49ce4cc4
commit 67f1a6d073
4 changed files with 78 additions and 42 deletions

View File

@ -13,11 +13,15 @@ use utils;
sub run {
my $self = shift;
my $desktop = get_var("DESKTOP");
# Switch to console
$self->root_console(tty => 3);
# We install the FTP server's package.
# We install the necessary packages.
assert_script_run("dnf -y install pure-ftpd");
if ($desktop eq "gnome") {
assert_script_run("dnf -y install seahorse");
}
# Download the configuration file for FTP and unpack it.
download_testdata("configuration");
@ -28,7 +32,7 @@ sub run {
# Set up the system.
# Add a group for the FTP and the user that will own the FTP stuff
assert_script_run("groupadd ftpusers");
assert_script_run("useradd --system -g ftpusers -d /dev/null -s /sbin/nologin ftpuser");
assert_script_run("useradd -g ftpusers -d /dev/null -s /sbin/nologin ftpuser");
# Create a directory to hold the FTP content, set rights and create the content.
assert_script_run("mkdir /ftpdata");
assert_script_run("chown -R ftpuser:ftpusers /ftpdata");

View File

@ -13,24 +13,44 @@ use utils;
sub run {
my $self = shift;
assert_and_click("keyring_open_network");
assert_and_click("keyring_add_network_folder");
assert_and_click("keyring_select_ftp");
assert_and_click("kde_button_next");
type_very_safely("FTPConnect");
send_key("tab");
type_very_safely("tucnak");
send_key("tab");
type_very_safely("127.0.0.1");
assert_and_click("keyring_save_connect");
type_very_safely("weakpassword");
assert_and_click("keyring_reveal_password");
assert_and_click("keyring_remember_password");
assert_and_click("kde_button_ok");
assert_and_click("keyring_open_location");
send_key("ret");
assert_screen("keyring_test_file");
send_key("alt-f4");
my $desktop = get_var("DESKTOP");
if ($desktop eq "kde") {
# The Dolphin application is already started, so we begin
# with clicking on Network to open the network folders.
# We want to add a new connection and go through the
# password addition process.
assert_and_click("keyring_open_network");
assert_and_click("keyring_add_network_folder");
assert_and_click("keyring_select_ftp");
assert_and_click("kde_button_next");
# We will set up the connection.
type_very_safely("FTPConnect");
send_key("tab");
type_very_safely("tucnak");
send_key("tab");
type_very_safely("127.0.0.1");
assert_and_click("keyring_save_connect");
# Type password to connect
type_very_safely("weakpassword");
# Reveal it so that we can check it is correctly
# written, when there are failures because of that
# (I have seen a couple of mistypes during development).
assert_and_click("keyring_reveal_password");
assert_and_click("keyring_remember_password");
assert_and_click("kde_button_ok");
# We have added the network location and an icon
# has been created to access it. Click on that icon.
assert_and_click("keyring_open_location");
# While double click would sometimes fail here, we
# want to confirm opening the icon using the
# Enter key.
send_key("ret");
# Check that we have opened the location and that
# we can see the FTP content.
assert_screen("keyring_test_file");
# Close the application.
send_key("alt-f4");
}
}
sub test_flags {

View File

@ -4,26 +4,31 @@ use testapi;
use utils;
# This script will check that the password has been added
# to the system keyring.
# to the system keyring. We will start a wallet application
# and check that the password is listed in that application.
sub run {
my $self = shift;
menu_launch_type("kwalletmanager");
assert_screen("kwalletmanager_runs");
send_key("super-pgup");
assert_and_dclick("keyring_passwords_unfold");
assert_and_dclick("keyring_maps_unfold");
assert_and_click("keyring_ftp_localhost");
assert_and_click("keyring_show_values");
assert_screen("keyring_keys_values");
my $desktop = get_var("DESKTOP");
if ($desktop eq "kde") {
# Start the KDE wallet application and maximize it.
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_passwords_unfold");
assert_and_dclick("keyring_maps_unfold");
assert_and_click("keyring_ftp_localhost");
assert_and_click("keyring_show_values");
assert_screen("keyring_keys_values");
}
# Reboot the machine.
$self->root_console( tty => 3 );
enter_cmd("reboot");
}
sub test_flags {

View File

@ -11,25 +11,32 @@ use utils;
sub run {
my $self = shift;
my $pw = get_var("USER_PASSWORD") // "weakpassword";
my $desktop = get_var("DESKTOP");
my $app = "files";
if (get_var("DESKTOP") eq "kde") {
my $key = "up";
if ($desktop eq "kde") {
$app = "dolphin";
$key = "pgup";
}
# Check that the machine has been rebooted
# and log in.
boot_to_login_screen();
send_key("ret") if (get_var("DESKTOP") eq "gnome");
type_very_safely("$pw\n");
wait_still_screen(5);
# Start the file exploring application
menu_launch_type($app);
send_key("super-$key");
send_key("super-pgup");
assert_and_click("keyring_open_network");
assert_and_click("keyring_open_location");
send_key("ret");
assert_screen("keyring_test_file");
send_key("alt-f4");
if ($desktop eq "kde") {
# Open the network location and check
# that the FTP content is accessible.
assert_and_click("keyring_open_network");
assert_and_click("keyring_open_location");
send_key("ret");
assert_screen("keyring_test_file");
}
}
sub test_flags {