From 189a8d53fa68f0a630ce671fa2ddcccc15588441 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Mon, 23 Sep 2013 23:57:51 +0300 Subject: Implement fuse_utimens instead of fuse_utime. Fixes utime'ing symlinks. Seems to also fix an attribute caching problem. --- tests/test_bindfs.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/test_bindfs.rb') diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb index f8a9d89..6e95020 100755 --- a/tests/test_bindfs.rb +++ b/tests/test_bindfs.rb @@ -371,6 +371,21 @@ root_testenv("", :title => "setgid directories") do assert { File.stat('mnt/dir/file').gid == $nogroup_gid } end +root_testenv("", :title => "utimens on symlinks") do + touch('mnt/file') + Dir.chdir "mnt" do + system('ln -sf file link') + end + + system("#{$tests_dir}/utimens_nofollow mnt/link 12 34 56 78") + raise "Failed to run utimens_nofollow: #{$?.inspect}" unless $?.success? + + assert { File.lstat('mnt/link').atime.to_i < 100 } + assert { File.lstat('mnt/link').mtime.to_i < 100 } + assert { File.lstat('mnt/file').atime.to_i > 100 } + assert { File.lstat('mnt/file').mtime.to_i > 100 } +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. if Process.uid == 0 -- cgit v1.2.3