summaryrefslogtreecommitdiff
path: root/source4/scripting/python
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-11-24 12:11:26 +0100
committerKai Blin <kai@samba.org>2011-11-24 12:35:08 +0100
commit8685a35e9c3ce9d84ef8c1b9af12213701e50fa8 (patch)
treeb7f37a7002bb7beb3cb05f9fe68553a364cde5d8 /source4/scripting/python
parent16d9ebb396db2552de77706b644f299a3c2be79d (diff)
downloadsamba-8685a35e9c3ce9d84ef8c1b9af12213701e50fa8.tar.gz
samba-8685a35e9c3ce9d84ef8c1b9af12213701e50fa8.tar.bz2
samba-8685a35e9c3ce9d84ef8c1b9af12213701e50fa8.zip
s4 dns: Test QTYPE_ALL query
Diffstat (limited to 'source4/scripting/python')
-rw-r--r--source4/scripting/python/samba/tests/dns.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py
index ad0b55a7f8..5da96bc0e0 100644
--- a/source4/scripting/python/samba/tests/dns.py
+++ b/source4/scripting/python/samba/tests/dns.py
@@ -115,6 +115,31 @@ class DNSTest(TestCase):
response = self.dns_transaction_udp(p)
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR)
+ def test_qtype_all_query(self):
+ "create a QTYPE_ALL query"
+ p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+ questions = []
+
+ name = "%s.%s" % (os.getenv('DC_SERVER'), self.get_dns_domain())
+ q = self.make_name_question(name, dns.DNS_QTYPE_ALL, dns.DNS_QCLASS_IN)
+ print "asking for ", q.name
+ questions.append(q)
+
+ self.finish_name_packet(p, questions)
+ response = self.dns_transaction_udp(p)
+
+ num_answers = 1
+ dc_ipv6 = os.getenv('DC_SERVER_IPV6')
+ if dc_ipv6 is not None:
+ num_answers += 1
+
+ self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+ self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+ self.assertEquals(response.ancount, num_answers)
+ self.assertEquals(response.answers[0].rdata,
+ os.getenv('DC_SERVER_IP'))
+ if dc_ipv6 is not None:
+ self.assertEquals(response.answers[1].rdata, dc_ipv6)
if __name__ == "__main__":
import unittest