diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-10 02:58:23 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-10 02:58:23 +0000 |
commit | 2d054e4088982be3266d16dd42a913c7a0884120 (patch) | |
tree | 299f0b658d7bf26eb345990c3eeba77094de2bcc /test | |
parent | 428687e96d9e58c13ebcbbfb4411f1edba71fcc5 (diff) |
merge revision(s) 59322,59325: [Backport #13744]
process.c: handle dynamic :rlimit_* symbols in spawn execopts
* process.c (rb_execarg_addopt_rlimit): hoist out of rb_execarg_addopt
(rlimit_type_by_sym): new wrapper for dynamic symbol
(rb_execarg_addopt): check for dsym via rlimit_type_by_sym
* test/ruby/test_process.rb (test_execopts_rlimit): check dsym w/o pindown
Add extra check for bogus rlimit args, too.
[ruby-core:82033] [Bug #13744]
process.c: null bytes
* process.c (rlimit_type_by_sym): prohibit null bytes in key
names. [ruby-core:82033] [Bug #13744]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_process.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index cd45bde99d..f3d02f3bee 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -242,6 +242,22 @@ class TestProcess < Test::Unit::TestCase :rlimit_core=>n, :rlimit_cpu=>3600]) {|io| assert_equal("[#{n}, #{n}]\n[3600, 3600]", io.read.chomp) } + + assert_raise(ArgumentError) do + system(RUBY, '-e', 'exit', 'rlimit_bogus'.to_sym => 123) + end + assert_separately([],<<-"end;") # [ruby-core:82033] [Bug #13744] + assert(system("#{RUBY}", "-e", + "exit([3600,3600] == Process.getrlimit(:CPU))", + 'rlimit_cpu'.to_sym => 3600)) + assert_raise(ArgumentError) do + system("#{RUBY}", '-e', 'exit', :rlimit_bogus => 123) + end + end; + + assert_raise(ArgumentError, /rlimit_cpu/) { + system(RUBY, '-e', 'exit', "rlimit_cpu\0".to_sym => 3600) + } end MANDATORY_ENVS = %w[RUBYLIB] |