From 358a81eff5279a69270964226b553fb5243ecb84 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 9 Dec 2011 01:14:35 +0100 Subject: s4 dns: Add test to prove two updates in one packet are a FORMERR --- source4/scripting/python/samba/tests/dns.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4/scripting/python') diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py index 9f5322578b..c95148b70e 100644 --- a/source4/scripting/python/samba/tests/dns.py +++ b/source4/scripting/python/samba/tests/dns.py @@ -187,6 +187,24 @@ class DNSTest(TestCase): self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY) self.assertEquals(response.ancount, 1) + def test_two_updates(self): + "create two update requests" + p = self.make_name_packet(dns.DNS_OPCODE_UPDATE) + updates = [] + + name = "%s.%s" % (os.getenv('DC_SERVER'), self.get_dns_domain()) + u = self.make_name_question(name, dns.DNS_QTYPE_A, dns.DNS_QCLASS_IN) + updates.append(u) + + name = self.get_dns_domain() + u = self.make_name_question(name, dns.DNS_QTYPE_A, dns.DNS_QCLASS_IN) + updates.append(u) + + self.finish_name_packet(p, updates) + response = self.dns_transaction_udp(p) + self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR) + + if __name__ == "__main__": import unittest unittest.main() -- cgit