1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-08 05:57:51 +03:00

tests/krb5: Allow specifying additional details when creating an account

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817
(cherry picked from commit 4790b6b04ae145a2ebb418dd734487a6ba28a30c)
This commit is contained in:
Joseph Sutton 2021-07-06 11:25:55 +12:00 committed by Jule Anger
parent 79ab000c19
commit 989b352023

View File

@ -148,7 +148,7 @@ class KDCBaseTest(RawKerberosTest):
return default_enctypes return default_enctypes
def create_account(self, ldb, name, machine_account=False, def create_account(self, ldb, name, machine_account=False,
spn=None, upn=None): spn=None, upn=None, additional_details=None):
'''Create an account for testing. '''Create an account for testing.
The dn of the created account is added to self.accounts, The dn of the created account is added to self.accounts,
which is used by tearDownClass to clean up the created accounts. which is used by tearDownClass to clean up the created accounts.
@ -180,6 +180,8 @@ class KDCBaseTest(RawKerberosTest):
details["servicePrincipalName"] = spn details["servicePrincipalName"] = spn
if upn is not None: if upn is not None:
details["userPrincipalName"] = upn details["userPrincipalName"] = upn
if additional_details is not None:
details.update(additional_details)
ldb.add(details) ldb.add(details)
creds = KerberosCredentials() creds = KerberosCredentials()