Finish the KDE stuff without code comments.

This commit is contained in:
Lukáš Růžička 2024-04-08 17:23:14 +02:00
parent fdba636913
commit ef49ce4cc4
4 changed files with 87 additions and 6 deletions

View File

@ -26,24 +26,29 @@ sub run {
assert_script_run("chmod 644 /etc/pure-ftpd/pure-ftpd.conf");
# 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 -g ftpusers -d /dev/null -s /sbin/nologin ftpuser");
assert_script_run("useradd --system -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");
assert_script_run("echo 'This is a test file' > /ftpdata/testfile.txt");
# Enable the FTP service in the firewall.
assert_script_run("firewall-cmd --add-service=ftp --permanent");
assert_script_run("firewall-cmd --reload");
# Set up the FTP server.
# Create a virtual FTP user called tucnak.
enter_cmd("pure-pw useradd tucnak -u ftpuser -g ftpusers -d /ftpdata");
sleep(2);
# Set its password, wait between attempts so that the system has time
# to react to the input.
type_string("weakpassword\n"); # To pass the password entry.
sleep(2);
type_string("weakpassword\n");
sleep(2);
# Create the database.
# Create PureFTP database to the settings.
assert_script_run("pure-pw mkdb");
# Check that the settings are done correctly
assert_script_run("pure-pw list | egrep 'tucnak\\s+/ftpdata'");
assert_script_run("pure-pw show tucnak");
@ -57,7 +62,8 @@ sub run {
# Return to desktop
desktop_vt();
# Start the file explorer application.
# Start the file explorer application based on what system we are
# running, Gnome or KDE.
my $app = "nautilus";
my $key = "up";
if (get_var("DESKTOP") eq "kde") {
@ -65,7 +71,6 @@ sub run {
$key = "pgup";
}
menu_launch_type($app);
send_key("super-$key");
wait_still_screen(3);
# Check that it has started
@ -75,7 +80,6 @@ sub run {
else {
assert_screen("apps_run_files");
}
}
sub test_flags {

View File

@ -24,6 +24,7 @@ sub run {
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");

View File

@ -0,0 +1,35 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will check that the password has been added
# to the system keyring.
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");
$self->root_console( tty => 3 );
enter_cmd("reboot");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et:

View File

@ -0,0 +1,41 @@
use base "installedtest";
use strict;
use testapi;
use utils;
# This script will open the File application and attempt
# to reconnect to the FTP server, this time without
# having to put credentials into the process.
sub run {
my $self = shift;
my $pw = get_var("USER_PASSWORD") // "weakpassword";
my $app = "files";
if (get_var("DESKTOP") eq "kde") {
$app = "dolphin";
}
boot_to_login_screen();
send_key("ret") if (get_var("DESKTOP") eq "gnome");
type_very_safely("$pw\n");
wait_still_screen(5);
menu_launch_type($app);
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");
}
sub test_flags {
return {fatal => 1, milestone => 1};
}
1;
# vim: set sw=4 et: