aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_bindfs.rb
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2014-05-10 12:37:38 +0100
committerMartin Pärtel <martin.partel@gmail.com>2014-05-10 12:37:38 +0100
commitdc0cf937e50ea1abb7ce439a011531ddb3bbda02 (patch)
tree222fbf368ca78c6ef67787c0790280ae3614b385 /tests/test_bindfs.rb
parent60fc1f3f085983aa3fbb74102c270be8de15f9e5 (diff)
downloadbindfs-dc0cf937e50ea1abb7ce439a011531ddb3bbda02.tar.gz
Use lutimes() when utimensat() unavailable (#6).
Diffstat (limited to 'tests/test_bindfs.rb')
-rwxr-xr-xtests/test_bindfs.rb25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index a1f1526..54521f0 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -370,22 +370,19 @@ root_testenv("", :title => "setgid directories") do
assert { File.stat('mnt/dir/file').gid == $nogroup_gid }
end
-# utimensat() unavailable on OS X
-unless RUBY_PLATFORM =~ /darwin/
- root_testenv("", :title => "utimens on symlinks") do
- touch('mnt/file')
- Dir.chdir "mnt" do
- system('ln -sf file link')
- end
+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?
+ 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
+ assert { File.lstat('mnt/link').atime.to_i < 50 }
+ 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.