aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2021-02-13 05:00:21 +0200
committerMartin Pärtel <martin.partel@gmail.com>2021-02-13 05:00:21 +0200
commit2cf41a75c11472bd6737b48c61f0a3d30cd6f242 (patch)
treeb0481d219ddbb8d6d97604026eed5fa8811d4aa2 /tests
parent8333d5e4408021a2c668e6a159eec19d43e2472c (diff)
downloadbindfs-2cf41a75c11472bd6737b48c61f0a3d30cd6f242.tar.gz
filter_special_opts: added test case
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_bindfs.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 69a5e70..49f2332 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -18,6 +18,8 @@
# along with bindfs. If not, see <http://www.gnu.org/licenses/>.
#
+Dir.chdir(File.dirname(__FILE__))
+
# if we are being run by make check it will set srcdir and we should use it
$LOAD_PATH << (ENV['srcdir'] || '.')
@@ -892,6 +894,14 @@ if `uname`.strip != 'FreeBSD' # -o dev is not supported on FreeBSD
end
end
+# PR #95
+testenv("-ouser -onofail,nouser,delete-deny -o users -o auto,rename-deny,noauto -o chmod-deny,_netdev", :title => "filtering special options") do
+ touch('src/file')
+ assert_exception(EPERM) { rm('mnt/file') }
+ assert_exception(EPERM) { File.rename('mnt/file', 'mnt/file2') }
+ assert_exception(EPERM) { chmod(0777, 'mnt/file') }
+end
+
# FIXME: this stuff around testenv is a hax, and testenv may also exit(), which defeats the 'ensure' below.
# the test setup ought to be refactored. It might well use MiniTest or something.
# TODO: support FreeBSD in this test (different group management commands)