Adds a configurable timeout for LDAP authentication (#8978).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9931 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-07-07 09:36:04 +00:00
parent 553066e804
commit 3b207ee77c
7 changed files with 50 additions and 9 deletions
+10
View File
@@ -114,6 +114,16 @@ class AuthSourceLdapTest < ActiveSupport::TestCase
end
end
end
def test_authenticate_should_timeout
auth_source = AuthSourceLdap.find(1)
auth_source.timeout = 1
def auth_source.initialize_ldap_con(*args); sleep(5); end
assert_raise AuthSourceTimeoutException do
auth_source.authenticate 'example1', '123456'
end
end
else
puts '(Test LDAP server not configured)'
end