aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_bindfs.rb
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2017-11-30 12:28:57 +0200
committerMartin Pärtel <martin.partel@gmail.com>2017-11-30 12:28:57 +0200
commitb5c97861a3b71e3e5391bf2d2458fdff845a19fe (patch)
treee3b054d490d27fa52238fac039a9a304fc7bf707 /tests/test_bindfs.rb
parentcb7a9dc70f740ef344029b540af8bb71fe99ddd0 (diff)
downloadbindfs-b5c97861a3b71e3e5391bf2d2458fdff845a19fe.tar.gz
Cleaned up PR #61.
For consistency, renamed the new options to --delete-deny and --rename-deny.
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-xtests/test_bindfs.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index d3f54b9..33eaaa4 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -293,6 +293,20 @@ testenv("--chmod-filter=g-w,o-rwx") do
assert { File.stat('src/file').mode & 0777 == 0640 }
end
+testenv("--delete-deny") do
+ touch('src/file')
+ mkdir('src/dir')
+ assert_exception(EPERM) { rm('mnt/file') }
+ assert_exception(EPERM) { rmdir('mnt/dir') }
+end
+
+testenv("--rename-deny") do
+ touch('src/file')
+ mkdir('src/dir')
+ assert_exception(EPERM) { mv('mnt/file', 'mnt/file2') }
+ assert_exception(EPERM) { mv('mnt/dir', 'mnt/dir2') }
+end
+
root_testenv("--map=nobody/root:@#{nobody_group}/@#{root_group}") do
touch('src/file')
chown('nobody', nobody_group, 'src/file')