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;
|
2022-07-28 20:32:57 +00:00
|
|
|
|
|
|
|
# Enter the Documents directory to get to the test data.
|
2022-07-23 00:17:59 +00:00
|
|
|
assert_and_click("nautilus_directory_documents");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
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-07-28 20:32:57 +00:00
|
|
|
|
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-07-28 20:32:57 +00:00
|
|
|
|
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");
|
2022-07-23 00:24:43 +00:00
|
|
|
|
|
|
|
# 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-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Check that the Properties window has appeared again.
|
|
|
|
assert_screen("nautilus_properties_check");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Click on the Permissions tab
|
|
|
|
assert_and_click("nautilus_select_permissions");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Check that the owner can read and write the file
|
|
|
|
assert_screen("nautilus_owner_permissions");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Check that others cannot do anything.
|
|
|
|
assert_screen("nautilus_others_permissions");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Set the permission for others to None
|
|
|
|
assert_and_click("nautilus_permissions_read_only");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Click on Read Only to select it.
|
|
|
|
assert_and_click("nautilus_permissions_set_none");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Close the Properties
|
|
|
|
send_key("esc");
|
2022-07-28 20:32:57 +00:00
|
|
|
|
2022-02-10 09:29:17 +00:00
|
|
|
# Go into the root console and verify the operation in the background.
|
2022-07-28 20:32:57 +00:00
|
|
|
$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;
|
|
|
|
|
|
|
|
|
|
|
|
|