mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
tests/auth_log: Expect no messages when changing a non-existent user’s password
These log messages come from setUp(), and the fact that we are getting them is merely a side-effect of the unreliability of discardMessages(). Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
e1884e8038
commit
5c1ea54cea
@ -237,14 +237,12 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
"Did not receive the expected message")
|
||||
|
||||
#
|
||||
# Currently this does not get logged, so we expect to only see the log
|
||||
# entries for the underlying ldap bind.
|
||||
# Currently this does not get logged, so we expect to see no messages.
|
||||
#
|
||||
def test_ldap_change_password_bad_user(self):
|
||||
def isLastExpectedMessage(msg):
|
||||
return (msg["type"] == "Authorization" and
|
||||
msg["Authorization"]["serviceDescription"] == "LDAP" and
|
||||
msg["Authorization"]["authType"] == "krb5")
|
||||
# Accept any message we receive.
|
||||
return True
|
||||
|
||||
new_password = samba.generate_random_password(32, 32)
|
||||
try:
|
||||
@ -260,8 +258,8 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
(num, msg) = e.args
|
||||
pass
|
||||
|
||||
self.assertTrue(self.waitForMessages(isLastExpectedMessage),
|
||||
"Did not receive the expected message")
|
||||
self.assertFalse(self.waitForMessages(isLastExpectedMessage),
|
||||
"Received unexpected messages")
|
||||
|
||||
def test_ldap_change_password_bad_original_password(self):
|
||||
def isLastExpectedMessage(msg):
|
||||
|
2
selftest/knownfail.d/auth-log-pass-change
Normal file
2
selftest/knownfail.d/auth-log-pass-change
Normal file
@ -0,0 +1,2 @@
|
||||
^samba.tests.auth_log_pass_change.samba.tests.auth_log_pass_change.AuthLogPassChangeTests.test_ldap_change_password_bad_user.ad_dc_ntvfs
|
||||
^samba.tests.auth_log_pass_change.samba.tests.auth_log_pass_change.AuthLogPassChangeTests.test_ldap_change_password_bad_user.ad_dc_smb1
|
Loading…
Reference in New Issue
Block a user