]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Allow specifying an OU to create accounts in
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 1 Sep 2021 04:34:02 +0000 (16:34 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 13 Sep 2021 23:11:35 +0000 (23:11 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Isaac Boukris <iboukris@samba.org>
python/samba/tests/krb5/kdc_base_test.py

index f5c1eba915186b3c307ef500951ef25017e1ce27..efe11da84680121318c5fa5041f7dbfd2c0bca33 100644 (file)
@@ -151,12 +151,16 @@ class KDCBaseTest(RawKerberosTest):
         return default_enctypes
 
     def create_account(self, ldb, name, machine_account=False,
-                       spn=None, upn=None, additional_details=None):
+                       spn=None, upn=None, additional_details=None,
+                       ou=None):
         '''Create an account for testing.
            The dn of the created account is added to self.accounts,
            which is used by tearDownClass to clean up the created accounts.
         '''
-        dn = "cn=%s,%s" % (name, ldb.domain_dn())
+        if ou is None:
+            ou = ldb.domain_dn()
+
+        dn = "CN=%s,%s" % (name, ou)
 
         # remove the account if it exists, this will happen if a previous test
         # run failed