summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--test/drb/drbtest.rb8
-rw-r--r--test/drb/ignore_test_drb.rb3
-rw-r--r--test/drb/test_acl.rb4
-rw-r--r--test/drb/test_drb.rb4
-rw-r--r--test/drb/test_drbssl.rb4
-rw-r--r--test/drb/test_drbunix.rb4
-rw-r--r--test/drb/ut_array_drbssl.rb10
-rw-r--r--test/drb/ut_drb.rb6
-rw-r--r--test/drb/ut_drb_drbssl.rb12
-rw-r--r--test/drb/ut_drb_drbunix.rb2
-rw-r--r--test/drb/ut_eq.rb7
-rw-r--r--test/drb/ut_eval.rb6
-rw-r--r--test/drb/ut_large.rb6
-rw-r--r--test/drb/ut_timerholder.rb6
15 files changed, 72 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 318ee9a9f0a..fda1138278c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Jun 1 12:05:10 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/drb: Wrap tests definitions by DRbTests module. This makes
+ several tests (ACLEntryTest, TestBug4409, etc.) easier to understand
+ that they are tests for DRb.
+
Sun Jun 1 11:36:25 2014 Tanaka Akira <akr@fsij.org>
* lib/rinda/ring.rb (RingFinger#make_socket): Close the socket on
diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb
index d0e859d56ac..28ad288478b 100644
--- a/test/drb/drbtest.rb
+++ b/test/drb/drbtest.rb
@@ -5,6 +5,8 @@ require 'timeout'
require 'shellwords'
require_relative '../ruby/envutil'
+module DRbTests
+
class DRbService
@@manager = DRb::ExtServManager.new
@@ruby = Shellwords.escape(EnvUtil.rubybin)
@@ -138,11 +140,11 @@ module DRbCore
def test_02_unknown
obj = @there.unknown_class
assert_kind_of(DRb::DRbUnknown, obj)
- assert_equal('Unknown2', obj.name)
+ assert_equal('DRbTests::Unknown2', obj.name)
obj = @there.unknown_module
assert_kind_of(DRb::DRbUnknown, obj)
- assert_equal('DRbEx::', obj.name)
+ assert_equal('DRbTests::DRbEx::', obj.name)
assert_raise(DRb::DRbUnknownError) do
@there.unknown_error
@@ -364,3 +366,5 @@ module DRbAry
EOS
end
+
+end
diff --git a/test/drb/ignore_test_drb.rb b/test/drb/ignore_test_drb.rb
index 217c1c3f6b2..8b946505341 100644
--- a/test/drb/ignore_test_drb.rb
+++ b/test/drb/ignore_test_drb.rb
@@ -1,5 +1,7 @@
require 'drbtest'
+module DRbTests
+
class TestDRbReusePort < Test::Unit::TestCase
include DRbAry
@@ -8,3 +10,4 @@ class TestDRbReusePort < Test::Unit::TestCase
end
end
+end
diff --git a/test/drb/test_acl.rb b/test/drb/test_acl.rb
index 7fe30f4c4ac..a1ee1d48c53 100644
--- a/test/drb/test_acl.rb
+++ b/test/drb/test_acl.rb
@@ -7,6 +7,8 @@
require 'test/unit'
require 'drb/acl'
+module DRbTests
+
class SampleHosts
def initialize
list = %w(127.0.0.1 localhost
@@ -192,4 +194,4 @@ class ACLTest < Test::Unit::TestCase
end
end
-
+end
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index 573818558a5..7df9ba52c25 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -1,5 +1,7 @@
require_relative 'drbtest'
+module DRbTests
+
class TestDRbCore < Test::Unit::TestCase
include DRbCore
@@ -320,3 +322,5 @@ class TestBug4409 < Test::Unit::TestCase
assert(@there.foo?(foo))
end
end
+
+end
diff --git a/test/drb/test_drbssl.rb b/test/drb/test_drbssl.rb
index a54e2234ba0..79bc35f8cb2 100644
--- a/test/drb/test_drbssl.rb
+++ b/test/drb/test_drbssl.rb
@@ -5,6 +5,8 @@ begin
rescue LoadError
end
+module DRbTests
+
if Object.const_defined?("OpenSSL")
@@ -60,3 +62,5 @@ end
end
+
+end
diff --git a/test/drb/test_drbunix.rb b/test/drb/test_drbunix.rb
index ffc09e25b3e..e20625e70d3 100644
--- a/test/drb/test_drbunix.rb
+++ b/test/drb/test_drbunix.rb
@@ -5,6 +5,8 @@ begin
rescue LoadError
end
+module DRbTests
+
if Object.const_defined?("UNIXServer")
@@ -44,3 +46,5 @@ end
end
+
+end
diff --git a/test/drb/ut_array_drbssl.rb b/test/drb/ut_array_drbssl.rb
index a56695dcd1e..fa9afa6abd5 100644
--- a/test/drb/ut_array_drbssl.rb
+++ b/test/drb/ut_array_drbssl.rb
@@ -9,7 +9,9 @@ if __FILE__ == $0
it
end
- TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_
+ module DRbTests
+
+ TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_
-----BEGIN DH PARAMETERS-----
MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0
pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG
@@ -17,10 +19,12 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
-----END DH PARAMETERS-----
_end_of_pem_
- TEST_KEY_DH1024.priv_key = OpenSSL::BN.new("48561834C67E65FFD2A9B47F41E5E78FDC95C387428FDB1E4B0188B64D1643C3A8D3455B945B7E8C4D166010C7C2CE23BFB9BEF43D0348FE7FA5284B0225E7FE1537546D114E3D8A4411B9B9351AB451E1A358F50ED61B1F00DA29336EEBBD649980AC86D76AF8BBB065298C2052672EEF3EF13AB47A15275FC2836F3AC74CEA", 16)
+ TEST_KEY_DH1024.priv_key = OpenSSL::BN.new("48561834C67E65FFD2A9B47F41E5E78FDC95C387428FDB1E4B0188B64D1643C3A8D3455B945B7E8C4D166010C7C2CE23BFB9BEF43D0348FE7FA5284B0225E7FE1537546D114E3D8A4411B9B9351AB451E1A358F50ED61B1F00DA29336EEBBD649980AC86D76AF8BBB065298C2052672EEF3EF13AB47A15275FC2836F3AC74CEA", 16)
+
+ end
config = Hash.new
- config[:SSLTmpDhCallback] = proc { TEST_KEY_DH1024 }
+ config[:SSLTmpDhCallback] = proc { DRbTests::TEST_KEY_DH1024 }
config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER
config[:SSLVerifyCallback] = lambda{|ok,x509_store|
true
diff --git a/test/drb/ut_drb.rb b/test/drb/ut_drb.rb
index c6cc0590f1e..c2a5f62331f 100644
--- a/test/drb/ut_drb.rb
+++ b/test/drb/ut_drb.rb
@@ -2,6 +2,8 @@ require 'drb/drb'
require 'drb/extserv'
require 'timeout'
+module DRbTests
+
class XArray < Array
def initialize(ary)
ary.each do |x|
@@ -147,6 +149,8 @@ class DRbEx
end
end
+end
+
if __FILE__ == $0
def ARGV.shift
it = super()
@@ -156,7 +160,7 @@ if __FILE__ == $0
DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('druby://localhost:0', DRbEx.new)
+ DRb.start_service('druby://localhost:0', DRbTests::DRbEx.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
es.stop_service if es.alive?
diff --git a/test/drb/ut_drb_drbssl.rb b/test/drb/ut_drb_drbssl.rb
index 1e270371d5d..b6d1c122625 100644
--- a/test/drb/ut_drb_drbssl.rb
+++ b/test/drb/ut_drb_drbssl.rb
@@ -8,7 +8,9 @@ if __FILE__ == $0
it
end
- TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_
+ module DRbTests
+
+ TEST_KEY_DH1024 = OpenSSL::PKey::DH.new <<-_end_of_pem_
-----BEGIN DH PARAMETERS-----
MIGHAoGBAKnKQ8MNK6nYZzLrrcuTsLxuiJGXoOO5gT+tljOTbHBuiktdMTITzIY0
pFxIvjG05D7HoBZQfrR0c92NGWPkAiCkhQKB8JCbPVzwNLDy6DZ0pmofDKrEsYHG
@@ -16,10 +18,12 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
-----END DH PARAMETERS-----
_end_of_pem_
- TEST_KEY_DH1024.priv_key = OpenSSL::BN.new("48561834C67E65FFD2A9B47F41E5E78FDC95C387428FDB1E4B0188B64D1643C3A8D3455B945B7E8C4D166010C7C2CE23BFB9BEF43D0348FE7FA5284B0225E7FE1537546D114E3D8A4411B9B9351AB451E1A358F50ED61B1F00DA29336EEBBD649980AC86D76AF8BBB065298C2052672EEF3EF13AB47A15275FC2836F3AC74CEA", 16)
+ TEST_KEY_DH1024.priv_key = OpenSSL::BN.new("48561834C67E65FFD2A9B47F41E5E78FDC95C387428FDB1E4B0188B64D1643C3A8D3455B945B7E8C4D166010C7C2CE23BFB9BEF43D0348FE7FA5284B0225E7FE1537546D114E3D8A4411B9B9351AB451E1A358F50ED61B1F00DA29336EEBBD649980AC86D76AF8BBB065298C2052672EEF3EF13AB47A15275FC2836F3AC74CEA", 16)
+
+ end
config = Hash.new
- config[:SSLTmpDhCallback] = proc { TEST_KEY_DH1024 }
+ config[:SSLTmpDhCallback] = proc { DRbTests::TEST_KEY_DH1024 }
config[:SSLVerifyMode] = OpenSSL::SSL::VERIFY_PEER
config[:SSLVerifyCallback] = lambda{|ok,x509_store|
true
@@ -29,7 +33,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('drbssl://localhost:0', DRbEx.new, config)
+ DRb.start_service('drbssl://localhost:0', DRbTests::DRbEx.new, config)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
es.stop_service if es.alive?
diff --git a/test/drb/ut_drb_drbunix.rb b/test/drb/ut_drb_drbunix.rb
index 83ae31e903e..c997d2469d0 100644
--- a/test/drb/ut_drb_drbunix.rb
+++ b/test/drb/ut_drb_drbunix.rb
@@ -9,7 +9,7 @@ if __FILE__ == $0
DRb::DRbServer.default_argc_limit(8)
DRb::DRbServer.default_load_limit(4096)
- DRb.start_service('drbunix:', DRbEx.new)
+ DRb.start_service('drbunix:', DRbTests::DRbEx.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
es.stop_service if es.alive?
diff --git a/test/drb/ut_eq.rb b/test/drb/ut_eq.rb
index 7a0e04126ce..cc86158363a 100644
--- a/test/drb/ut_eq.rb
+++ b/test/drb/ut_eq.rb
@@ -1,6 +1,8 @@
require 'drb/drb'
require 'drb/extserv'
+module DRbTests
+
class Foo
include DRbUndumped
end
@@ -17,6 +19,8 @@ class Bar
end
end
+end
+
if __FILE__ == $0
def ARGV.shift
it = super()
@@ -24,8 +28,9 @@ if __FILE__ == $0
it
end
- DRb.start_service('druby://localhost:0', Bar.new)
+ DRb.start_service('druby://localhost:0', DRbTests::Bar.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
es.stop_service if es.alive?
end
+
diff --git a/test/drb/ut_eval.rb b/test/drb/ut_eval.rb
index 1dbf8a5c50f..c456790fd9f 100644
--- a/test/drb/ut_eval.rb
+++ b/test/drb/ut_eval.rb
@@ -1,6 +1,8 @@
require 'drb/drb'
require 'drb/extserv'
+module DRbTests
+
class EvalAttack
def initialize
@four = DRb::DRbServer.new('druby://localhost:0', self, {:safe_level => 4})
@@ -15,6 +17,8 @@ class EvalAttack
end
end
+end
+
if __FILE__ == $0
def ARGV.shift
@@ -25,7 +29,7 @@ if __FILE__ == $0
$SAFE = 1
- DRb.start_service('druby://localhost:0', EvalAttack.new, {:safe_level => 2})
+ 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?
diff --git a/test/drb/ut_large.rb b/test/drb/ut_large.rb
index ab36c1b4a88..c2fbd3e1849 100644
--- a/test/drb/ut_large.rb
+++ b/test/drb/ut_large.rb
@@ -2,6 +2,8 @@ require 'drb/drb'
require 'drb/extserv'
require 'timeout'
+module DRbTests
+
class DRbLarge
include DRbUndumped
@@ -22,6 +24,8 @@ class DRbLarge
end
end
+end
+
if __FILE__ == $0
def ARGV.shift
it = super()
@@ -31,7 +35,7 @@ if __FILE__ == $0
DRb::DRbServer.default_argc_limit(3)
DRb::DRbServer.default_load_limit(100000)
- DRb.start_service('druby://localhost:0', DRbLarge.new)
+ DRb.start_service('druby://localhost:0', DRbTests::DRbLarge.new)
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
DRb.thread.join
es.stop_service if es.alive?
diff --git a/test/drb/ut_timerholder.rb b/test/drb/ut_timerholder.rb
index 6f66dd3393b..6c62ea7726a 100644
--- a/test/drb/ut_timerholder.rb
+++ b/test/drb/ut_timerholder.rb
@@ -2,6 +2,8 @@ require 'runit/testcase'
require 'runit/cui/testrunner'
require 'timerholder'
+module DRbTests
+
class TimerHolderTest < RUNIT::TestCase
def do_test(timeout, keeper_sleep = nil)
holder = TimerHolder.new(timeout)
@@ -44,6 +46,8 @@ class TimerHolderTest < RUNIT::TestCase
end
end
+end
+
if __FILE__ == $0
- RUNIT::CUI::TestRunner.run(TimerHolderTest.suite)
+ RUNIT::CUI::TestRunner.run(DRbTests::TimerHolderTest.suite)
end