From: Stefan Metzmacher Date: Thu, 7 Mar 2024 16:59:02 +0000 (+0100) Subject: tests/ntlm_auth_krb5: don't test that a krb5ccache work with an explicit username X-Git-Tag: tdb-1.4.11~796 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6b94a690b59fa7a3106f19d76eb37b8f0bab9f0;p=thirdparty%2Fsamba.git tests/ntlm_auth_krb5: don't test that a krb5ccache work with an explicit username This test is useless and won't work anymore in future. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/python/samba/tests/ntlm_auth_base.py b/python/samba/tests/ntlm_auth_base.py index 993ac12ca03..3f3850bb378 100644 --- a/python/samba/tests/ntlm_auth_base.py +++ b/python/samba/tests/ntlm_auth_base.py @@ -51,6 +51,7 @@ class NTLMAuthTestCase(BlackboxTestCase): client_password=None, client_domain=None, client_use_cached_creds=False, + client_use_global_krb5_ccache=False, server_username=None, server_password=None, server_domain=None, @@ -62,19 +63,28 @@ class NTLMAuthTestCase(BlackboxTestCase): target_service=None): self.assertTrue(os.access(self.ntlm_auth_path, os.X_OK)) - if client_username is None: - raise Exception("client_username required") - # Client helper args client_args = [] client_args.append(self.ntlm_auth_path) client_args.append("--helper-protocol=%s" % client_helper) - client_args.append("--username=%s" % client_username) + if client_username: + client_args.append("--username=%s" % client_username) if client_domain: client_args.append("--domain=%s" % client_domain) if client_use_cached_creds: + if client_username is None: + raise Exception("client_username required") + if client_password is not None: + raise Exception("client_password not allowed") client_args.append("--use-cached-creds") + elif client_use_global_krb5_ccache: + if client_username is not None: + raise Exception("client_username not allowed") + if client_password is not None: + raise Exception("client_password not allowed") else: + if client_username is None: + raise Exception("client_username required") if client_password is None: raise Exception("client_password required") client_args.append("--password=%s" % client_password) diff --git a/python/samba/tests/ntlm_auth_krb5.py b/python/samba/tests/ntlm_auth_krb5.py index db57400dda5..ab8306e95cd 100644 --- a/python/samba/tests/ntlm_auth_krb5.py +++ b/python/samba/tests/ntlm_auth_krb5.py @@ -34,9 +34,7 @@ class NTLMAuthKerberosTests(NTLMAuthTestCase): """ ntlm_auth with krb5 gss-spnego-client and gss-spnego server """ os.environ["KRB5CCNAME"] = self.old_ccache - ret = self.run_helper(client_username="foo", - client_password="secret", - client_domain="FOO", + ret = self.run_helper(client_use_global_krb5_ccache=True, target_hostname=os.environ["SERVER"], target_service="host", client_helper="gss-spnego-client", @@ -45,9 +43,7 @@ class NTLMAuthKerberosTests(NTLMAuthTestCase): self.assertTrue(ret) os.environ["KRB5CCNAME"] = self.ccache - ret = self.run_helper(client_username="foo", - client_password="secret", - client_domain="FOO", + ret = self.run_helper(client_use_global_krb5_ccache=True, target_hostname=os.environ["SERVER"], target_service="host", client_helper="gss-spnego-client",