1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

python:tests/dns_base: add get_unpriv_creds() helper

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 88457da00d4110b419f7a7ccabcd542fa77e463f)
This commit is contained in:
Stefan Metzmacher 2024-05-29 11:39:56 +02:00 committed by Jule Anger
parent ff0afdd1b0
commit 5a98bc5026

View File

@ -267,8 +267,23 @@ class DNSTKeyTest(DNSTest):
self.creds.set_username(tests.env_get_var_value('USERNAME'))
self.creds.set_password(tests.env_get_var_value('PASSWORD'))
self.creds.set_kerberos_state(credentials.MUST_USE_KERBEROS)
self.unpriv_creds = None
self.newrecname = "tkeytsig.%s" % self.get_dns_domain()
def get_unpriv_creds(self):
if self.unpriv_creds is not None:
return self.unpriv_creds
self.unpriv_creds = credentials.Credentials()
self.unpriv_creds.guess(self.lp_ctx)
self.unpriv_creds.set_username(tests.env_get_var_value('USERNAME_UNPRIV'))
self.unpriv_creds.set_password(tests.env_get_var_value('PASSWORD_UNPRIV'))
self.unpriv_creds.set_kerberos_state(credentials.MUST_USE_KERBEROS)
return self.unpriv_creds
def tkey_trans(self, creds=None, algorithm_name="gss-tsig",
tkey_req_in_answers=False,
expected_rcode=dns.DNS_RCODE_OK):