aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2019-06-26 11:41:46 +0300
committerMartin Pärtel <martin.partel@gmail.com>2019-06-26 11:41:46 +0300
commit74427b94fcf53b3a3c4c87b26051a55c69aac093 (patch)
treed126cc92a676178d293e3a1b87f600c866f367bd /tests
parentacca303e4b603614afb51552d38da6de9213be29 (diff)
downloadbindfs-74427b94fcf53b3a3c4c87b26051a55c69aac093.tar.gz
Resolve symlinks in readdir() so correct attributes are returned.
Fixes #76
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_bindfs.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index bfc6d64..1a407a1 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -635,6 +635,22 @@ nonroot_testenv("--resolve-symlinks --resolved-symlink-deletion=target-first -p
end
end
+testenv("--resolve-symlinks", :title => "resolving broken symlinks") do
+ Dir.chdir 'src' do
+ symlink('dir', 'dirlink')
+ symlink('dir/file', 'filelink')
+ end
+
+ assert { File.lstat('mnt/dirlink').symlink? }
+ assert { File.lstat('mnt/filelink').symlink? }
+
+ File.unlink('mnt/filelink')
+ assert { !File.exist?('mnt/filelink') }
+
+ File.unlink('mnt/dirlink')
+ assert { !File.exist?('mnt/dirlink') }
+end
+
# Issue #28 reproduction attempt.
testenv("", :title => "many files in a directory") do
mkdir('src/dir')