ruby-changes:57680
From: Yusuke <ko1@a...>
Date: Mon, 9 Sep 2019 20:28:25 +0900 (JST)
Subject: [ruby-changes:57680] cce6cfbe48 (master): Make test-all and test-spec runnable on Android
https://git.ruby-lang.org/ruby.git/commit/?id=cce6cfbe48 From cce6cfbe486984c2c41d6b772a692ea87ad0222a Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Mon, 9 Sep 2019 20:24:03 +0900 Subject: Make test-all and test-spec runnable on Android Calling some syscall functions such as Dir.chroot causes SIGSYS instead of EPERM on Android. This change skips all tests that stops the test-suite run. diff --git a/spec/ruby/core/dir/chroot_spec.rb b/spec/ruby/core/dir/chroot_spec.rb index 5539241..a5ca894 100644 --- a/spec/ruby/core/dir/chroot_spec.rb +++ b/spec/ruby/core/dir/chroot_spec.rb @@ -9,7 +9,7 @@ platform_is_not :windows do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/dir/chroot_spec.rb#L9 end end - platform_is_not :cygwin do + platform_is_not :cygwin, :android do as_user do describe "Dir.chroot as regular user" do before :all do diff --git a/spec/ruby/core/process/groups_spec.rb b/spec/ruby/core/process/groups_spec.rb index 6b91757..cbbe4fe 100644 --- a/spec/ruby/core/process/groups_spec.rb +++ b/spec/ruby/core/process/groups_spec.rb @@ -14,7 +14,7 @@ describe "Process.groups" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/groups_spec.rb#L14 end describe "Process.groups=" do - platform_is_not :windows do + platform_is_not :windows, :android do as_superuser do it "sets the list of gids of groups in the supplemental group access list" do groups = Process.groups diff --git a/spec/ruby/core/process/initgroups_spec.rb b/spec/ruby/core/process/initgroups_spec.rb index 1dd516d..ffc7f28 100644 --- a/spec/ruby/core/process/initgroups_spec.rb +++ b/spec/ruby/core/process/initgroups_spec.rb @@ -1,7 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/initgroups_spec.rb#L1 require_relative '../../spec_helper' describe "Process.initgroups" do - platform_is_not :windows do + platform_is_not :windows, :android do as_user do it "initializes the supplemental group access list" do name = `id -un`.strip diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index 4aaa55e..d6fc44a 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -10,6 +10,13 @@ case RUBY_PLATFORM https://github.com/ruby/ruby/blob/trunk/test/fiddle/helper.rb#L10 when /cygwin/ libc_so = "cygwin1.dll" libm_so = "cygwin1.dll" +when /android/ + libdir = '/system/lib' + if [0].pack('L!').size == 8 + libdir = '/system/lib64' + end + libc_so = File.join(libdir, "libc.so") + libm_so = File.join(libdir, "libm.so") when /linux/ libdir = '/lib' case [0].pack('L!').size diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 076a73e..eaecc52 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -789,6 +789,7 @@ class TestPathname < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L789 end def test_birthtime + skip if RUBY_PLATFORM =~ /android/ # Check under a (probably) local filesystem. # Remote filesystems often may not support birthtime. with_tmpchdir('rubytest-pathname') do |dir| diff --git a/test/ruby/test_dir.rb b/test/ruby/test_dir.rb index 75cae71..1bb228f 100644 --- a/test/ruby/test_dir.rb +++ b/test/ruby/test_dir.rb @@ -122,6 +122,7 @@ class TestDir < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_dir.rb#L122 end def test_chroot_nodir + skip if RUBY_PLATFORM =~ /android/ assert_raise(NotImplementedError, Errno::ENOENT, Errno::EPERM ) { Dir.chroot(File.join(@nodir, "")) } end diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index 33ed73d..2a5a860 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -642,6 +642,7 @@ class TestFileExhaustive < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_file_exhaustive.rb#L642 end def test_birthtime + skip if RUBY_PLATFORM =~ /android/ [regular_file, utf8_file].each do |file| t1 = File.birthtime(file) t2 = File.open(file) {|f| f.birthtime} diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 83c9c6a..d1814a8 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1583,6 +1583,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1583 end def test_setegid + skip "root can use Process.egid on Android platform" if RUBY_PLATFORM =~ /android/ assert_nothing_raised(TypeError) {Process.egid += 0} rescue NotImplementedError end @@ -1871,6 +1872,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1872 end def test_execopts_uid + skip "root can use uid option of Kernel#system on Android platform" if RUBY_PLATFORM =~ /android/ feature6975 = '[ruby-core:47414]' [30000, [Process.uid, ENV["USER"]]].each do |uid, user| @@ -1902,6 +1904,7 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L1904 def test_execopts_gid skip "Process.groups not implemented on Windows platform" if windows? + skip "root can use Process.groups on Android platform" if RUBY_PLATFORM =~ /android/ feature6975 = '[ruby-core:47414]' groups = Process.groups.map do |g| -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/