зеркало из https://github.com/github/ruby.git
test setrlimit in a child process.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5610e5dc70
Коммит
af14ba145e
|
@ -107,8 +107,20 @@ class TestProcess < Test::Unit::TestCase
|
|||
def test_rlimit_value
|
||||
return unless rlimit_exist?
|
||||
assert_raise(ArgumentError) { Process.setrlimit(:CORE, :FOO) }
|
||||
assert_raise(Errno::EPERM, Errno::EINVAL) { Process.setrlimit(:NOFILE, :INFINITY) }
|
||||
assert_raise(Errno::EPERM, Errno::EINVAL) { Process.setrlimit(:NOFILE, "INFINITY") }
|
||||
with_tmpchdir do
|
||||
s = run_in_child(<<-'End')
|
||||
cur, max = Process.getrlimit(:NOFILE)
|
||||
Process.setrlimit(:NOFILE, max-10)
|
||||
Process.setrlimit(:NOFILE, :INFINITY) rescue exit 1
|
||||
End
|
||||
assert_not_equal(0, s.exitstatus)
|
||||
s = run_in_child(<<-'End')
|
||||
cur, max = Process.getrlimit(:NOFILE)
|
||||
Process.setrlimit(:NOFILE, max-10)
|
||||
Process.setrlimit(:NOFILE, "INFINITY") rescue exit 1
|
||||
End
|
||||
assert_not_equal(0, s.exitstatus)
|
||||
end
|
||||
end
|
||||
|
||||
TRUECOMMAND = [RUBY, '-e', '']
|
||||
|
|
Загрузка…
Ссылка в новой задаче