Description: Fix port allocation on test suite
 For some reason, when running the test suite under sbuild, several tests crash
 with an error of `Errno::EADDRINUSE: Address already in use - listen(2)`. The
 tests just work when building outside of sbuild.
 .
 Somehow, passing :Port => 0 seems to be making WEBrick allocate the same port
 over and over. I couldn't reproduce this interactively.
 .
 This patch fixes the issue by assigning explict port numbers to servers and
 proxy servers created in the test suite, and is most probably Debian-specific.
Author: Antonio Terceiro <terceiro@debian.org>

---
Origin: vendor
Bug-Debian: http://bugs.debian.org/747736
Forwarded: not-needed
Last-Update: 2014-06-26

--- a/test/helper.rb
+++ b/test/helper.rb
@@ -69,7 +69,7 @@ module Helper
     @proxyserver = WEBrick::HTTPProxyServer.new(
       :BindAddress => "localhost",
       :Logger => @proxylogger,
-      :Port => 0,
+      :Port => 50001,
       :AccessLog => []
     )
     @proxyport = @proxyserver.config[:Port]
--- a/test/test_auth.rb
+++ b/test/test_auth.rb
@@ -17,7 +17,7 @@ class TestAuth < Test::Unit::TestCase
     @server = WEBrick::HTTPServer.new(
       :BindAddress => "localhost",
       :Logger => @logger,
-      :Port => 0,
+      :Port => 50000,
       :AccessLog => [],
       :DocumentRoot => File.dirname(File.expand_path(__FILE__))
     )
@@ -68,7 +68,7 @@ class TestAuth < Test::Unit::TestCase
       :ProxyAuthProc => @proxy_digest_auth.method(:authenticate).to_proc,
       :BindAddress => "localhost",
       :Logger => @proxylogger,
-      :Port => 0,
+      :Port => 50001,
       :AccessLog => []
     )
     @proxyport = @proxyserver.config[:Port]
--- a/test/test_http-access2.rb
+++ b/test/test_http-access2.rb
@@ -386,7 +386,7 @@ private
     @server = WEBrick::HTTPServer.new(
       :BindAddress => "localhost",
       :Logger => @logger,
-      :Port => 0,
+      :Port => 50000,
       :AccessLog => [],
       :DocumentRoot => File.dirname(File.expand_path(__FILE__))
     )
--- a/test/test_httpclient.rb
+++ b/test/test_httpclient.rb
@@ -1599,7 +1599,7 @@ private
     @server = WEBrick::HTTPServer.new(
       :BindAddress => "localhost",
       :Logger => @logger,
-      :Port => 0,
+      :Port => 50000,
       :AccessLog => [],
       :DocumentRoot => File.dirname(File.expand_path(__FILE__))
     )
--- a/test/test_ssl.rb
+++ b/test/test_ssl.rb
@@ -186,7 +186,7 @@ private
     @server = WEBrick::HTTPServer.new(
       :BindAddress => "localhost",
       :Logger => logger,
-      :Port => 0,
+      :Port => 50000,
       :AccessLog => [],
       :DocumentRoot => DIR,
       :SSLEnable => true,
