From a086e96f2692a313b97ce37c781ea97ff5c15d84 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 29 May 2024 14:08:13 +0200 Subject: [PATCH] python:tests/dns_base: let tkey_trans() take tkey_req_in_answers It's possible to put the additional into the answers section, so we should be able to test that. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13019 Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit cd747307d845f3cff723a7916aeeb31458f19202) --- python/samba/tests/dns_base.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python/samba/tests/dns_base.py b/python/samba/tests/dns_base.py index 4a289304065..41d34b0da36 100644 --- a/python/samba/tests/dns_base.py +++ b/python/samba/tests/dns_base.py @@ -248,7 +248,8 @@ class DNSTKeyTest(DNSTest): self.creds.set_kerberos_state(credentials.MUST_USE_KERBEROS) self.newrecname = "tkeytsig.%s" % self.get_dns_domain() - def tkey_trans(self, creds=None, algorithm_name="gss-tsig"): + def tkey_trans(self, creds=None, algorithm_name="gss-tsig", + tkey_req_in_answers=False): "Do a TKEY transaction and establish a gensec context" if creds is None: @@ -297,8 +298,12 @@ class DNSTKeyTest(DNSTest): r.rdata = rdata additional = [r] - p.arcount = 1 - p.additional = additional + if tkey_req_in_answers: + p.ancount = 1 + p.answers = additional + else: + p.arcount = 1 + p.additional = additional (response, response_packet) =\ self.dns_transaction_tcp(p, self.server_ip) -- 2.47.2