1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

tests/krb5: Use admin creds for SamDB rather than user creds

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>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14817
(cherry picked from commit ab221c1b3e24696aa0eed6aa970f310447657069)
This commit is contained in:
Joseph Sutton 2021-06-16 12:52:11 +12:00 committed by Jule Anger
parent 477f765f1a
commit b4022ea0b4
2 changed files with 36 additions and 8 deletions

View 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()

View File

@ -819,10 +819,26 @@ planoldpythontestsuite("ad_dc_default:local", "samba.tests.krb5.s4u_tests",
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"'])
@ -1399,15 +1415,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',