]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/ntlm_auth_krb5: don't test that a krb5ccache work with an explicit username
authorStefan Metzmacher <metze@samba.org>
Thu, 7 Mar 2024 16:59:02 +0000 (17:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 14 May 2024 10:18:31 +0000 (10:18 +0000)
This test is useless and won't work anymore in future.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/tests/ntlm_auth_base.py
python/samba/tests/ntlm_auth_krb5.py

index 993ac12ca03b941dc4523a0f60c815c1ea49a731..3f3850bb378e01eb3b14e2794c4bee75c0600ec5 100644 (file)
@@ -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)
index db57400dda5113007007fa85109cf868495883ce..ab8306e95cd3c90cae5fecbff476e1b4c46a3bdf 100644 (file)
@@ -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",