summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2011-12-03 19:08:09 +0100
committerKai Blin <kai@samba.org>2011-12-03 20:52:51 +0100
commitc326b37358260ba4f3a95463acdbf02ddae0ab97 (patch)
tree45e084b5301e87066d0855c9bfa2ac956817cde9
parent05bc4de083b993e3db06fdb2a3e1198021526a71 (diff)
downloadsamba-c326b37358260ba4f3a95463acdbf02ddae0ab97.tar.gz
samba-c326b37358260ba4f3a95463acdbf02ddae0ab97.tar.bz2
samba-c326b37358260ba4f3a95463acdbf02ddae0ab97.zip
s4 dns: Test SOA queries
Autobuild-User: Kai Blin <kai@samba.org> Autobuild-Date: Sat Dec 3 20:52:51 CET 2011 on sn-devel-104
-rw-r--r--source4/scripting/python/samba/tests/dns.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py
index df10b715ef..9f5322578b 100644
--- a/source4/scripting/python/samba/tests/dns.py
+++ b/source4/scripting/python/samba/tests/dns.py
@@ -154,6 +154,38 @@ class DNSTest(TestCase):
response = self.dns_transaction_udp(p)
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NOTIMP)
+# Only returns an authority section entry in BIND and Win DNS
+# FIXME: Enable one Samba implements this feature
+# def test_soa_hostname_query(self):
+# "create a SOA query for a hostname"
+# 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_SOA, dns.DNS_QCLASS_IN)
+# questions.append(q)
+#
+# self.finish_name_packet(p, questions)
+# response = self.dns_transaction_udp(p)
+# self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+# self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+# # We don't get SOA records for single hosts
+# self.assertEquals(response.ancount, 0)
+
+ def test_soa_domain_query(self):
+ "create a SOA query for a domain"
+ p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+ questions = []
+
+ name = self.get_dns_domain()
+ q = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+ questions.append(q)
+
+ self.finish_name_packet(p, questions)
+ response = self.dns_transaction_udp(p)
+ self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+ self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+ self.assertEquals(response.ancount, 1)
if __name__ == "__main__":
import unittest