]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: Make credentials cache test run against Windows
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 10 May 2021 03:06:06 +0000 (15:06 +1200)
committerJeremy Allison <jra@samba.org>
Wed, 19 May 2021 02:22:00 +0000 (02:22 +0000)
Windows, unlike Samba, requires the service principal name to be set
when requesting a ticket to that service.

Additionally, default_realm from the libdefaults section of krb5.conf
should be set so that the correct realm is used.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May 19 02:22:01 UTC 2021 on sn-devel-184

python/samba/tests/krb5/test_ccache.py

index e0998a4c43f6850c5208890647e9023e3b862309..32c9e3cce6b1f7700c40b4974ffe6e0543ab3b7b 100755 (executable)
@@ -47,13 +47,16 @@ class CcacheTests(KDCBaseTest):
 
         user_name = "ccacheusr"
         mach_name = "ccachemac"
+        service = "host"
 
         # Create the user account.
         (user_credentials, _) = self.create_account(user_name)
 
         # Create the machine account.
         (mach_credentials, _) = self.create_account(mach_name,
-                                                    machine_account=True)
+                                                    machine_account=True,
+                                                    spn="%s/%s" % (service,
+                                                                   mach_name))
 
         # Talk to the KDC to obtain the service ticket, which gets placed into
         # the cache. The machine account name has to match the name in the