[DRE-commits] [ruby-httpclient] 06/18: Add patch to disable tests which require NTLM

Hleb Valoshka tsfgnu-guest at moszumanska.debian.org
Thu Aug 27 10:37:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

tsfgnu-guest pushed a commit to branch master
in repository ruby-httpclient.

commit f77a29b6b32375716635c8bde0d3a859b4f4e3d8
Author: Hleb Valoshka <375gnu at gmail.com>
Date:   Mon Aug 17 16:05:00 2015 +0300

    Add patch to disable tests which require NTLM
---
 debian/patches/0002-Disable-tests-for-NTLM.patch | 102 +++++++++++++++++++++++
 debian/patches/series                            |   1 +
 2 files changed, 103 insertions(+)

diff --git a/debian/patches/0002-Disable-tests-for-NTLM.patch b/debian/patches/0002-Disable-tests-for-NTLM.patch
new file mode 100644
index 0000000..ec98942
--- /dev/null
+++ b/debian/patches/0002-Disable-tests-for-NTLM.patch
@@ -0,0 +1,102 @@
+From: Hleb Valoshka <375gnu at gmail.com>
+Date: Mon, 17 Aug 2015 12:47:33 +0300
+Subject: Disable tests for NTLM
+
+---
+ test/test_auth.rb | 62 +++++++++++++++++++++++++++----------------------------
+ 1 file changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/test/test_auth.rb b/test/test_auth.rb
+index 7d1fdba..ff8f55f 100644
+--- a/test/test_auth.rb
++++ b/test/test_auth.rb
+@@ -3,7 +3,7 @@ require 'digest/md5'
+ require 'rack'
+ require 'rack/lint'
+ require 'rack/showexceptions'
+-require 'rack-ntlm'
++#require 'rack-ntlm'
+ 
+ class TestAuth < Test::Unit::TestCase
+   include Helper
+@@ -39,20 +39,20 @@ class TestAuth < Test::Unit::TestCase
+       WEBrick::HTTPServlet::ProcHandler.new(method(:do_digest_sess_auth).to_proc)
+     )
+     # NTLM endpoint
+-    ntlm_handler = Rack::Handler::WEBrick.new(@server,
+-      Rack::Builder.app do
+-        use Rack::ShowExceptions
+-        use Rack::ContentLength
+-        use Rack::Ntlm, {:uri_pattern => /.*/, :auth => {:username => "admin", :password => "admin"}}
+-        run lambda { |env| [200, { 'Content-Type' => 'text/html' }, ['ntlm_auth OK']] }
+-      end
+-    )
+-    @server.mount(
+-      '/ntlm_auth',
+-      WEBrick::HTTPServlet::ProcHandler.new(Proc.new do |req, res|
+-        ntlm_handler.service(req, res)
+-      end)
+-    )
++    #ntlm_handler = Rack::Handler::WEBrick.new(@server,
++    #  Rack::Builder.app do
++    #    use Rack::ShowExceptions
++    #    use Rack::ContentLength
++    #    use Rack::Ntlm, {:uri_pattern => /.*/, :auth => {:username => "admin", :password => "admin"}}
++    #    run lambda { |env| [200, { 'Content-Type' => 'text/html' }, ['ntlm_auth OK']] }
++    #  end
++    #)
++    #@server.mount(
++    #  '/ntlm_auth',
++    #  WEBrick::HTTPServlet::ProcHandler.new(Proc.new do |req, res|
++    #    ntlm_handler.service(req, res)
++    #  end)
++    #)
+     # Htpasswd
+     htpasswd = File.join(File.dirname(__FILE__), 'htpasswd')
+     htpasswd_userdb = WEBrick::HTTPAuth::Htpasswd.new(htpasswd)
+@@ -116,21 +116,21 @@ class TestAuth < Test::Unit::TestCase
+   end
+ 
+   # TODO: monkey patching for rack-ntlm-test-services's incompat.
+-  module ::Net
+-    module NTLM
+-      # ruby-ntlm 0.3.0 -> 0.4.0
+-      def self.decode_utf16le(*arg)
+-        EncodeUtil.decode_utf16le(*arg)
+-      end
+-      # Make it work if @value == nil
+-      class SecurityBuffer < FieldSet
+-        def data_size
+-          @active && @value ? @value.size : 0
+-        end
+-      end
+-    end
+-  end
+-  def test_ntlm_auth
++  #module ::Net
++  #  module NTLM
++  #    # ruby-ntlm 0.3.0 -> 0.4.0
++  #    def self.decode_utf16le(*arg)
++  #      EncodeUtil.decode_utf16le(*arg)
++  #    end
++  #    # Make it work if @value == nil
++  #    class SecurityBuffer < FieldSet
++  #      def data_size
++  #        @active && @value ? @value.size : 0
++  #      end
++  #    end
++  #  end
++  #end
++  def disabled_test_ntlm_auth
+     c = HTTPClient.new
+     c.set_auth("http://localhost:#{serverport}/ntlm_auth", 'admin', 'admin')
+     assert_equal('ntlm_auth OK', c.get_content("http://localhost:#{serverport}/ntlm_auth"))
+@@ -450,7 +450,7 @@ class TestAuth < Test::Unit::TestCase
+     end
+   end
+ 
+-  def test_negotiate_and_basic
++  def disabled_test_negotiate_and_basic
+     c = HTTPClient.new
+     c.test_loopback_http_response << %Q(HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: NTLM\r\nWWW-Authenticate: Basic realm="foo"\r\nConnection: Keep-Alive\r\nContent-Length: 0\r\n\r\n)
+     c.test_loopback_http_response << %Q(HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABAAAAAAAAAAAAAAA=\r\nConnection: Keep-Alive\r\nContent-Length: 0\r\n\r\n)
diff --git a/debian/patches/series b/debian/patches/series
index 9760cdf..c54024b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-Fix-port-allocation-in-tests.patch
+0002-Disable-tests-for-NTLM.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-httpclient.git



More information about the Pkg-ruby-extras-commits mailing list