diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-10 08:08:22 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-10 08:08:22 +0000 |
commit | ba7c9b1cf7681d56e25d67b54bfaee9331aab723 (patch) | |
tree | 0d3b7b3b5ceb664ea55aede4d2219722078f0dfc | |
parent | f784e14fcea519a707c9ec3b5716f59b491c75cd (diff) | |
download | ruby-ba7c9b1cf7681d56e25d67b54bfaee9331aab723.tar.gz |
Test both username and uid
* system(, uid: ) takes username or uid
* ENV["USER"] may be nil (sudo or jail)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_process.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index e6f18a6d81..d65c1cc10e 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1482,9 +1482,18 @@ class TestProcess < Test::Unit::TestCase feature6975 = '[ruby-core:47414]' [30000, [ENV["USER"], Process.uid]].each do |user, uid| + if user + assert_nothing_raised(feature6975) do + begin + system(*TRUECOMMAND, uid: user) + rescue Errno::EPERM, NotImplementedError + end + end + end + assert_nothing_raised(feature6975) do begin - system(*TRUECOMMAND, uid: user) + system(*TRUECOMMAND, uid: uid) rescue Errno::EPERM, NotImplementedError end end |