]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Use admin creds for SamDB rather than user creds
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 16 Jun 2021 00:52:11 +0000 (12:52 +1200)
committerStefan Metzmacher <metze@samba.org>
Thu, 1 Jul 2021 17:46:31 +0000 (17:46 +0000)
This makes the purpose of each set of credentials more consistent, and
makes some tests more convenient to run standalone as they no longer
require user credentials.

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

index 89d374fc5cca37cdef87d43853e729f958b8e6dc..0f5238a3de90ad72fe45cdad5b555ac5bc29664f 100644 (file)
@@ -109,7 +109,7 @@ class KDCBaseTest(RawKerberosTest):
 
     def get_samdb(self):
         if self._ldb is None:
-            creds = self.get_user_creds()
+            creds = self.get_admin_creds()
             lp = self.get_lp()
 
             session = system_session()
index 4ed1ed658b81672d6b0edc7a7d441407ce7b368e..5e6daa44b715aad436da94888c7c4ae4c26c7195 100755 (executable)
@@ -852,10 +852,26 @@ planoldpythontestsuite("ad_dc_default", "samba.tests.dsdb_dns")
 
 planoldpythontestsuite("fl2008r2dc:local", "samba.tests.krb5.xrealm_tests")
 
-planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ccache")
-planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ldap")
-planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_rpc")
-planoldpythontestsuite("ad_dc_smb1", "samba.tests.krb5.test_smb")
+planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ccache",
+                       environ={
+                           'ADMIN_USERNAME': '$USERNAME',
+                           'ADMIN_PASSWORD': '$PASSWORD'
+                       })
+planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_ldap",
+                       environ={
+                           'ADMIN_USERNAME': '$USERNAME',
+                           'ADMIN_PASSWORD': '$PASSWORD'
+                       })
+planoldpythontestsuite("ad_dc_default", "samba.tests.krb5.test_rpc",
+                       environ={
+                           'ADMIN_USERNAME': '$USERNAME',
+                           'ADMIN_PASSWORD': '$PASSWORD'
+                       })
+planoldpythontestsuite("ad_dc_smb1", "samba.tests.krb5.test_smb",
+                       environ={
+                           'ADMIN_USERNAME': '$USERNAME',
+                           'ADMIN_PASSWORD': '$PASSWORD'
+                       })
 
 for env in ["ad_dc", smbv1_disabled_testenv]:
     planoldpythontestsuite(env, "samba.tests.smb", extra_args=['-U"$USERNAME%$PASSWORD"'])
@@ -1432,15 +1448,27 @@ for env in ["rodc", "promoted_dc", "fl2000dc", "fl2008r2dc"]:
                                                             '--option=torture:expect_machine_account=true'] + extra_options,
                              "samba4.krb5.kdc with machine account")
 
-planpythontestsuite("ad_dc", "samba.tests.krb5.as_canonicalization_tests")
+planpythontestsuite("ad_dc", "samba.tests.krb5.as_canonicalization_tests",
+                       environ={
+                           'ADMIN_USERNAME': '$USERNAME',
+                           'ADMIN_PASSWORD': '$PASSWORD'
+                       })
 planpythontestsuite("ad_dc", "samba.tests.krb5.compatability_tests")
 planpythontestsuite("ad_dc", "samba.tests.krb5.kdc_tests")
 planpythontestsuite(
     "ad_dc",
-    "samba.tests.krb5.kdc_tgs_tests")
+    "samba.tests.krb5.kdc_tgs_tests",
+    environ={
+        'ADMIN_USERNAME': '$USERNAME',
+        'ADMIN_PASSWORD': '$PASSWORD'
+    })
 planpythontestsuite(
     "ad_dc",
-    "samba.tests.krb5.ms_kile_client_principal_lookup_tests")
+    "samba.tests.krb5.ms_kile_client_principal_lookup_tests",
+    environ={
+        'ADMIN_USERNAME': '$USERNAME',
+        'ADMIN_PASSWORD': '$PASSWORD'
+    })
 
 for env in [
         'vampire_dc',