summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-10-20 12:41:39 +1300
committerStefan Metzmacher <metze@samba.org>2021-10-26 12:00:28 +0000
commitcf03277b663796a22d9fffbfdb6db270169a0385 (patch)
tree0f8c5b6322f9a085360fa8a436a72193b6cefee5
parent3a813c6d70e0a6b390f550ec208599ad4f79a661 (diff)
downloadsamba-cf03277b663796a22d9fffbfdb6db270169a0385.tar.gz
tests/krb5: Allow specifying prefix or suffix for test account names
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14874 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14881 Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 7e39994ed341883ac4c8c257220c19dbf70c7bc5)
-rw-r--r--python/samba/tests/krb5/kdc_base_test.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py
index 8f453b464fd..d8f3969d228 100644
--- a/python/samba/tests/krb5/kdc_base_test.py
+++ b/python/samba/tests/krb5/kdc_base_test.py
@@ -630,6 +630,8 @@ class KDCBaseTest(RawKerberosTest):
opts = {}
opts_default = {
+ 'name_prefix': None,
+ 'name_suffix': None,
'spn': None,
'allowed_replication': False,
'allowed_replication_mock': False,
@@ -667,6 +669,8 @@ class KDCBaseTest(RawKerberosTest):
def create_account_opts(self, *,
account_type,
+ name_prefix,
+ name_suffix,
spn,
allowed_replication,
allowed_replication_mock,
@@ -696,6 +700,10 @@ class KDCBaseTest(RawKerberosTest):
user_name = self.account_base + str(self.account_id)
type(self).account_id += 1
+ if name_prefix is not None:
+ user_name = name_prefix + user_name
+ if name_suffix is not None:
+ user_name += name_suffix
user_account_control = 0
if trusted_to_auth_for_delegation: