diff options
author | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-06 16:43:50 +0000 |
---|---|---|
committer | odaira <odaira@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-06 16:43:50 +0000 |
commit | 94bee146fad8508e18db8e3adfa363d0ba718a51 (patch) | |
tree | 100d607a59fb936647b854bfb8fb6103f5709049 | |
parent | e7c3c7e849e8d30b95ffe46200adfa02a27b1f08 (diff) | |
download | ruby-94bee146fad8508e18db8e3adfa363d0ba718a51.tar.gz |
* test/ruby/test_process.rb (test_execopts_gid): Skip a test
that is known to fail on AIX. AIX allows setgid to
a supplementary group, but Ruby does not allow the "-e"
option when setgid'ed, so the test does not work as intended.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 11 |
2 files changed, 17 insertions, 1 deletions
@@ -1,3 +1,10 @@ +Mon Mar 7 01:38:41 2016 Rei Odaira <Rei.Odaira@gmail.com> + + * test/ruby/test_process.rb (test_execopts_gid): Skip a test + that is known to fail on AIX. AIX allows setgid to + a supplementary group, but Ruby does not allow the "-e" + option when setgid'ed, so the test does not work as intended. + Sun Mar 6 22:43:41 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (rb_obj_display): [DOC] fix output of Array, as Array#to_s diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 274492674f..8d6274adf3 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1,3 +1,4 @@ +# coding: utf-8 # frozen_string_literal: false require 'test/unit' require 'tempfile' @@ -1812,7 +1813,15 @@ class TestProcess < Test::Unit::TestCase assert_nothing_raised(feature6975) do begin g = IO.popen([RUBY, "-e", "print Process.gid", gid: group], &:read) - assert_equal(gid, g, feature6975) + # AIX allows a non-root process to setgid to its supplementary group, + # while other UNIXes do not. (This might be AIX's violation of the POSIX standard.) + # However, Ruby does not allow a setgid'ed Ruby process to use the -e option. + # As a result, the Ruby process invoked by "IO.popen([RUBY, "-e", ..." above fails + # with a message like "no -e allowed while running setgid (SecurityError)" to stderr, + # the exis status is set to 1, and the variable "g" is set to an empty string. + # To conclude, on AIX, if the "gid" variable is a supplementary group, + # the assert_equal next can fail, so skip it. + assert_equal(gid, g, feature6975) unless $?.exitstatus == 1 && /aix/ =~ RUBY_PLATFORM && gid != Process.gid rescue Errno::EPERM, NotImplementedError end end |