1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth ntlm-server-1 with incorrect fixed password

Port ntlm_auth bash script tests to python

Signed-off-by: Samuel Cabrero <scabrero@suse.de>
Reviewed-by: Noel Power <npower@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Samuel Cabrero
2018-08-31 19:06:18 +02:00
committed by Noel Power
parent 28ea2f7220
commit 7c0c683b2e
2 changed files with 15 additions and 38 deletions

View File

@ -233,3 +233,18 @@ class NTLMAuthHelpersTests(NTLMAuthTestCase):
lines[1], b"User-Session-Key: 3F373EA8E4AF954F14FAA506F8EEBDC4")
self.assertEquals(lines[2], b".")
self.assertEquals(lines[3], b"")
# Break the password with a leading A on the challenge
ntlm_cmds[0] = "LANMAN-Challenge: A123456789abcdef"
proc = Popen([self.ntlm_auth_path,
"--password", "SecREt01",
"--helper-protocol", "ntlm-server-1"],
stdout=PIPE, stdin=PIPE, stderr=PIPE)
buf = "\n".join(ntlm_cmds)
(out, err) = proc.communicate(input=buf.encode('utf-8'))
self.assertEqual(proc.returncode, 0)
lines = out.split(b"\n")
self.assertEqual(len(lines), 5)
self.assertEquals(lines[0], b"Authenticated: No")