ruby-changes:48029
From: kazu <ko1@a...>
Date: Mon, 9 Oct 2017 20:20:05 +0900 (JST)
Subject: [ruby-changes:48029] kazu:r60143 (trunk): Remove unused test files related `$SAFE>=2`
kazu 2017-10-09 20:20:00 +0900 (Mon, 09 Oct 2017) New Revision: 60143 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60143 Log: Remove unused test files related `$SAFE>=2` unused since r14024 Removed files: trunk/test/drb/ut_eval.rb Modified files: trunk/test/drb/drbtest.rb trunk/test/drb/test_drb.rb Index: test/drb/ut_eval.rb =================================================================== --- test/drb/ut_eval.rb (revision 60142) +++ test/drb/ut_eval.rb (nonexistent) @@ -1,37 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/drb/ut_eval.rb#L0 -# frozen_string_literal: false -require 'drb/drb' -require 'drb/extserv' - -module DRbTests - -class EvalAttack - def initialize - @four = DRb::DRbServer.new('druby://localhost:0', self, {:safe_level => 4}) - end - - def four - DRbObject.new_with_uri(@four.uri) - end - - def remote_class - DRbObject.new(self.class) - end -end - -end - - -if __FILE__ == $0 - def ARGV.shift - it = super() - raise "usage: #{$0} <uri> <name>" unless it - it - end - - $SAFE = 1 - - DRb.start_service('druby://localhost:0', DRbTests::EvalAttack.new, {:safe_level => 2}) - es = DRb::ExtServ.new(ARGV.shift, ARGV.shift) - DRb.thread.join - es.stop_service if es.alive? -end Property changes on: test/drb/ut_eval.rb ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: test/drb/test_drb.rb =================================================================== --- test/drb/test_drb.rb (revision 60142) +++ test/drb/test_drb.rb (revision 60143) @@ -240,55 +240,6 @@ class TestDRbSafe1 < TestDRbAry https://github.com/ruby/ruby/blob/trunk/test/drb/test_drb.rb#L240 end end -class TestDRbEval # < Test::Unit::TestCase - def setup - super - @ext = DRbService.ext_service('ut_eval.rb') - @there = @ext.front - end - - def teardown - @ext.stop_service if @ext - end - - def test_01_safe1_safe4_eval - assert_raise(SecurityError) do - @there.method_missing(:instance_eval, 'ENV.inspect') - end - - assert_raise(SecurityError) do - @there.method_missing(:send, :eval, 'ENV.inspect') - end - - remote_class = @there.remote_class - - assert_raise(SecurityError) do - remote_class.class_eval('ENV.inspect') - end - - assert_raise(SecurityError) do - remote_class.module_eval('ENV.inspect') - end - - four = @there.four - assert_equal(1, four.method_missing(:send, :eval, '1')) - - remote_class = four.remote_class - - assert_equal(1, remote_class.class_eval('1')) - - assert_equal(1, remote_class.module_eval('1')) - - assert_raise(SecurityError) do - remote_class.class_eval('ENV = {}') - end - - assert_raise(SecurityError) do - remote_class.module_eval('ENV = {}') - end - end -end - class TestDRbLarge < Test::Unit::TestCase include DRbBase Index: test/drb/drbtest.rb =================================================================== --- test/drb/drbtest.rb (revision 60142) +++ test/drb/drbtest.rb (revision 60143) @@ -15,7 +15,7 @@ class DRbService https://github.com/ruby/ruby/blob/trunk/test/drb/drbtest.rb#L15 DRb::ExtServManager.command[nm] = @@ruby + ["#{dir}/#{nm}"] end - %w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb ut_eq.rb).each do |nm| + %w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eq.rb).each do |nm| add_service_command(nm) end @server = @@server = DRb::DRbServer.new('druby://localhost:0', @@manager, {}) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/