1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

tests: Relax auth_log SMB assertions to cover v1 *or* v2

The s4 Python bindings currently only support SMBv1 connections.
If we change the bindings to support *either* v1 or v2, they'll
end up negotiating v2. In which case the server is "SMB2", not "SMB",
and these assertions fail.

Long-term we want to get rid of SMBv1, so it makes sense to write the
tests so that they pass against either v1 or v2.

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Tim Beale 2019-01-16 11:18:27 +13:00 committed by Jeremy Allison
parent 7fb93eaca7
commit 065faa6a14

View File

@ -701,7 +701,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
def test_smb(self):
def isLastExpectedMessage(msg):
return (msg["type"] == "Authorization" and
msg["Authorization"]["serviceDescription"] == "SMB" and
"SMB" in msg["Authorization"]["serviceDescription"] and
msg["Authorization"]["authType"] == "krb5" and
msg["Authorization"]["transportProtection"] == "SMB")
@ -910,7 +910,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
def test_smb_no_krb_spnego(self):
def isLastExpectedMessage(msg):
return (msg["type"] == "Authorization" and
msg["Authorization"]["serviceDescription"] == "SMB" and
"SMB" in msg["Authorization"]["serviceDescription"] and
msg["Authorization"]["authType"] == "NTLMSSP" and
msg["Authorization"]["transportProtection"] == "SMB")
@ -929,8 +929,8 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
msg = messages[0]
self.assertEquals("Authentication", msg["type"])
self.assertEquals("NT_STATUS_OK", msg["Authentication"]["status"])
self.assertEquals("SMB",
msg["Authentication"]["serviceDescription"])
self.assertIn(msg["Authentication"]["serviceDescription"],
["SMB", "SMB2"])
self.assertEquals("NTLMSSP",
msg["Authentication"]["authDescription"])
self.assertEquals("NTLMv2",
@ -943,7 +943,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
def test_smb_no_krb_spnego_bad_password(self):
def isLastExpectedMessage(msg):
return (msg["type"] == "Authentication" and
msg["Authentication"]["serviceDescription"] == "SMB" and
"SMB" in msg["Authentication"]["serviceDescription"] and
msg["Authentication"]["authDescription"] == "NTLMSSP" and
msg["Authentication"]["passwordType"] == "NTLMv2" and
(msg["Authentication"]["status"] ==
@ -975,7 +975,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
def test_smb_no_krb_spnego_bad_user(self):
def isLastExpectedMessage(msg):
return (msg["type"] == "Authentication" and
msg["Authentication"]["serviceDescription"] == "SMB" and
"SMB" in msg["Authentication"]["serviceDescription"] and
msg["Authentication"]["authDescription"] == "NTLMSSP" and
msg["Authentication"]["passwordType"] == "NTLMv2" and
(msg["Authentication"]["status"] ==