1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

tests/ntlm_auth: Port ntlm_auth tests to python: ntlm_auth and ntlm_auth with specified domain

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 12:47:11 +02:00
committed by Noel Power
parent e814412911
commit 247592f716
3 changed files with 55 additions and 2 deletions

View File

@ -0,0 +1,53 @@
# Unix SMB/CIFS implementation.
#
# Copyright (C) Samuel Cabrero <scabrero@suse.de> 2018
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
import os
from subprocess import Popen, PIPE
from samba.tests.ntlm_auth_base import NTLMAuthTestCase
from samba.compat import get_string
class NTLMAuthHelpersTests(NTLMAuthTestCase):
def test_specified_domain(self):
""" ntlm_auth with specified domain """
username = "foo"
password = "secret"
domain = "FOO"
ret = self.run_helper(client_username=username,
client_password=password,
client_domain=domain,
server_username=username,
server_password=password,
server_domain=domain,
server_use_winbind=False)
self.assertTrue(ret)
username = "foo"
password = "secret"
domain = "fOo"
ret = self.run_helper(client_username=username,
client_password=password,
client_domain=domain,
server_username=username,
server_password=password,
server_domain=domain,
server_use_winbind=False)
self.assertTrue(ret)