summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-26 05:31:22 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-26 05:31:22 +0000
commit1df30008b2461c930a3fb8a8d887f54e403f8379 (patch)
tree7e717789f6ba45f40ae8c5b5ca35345823a2e6c7 /test
parentb8d28b33b4df47f53d78b2f5587a72429cda3d91 (diff)
test/ruby/test_process.rb (test_execopts_uid): rescue Errno::EACCES
The tests fail under the following condition: * executed as a root * the code is in a directory that uid:30000 user cannot access (e.g., /root) So, this change rescues Errno::EACCES explicitly. Also, this change adds `exception: true` to `Kernel#system` calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66568 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 7911a0cb20..c3ee401a28 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -1871,16 +1871,16 @@ class TestProcess < Test::Unit::TestCase
if user
assert_nothing_raised(feature6975) do
begin
- system(*TRUECOMMAND, uid: user)
- rescue Errno::EPERM, NotImplementedError
+ system(*TRUECOMMAND, uid: user, exception: true)
+ rescue Errno::EPERM, Errno::EACCES, NotImplementedError
end
end
end
assert_nothing_raised(feature6975) do
begin
- system(*TRUECOMMAND, uid: uid)
- rescue Errno::EPERM, NotImplementedError
+ system(*TRUECOMMAND, uid: uid, exception: true)
+ rescue Errno::EPERM, Errno::EACCES, NotImplementedError
end
end
@@ -1888,7 +1888,7 @@ class TestProcess < Test::Unit::TestCase
begin
u = IO.popen([RUBY, "-e", "print Process.uid", uid: user||uid], &:read)
assert_equal(uid.to_s, u, feature6975)
- rescue Errno::EPERM, NotImplementedError
+ rescue Errno::EPERM, Errno::EACCES, NotImplementedError
end
end
end