summaryrefslogtreecommitdiff
path: root/test/openssl/utils.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 12:46:58 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-13 12:46:58 +0000
commit3864eb828b37315d1e15f147bcfb4ff06566dcf6 (patch)
tree7bdc65a5363bf4c843c128f8d1367aa43af9343c /test/openssl/utils.rb
parent1e502d2a10e89a1960f829bcda6410eeb1069156 (diff)
* test/openssl: Don't specify port number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/utils.rb')
-rw-r--r--test/openssl/utils.rb12
1 files changed, 3 insertions, 9 deletions
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index 4b10c1cfa98..7d9f1334642 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -190,7 +190,6 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
class OpenSSL::SSLTestCase < Test::Unit::TestCase
RUBY = EnvUtil.rubybin
- PORT = 20443
ITERATIONS = ($0 == __FILE__) ? 100 : 10
def setup
@@ -267,7 +266,7 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
end
end
- def start_server(port0, verify_mode, start_immediately, args = {}, &block)
+ def start_server(verify_mode, start_immediately, args = {}, &block)
IO.pipe {|stop_pipe_r, stop_pipe_w|
ctx_proc = args[:ctx_proc]
server_proc = args[:server_proc]
@@ -288,13 +287,8 @@ AQjjxMXhwULlmuR/K+WwlaZPiLIBYalLAZQ7ZbOPeVkJ8ePao0eLAgEC
Socket.do_not_reverse_lookup = true
tcps = nil
- port = port0
- begin
- tcps = TCPServer.new("127.0.0.1", port)
- rescue Errno::EADDRINUSE
- port += 1
- retry
- end
+ tcps = TCPServer.new("127.0.0.1", 0)
+ port = tcps.connect_address.ip_port
ssls = OpenSSL::SSL::SSLServer.new(tcps, ctx)
ssls.start_immediately = start_immediately