]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests/dns_base: let tkey_trans() take tkey_req_in_answers
authorStefan Metzmacher <metze@samba.org>
Wed, 29 May 2024 12:08:13 +0000 (14:08 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 6 Jun 2024 02:13:33 +0000 (02:13 +0000)
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 <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dns_base.py

index f0e6b835cf5d79f6267a3ad84c9940b32c3d9d0a..07e5e1b3b8393c76c353dbee21c42a477daf2c4b 100644 (file)
@@ -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)