s4-selftest: Avoid running kinit for each new connection
[samba.git] / source4 / dsdb / tests / python / dirsync.py
index 64b847f4306fede087f30b4a41ee3d98701d3628..c8027fc9a0edbebfdce1cc5109532fbbdcc37604 100755 (executable)
@@ -37,7 +37,7 @@ from samba.ndr import ndr_unpack, ndr_pack
 from samba.auth import system_session
 from samba import gensec, sd_utils
 from samba.samdb import SamDB
-from samba.credentials import Credentials
+from samba.credentials import Credentials, DONT_USE_KERBEROS
 import samba.tests
 from samba.tests import delete_force
 from subunit.run import SubunitTestRunner
@@ -98,6 +98,7 @@ class DirsyncBaseTests(samba.tests.TestCase):
         creds_tmp.set_workstation(creds.get_workstation())
         creds_tmp.set_gensec_features(creds_tmp.get_gensec_features()
                                       | gensec.FEATURE_SEAL)
+        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS) # kinit is too expensive to use in a tight loop
         ldb_target = SamDB(url=ldaphost, credentials=creds_tmp, lp=lp)
         return ldb_target