]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Allow specifying prefix or suffix for test account names
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 19 Oct 2021 23:41:39 +0000 (12:41 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Oct 2021 12:02:33 +0000 (12:02 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14874

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
python/samba/tests/krb5/kdc_base_test.py

index 8f453b464fd6ed8a458500b81f3509e40bb940b7..d8f3969d2282534ffaf51f849e5ae31555274931 100644 (file)
@@ -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: