summaryrefslogtreecommitdiff
path: root/test/drb
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-09 11:20:00 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-09 11:20:00 +0000
commit310e91f505b6d1658fde8beb17861180aedca6c8 (patch)
tree058ff16529f02a7b77e1b2d7d06fadadc101efe5 /test/drb
parent11b147ece9b3648434ab9ec1d90232cc169167b0 (diff)
Remove unused test files related `$SAFE>=2`
unused since r14024 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/drb')
-rw-r--r--test/drb/drbtest.rb2
-rw-r--r--test/drb/test_drb.rb49
-rw-r--r--test/drb/ut_eval.rb37
3 files changed, 1 insertions, 87 deletions
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index cc7063c39e1..2796100280b 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -15,7 +15,7 @@ class DRbService
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, {})
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index ec9d306290d..52e79ea496e 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -240,55 +240,6 @@ class TestDRbSafe1 < TestDRbAry
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
diff --git a/test/drb/ut_eval.rb b/test/drb/ut_eval.rb
deleted file mode 100644
index 0a81b40b0ef..00000000000
--- a/test/drb/ut_eval.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# 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