From 2cf41a75c11472bd6737b48c61f0a3d30cd6f242 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Sat, 13 Feb 2021 05:00:21 +0200 Subject: filter_special_opts: added test case --- tests/test_bindfs.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') 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 . # +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) -- cgit v1.2.3