1
0
mirror of https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git synced 2024-12-11 05:43:11 +00:00
os-autoinst-distri-fedora/tests/applications/nautilus/permissions.pm

71 lines
1.9 KiB
Perl
Raw Normal View History

2022-02-10 09:29:17 +00:00
use base "installedtest";
use strict;
use testapi;
use utils;
# View and change file permissions.
sub run {
my $self = shift;
# Enter the Documents directory to get to the test data.
assert_and_click("nautilus_directory_documents");
2022-02-10 09:29:17 +00:00
# Rigth click onto a file to open context menu.
assert_and_click("nautilus_test_file", button => "right");
wait_still_screen(2);
2022-02-10 09:29:17 +00:00
# Click on the Properties menu item
assert_and_click("nautilus_context_properties");
wait_still_screen(2);
2022-02-10 09:29:17 +00:00
# Check that the Properties window has appeared and close it.
assert_screen("nautilus_properties_check");
send_key("esc");
# Ensure the file is selected and pane is active (or else
# shortcut may not work).
assert_and_click("nautilus_test_file");
2022-02-10 09:29:17 +00:00
# Send a key combination to open the Properties again.
send_key("ctrl-i");
2022-02-10 09:29:17 +00:00
# Check that the Properties window has appeared again.
assert_screen("nautilus_properties_check");
2022-02-10 09:29:17 +00:00
# Click on the Permissions tab
assert_and_click("nautilus_select_permissions");
2022-02-10 09:29:17 +00:00
# Check that the owner can read and write the file
assert_screen("nautilus_owner_permissions");
2022-02-10 09:29:17 +00:00
# Check that others cannot do anything.
assert_screen("nautilus_others_permissions");
2022-02-10 09:29:17 +00:00
# Set the permission for others to None
assert_and_click("nautilus_permissions_read_only");
2022-02-10 09:29:17 +00:00
# Click on Read Only to select it.
assert_and_click("nautilus_permissions_set_none");
2022-02-10 09:29:17 +00:00
# Close the Properties
send_key("esc");
2022-02-10 09:29:17 +00:00
# Go into the root console and verify the operation in the background.
$self->root_console(tty => 3);
2022-02-10 09:29:17 +00:00
# Check that the permissions have been changed.
validate_script_output("ls -l /home/test/Documents/markdown.md", sub { m/-rw-r-----/ });
}
sub test_flags {
# Rollback to the previous state to make space for other parts.
return {always_rollback => 1};
}
1;