tests/dns: remove formerly segfaulting test
authorGarming Sam <garming@catalyst.net.nz>
Tue, 15 Dec 2015 04:22:32 +0000 (17:22 +1300)
committerGarming Sam <garming@catalyst.net.nz>
Fri, 18 Dec 2015 00:27:51 +0000 (13:27 +1300)
This was on the client side, due the a strlen(NULL) on the previously
DOS-encoded TXT field. With a new IDL structure, this segfault no longer
exists.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
python/samba/tests/dns.py

index 044eaf64e9ffba314c6404f61dd35e20059c5fa8..8222218779b112f22b43c0528d9e497b492b4bf9 100644 (file)
@@ -340,32 +340,32 @@ class TestDNSUpdates(DNSTest):
         response = self.dns_transaction_udp(p)
         self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR)
 
-# I'd love to test this one, but it segfaults. :)
-#    def test_update_prereq_with_non_null_length(self):
-#        "test update with a non-null length"
-#        p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
-#        updates = []
-#
-#        name = self.get_dns_domain()
-#
-#        u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
-#        updates.append(u)
-#        self.finish_name_packet(p, updates)
-#
-#        prereqs = []
-#        r = dns.res_rec()
-#        r.name = "%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
-#        r.rr_type = dns.DNS_QTYPE_TXT
-#        r.rr_class = dns.DNS_QCLASS_ANY
-#        r.ttl = 0
-#        r.length = 1
-#        prereqs.append(r)
-#
-#        p.ancount = len(prereqs)
-#        p.answers = prereqs
-#
-#        response = self.dns_transaction_udp(p)
-#        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR)
+    # I'd love to test this one, but it segfaults. :)
+    def test_update_prereq_with_non_null_length(self):
+        "test update with a non-null length"
+        p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+        updates = []
+
+        name = self.get_dns_domain()
+
+        u = self.make_name_question(name, dns.DNS_QTYPE_SOA, dns.DNS_QCLASS_IN)
+        updates.append(u)
+        self.finish_name_packet(p, updates)
+
+        prereqs = []
+        r = dns.res_rec()
+        r.name = "%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
+        r.rr_type = dns.DNS_QTYPE_TXT
+        r.rr_class = dns.DNS_QCLASS_ANY
+        r.ttl = 0
+        r.length = 1
+        prereqs.append(r)
+
+        p.ancount = len(prereqs)
+        p.answers = prereqs
+
+        response = self.dns_transaction_udp(p)
+        self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR)
 
     def test_update_prereq_nonexisting_name(self):
         "test update with a nonexisting name"