mirror of
https://github.com/samba-team/samba.git
synced 2025-08-03 04:22:09 +03:00
auth: For NTLM and KDC authentication, log the authentication duration
This is not a general purpose profiling solution, but these JSON logs are already being generated and stored, so this is worth adding. Some administrators are very keen to know how long authentication takes, particularly due to long replication transactions in other processes. This complements a similar patch set to log the transaction duration. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
@ -430,6 +430,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
msg["Authentication"]["serviceDescription"])
|
||||
self.assertEquals("ENC-TS Pre-authentication",
|
||||
msg["Authentication"]["authDescription"])
|
||||
self.assertTrue(msg["Authentication"]["duration"] > 0)
|
||||
|
||||
# Check the second message it should be an Authentication
|
||||
msg = messages[1]
|
||||
@ -439,6 +440,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
msg["Authentication"]["serviceDescription"])
|
||||
self.assertEquals("ENC-TS Pre-authentication",
|
||||
msg["Authentication"]["authDescription"])
|
||||
self.assertTrue(msg["Authentication"]["duration"] > 0)
|
||||
|
||||
def test_ldap_ntlm(self):
|
||||
|
||||
@ -463,6 +465,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
self.assertEquals("LDAP",
|
||||
msg["Authentication"]["serviceDescription"])
|
||||
self.assertEquals("NTLMSSP", msg["Authentication"]["authDescription"])
|
||||
self.assertTrue(msg["Authentication"]["duration"] > 0)
|
||||
|
||||
def test_ldap_simple_bind(self):
|
||||
def isLastExpectedMessage(msg):
|
||||
|
Reference in New Issue
Block a user