aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_bindfs.rb
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2012-01-25 05:48:42 +0200
committerMartin Pärtel <martin.partel@gmail.com>2012-01-25 05:48:42 +0200
commit8ae697b6d483e5211f86de770c7000b5cedec7e6 (patch)
treefacf67ce8f9c061cb1d7b07ec71c55b51f7dd94c /tests/test_bindfs.rb
parent473faadb80c962ce629f88f640b587ea965e5343 (diff)
downloadbindfs-8ae697b6d483e5211f86de770c7000b5cedec7e6.tar.gz
Added option --realistic-permissions.
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-xtests/test_bindfs.rb19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index ea2e7e2..f184880 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
-# Copyright 2006,2007,2008,2009,2010 Martin Pärtel <martin.partel@gmail.com>
+# Copyright 2006,2007,2008,2009,2010,2012 Martin Pärtel <martin.partel@gmail.com>
#
# This file is part of bindfs.
#
@@ -80,6 +80,23 @@ testenv("--create-with-perms=og=r:ogd+x") do
assert { File.stat('mnt/dir').mode & 0077 == 0055 }
end
+testenv("-p 0777 --realistic-permissions", :title => '--realistic-permissions') do
+ touch('src/noexecfile')
+ touch('src/execfile')
+ chmod(0600, 'src/noexecfile')
+ chmod(0700, 'src/execfile')
+
+ assert { File.stat('mnt/noexecfile').mode & 0777 == 0666 }
+ assert { File.stat('mnt/execfile').mode & 0777 == 0777 }
+end
+
+testenv("-p 0777", :title => '--realistic-permissions not the default') do
+ touch('src/noexecfile')
+ chmod(0600, 'src/noexecfile')
+
+ assert { File.stat('mnt/noexecfile').mode & 0777 == 0777 }
+end
+
testenv("--ctime-from-mtime") do
sf = 'src/file'
mf = 'mnt/file'