summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-03 09:52:21 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-03 09:52:21 +0000
commit66b6179ec16788c7fb451d40071f30933c02752e (patch)
tree8294837e5d02598d89f2b43a8a49818a8744dcbc /test
parentbf1814d990bf3f328e864ba03f6ca20d97d3f225 (diff)
* test/ruby/test_io.rb (TestIO#test_advise): added workaround of fadvise(2)
with tmpfs and old linux kernel. [ruby-core:65355][Bug #10313] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index e12cf4adab..92f7f6b46f 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2486,7 +2486,15 @@ End
[[0,0], [0, 20], [400, 2]].each do |offset, len|
open(tf.path) do |t|
ret = assert_nothing_raised(lambda { os_and_fs(tf.path) }) {
- t.advise(adv, offset, len)
+ begin
+ t.advise(adv, offset, len)
+ rescue Errno::EINVAL
+ if /linux/ =~ RUBY_PLATFORM && (Etc.uname[:release].split('.').map(&:to_i) <=> [3,6]) < 0
+ next # [ruby-core:65355] tmpfs is not supported
+ else
+ retry
+ end
+ end
}
assert_nil(ret)
assert_raise(ArgumentError, "superfluous arguments") do