summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2014-02-28 10:35:07 +0100
committerKarolin Seeger <kseeger@samba.org>2014-04-01 09:08:07 +0200
commitcd208b2605d9b68ab37cba1ab64798c05fb59357 (patch)
tree33831551a5ef65f2fc1dadf162c25f9e921347c4
parent7bac6e022a1bc966c4b7128048d7faa48c524348 (diff)
downloadsamba-cd208b2605d9b68ab37cba1ab64798c05fb59357.tar.gz
dns: Extend tests for records with another type
Add another check to the one added for bug #10471, for added paranoia Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Kai Blin <kai@samba.org> Autobuild-Date(master): Tue Mar 4 15:47:10 CET 2014 on sn-devel-104 (cherry picked from commit 5bd47bb563c3736b9de1a3a93bdf46a498928643)
-rw-r--r--python/samba/tests/dns.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index bac8deabddc..f2c5685b3f0 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -187,6 +187,20 @@ class TestSimpleQueries(DNSTest):
self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
self.assertEquals(response.ancount, 0)
+ p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+ questions = []
+
+ name = "invalid-%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
+ q = self.make_name_question(name, dns.DNS_QTYPE_MX, dns.DNS_QCLASS_IN)
+ print "asking for ", q.name
+ questions.append(q)
+
+ self.finish_name_packet(p, questions)
+ response = self.dns_transaction_udp(p)
+ self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NXDOMAIN)
+ self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+ self.assertEquals(response.ancount, 0)
+
def test_two_queries(self):
"create a query packet containing two query records"
p = self.make_name_packet(dns.DNS_OPCODE_QUERY)