From: Hleb Valoshka <375gnu@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(-)

--- a/test/test_auth.rb
+++ b/test/test_auth.rb
@@ -2,7 +2,7 @@
 require 'digest/md5'
 require 'rack'
 require 'rack/lint'
-require 'rack-ntlm'
+#require 'rack-ntlm'
 
 class TestAuth < Test::Unit::TestCase
   include Helper
@@ -38,20 +38,20 @@
       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)
@@ -114,27 +114,27 @@
     res.body = 'digest_sess_auth OK' + req.query_string.to_s
   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
-        remove_method(:data_size) if method_defined?(:data_size)
-        def data_size
-          @active && @value ? @value.size : 0
-        end
-      end
-    end
-  end
-  def 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"))
-  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
+  #       remove_method(:data_size) if method_defined?(:data_size)
+  #       def data_size
+  #         @active && @value ? @value.size : 0
+  #       end
+  #     end
+  #   end
+  # end
+  # def 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"))
+  # end
 
   def test_basic_auth
     c = HTTPClient.new
@@ -469,7 +469,7 @@
     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)
