summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-03 11:31:20 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-03 11:31:20 +0000
commit50522eb35172c4887b5a35919ebe8c52f00bfe71 (patch)
tree8c1a2e6b00db89c6b5826ae2b152dc16d4af3e6d
parent7ad29955a6afbe8ce03eeee376be2bfa792cd198 (diff)
* test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
Skip sticky bit test if the platform is FreeBSD. It doesn't allow to change sticky bit if a target is regular file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/fileutils/test_fileutils.rb15
2 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 626e5efd02..2665dc5ddc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue May 3 20:29:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * test/fileutils/test_fileutils.rb (TestFileUtils#test_chmod_symbol_mode):
+ Skip sticky bit test if the platform is FreeBSD. It doesn't allow to
+ change sticky bit if a target is regular file.
+
Tue May 3 18:23:57 2011 Yuki Sonoda (Yugui) <yugui@yugui.jp>
* test/date/test_date.rb (TestDate#test_coerce):
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 68f363109d..df07978b08 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -909,10 +909,17 @@ class TestFileUtils
assert_equal 04500, File.stat('tmp/a').mode & 07777
chmod "+s", 'tmp/a'
assert_equal 06500, File.stat('tmp/a').mode & 07777
- chmod "u+t,o+t", 'tmp/a'
- assert_equal 07500, File.stat('tmp/a').mode & 07777
- chmod "a-t,a-s", 'tmp/a'
- assert_equal 0500, File.stat('tmp/a').mode & 07777
+
+ # FreeBSD ufs and tmpfs don't allow to change sticky bit against
+ # regular file. It's slightly strange. Anyway it's no effect bit.
+ # see /usr/src/sys/ufs/ufs/ufs_chmod()
+ if /freebsd/ !~ RUBY_PLATFORM
+ chmod "u+t,o+t", 'tmp/a'
+ assert_equal 07500, File.stat('tmp/a').mode & 07777
+ chmod "a-t,a-s", 'tmp/a'
+ assert_equal 0500, File.stat('tmp/a').mode & 07777
+ end
+
end if have_file_perm?