samba-tool/tests: Check that dns cleanup does not spuriously remove entries
[samba.git] / python / samba / tests / samba_tool / dnscmd.py
index 780af4f8bd064798288b4e3308cfdbc8c0bbacfe..bcd2c73981bfee42571abe127a6c658f8215d95b 100644 (file)
@@ -800,7 +800,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
             base="DC=DomainDnsZones,{}".format(self.samdb.get_default_basedn()),
             scope=ldb.SCOPE_SUBTREE,
             expression="(&(objectClass=dnsNode)(name={}))".format(srv_name),
-            attrs=['dnsRecord'])
+            attrs=['dnsRecord', 'dNSTombstoned'])
 
         # dnsRecord for host1 should be deleted
         self.assertEqual(len(records[0]['dnsRecord']), 1)
@@ -813,6 +813,10 @@ class DnsCmdTestCase(SambaToolCmdTest):
         dnshostname2 = 'host2.{}'.format(self.zone.lower())
         self.assertEqual(dns_record_obj.data.nameTarget, dnshostname2)
 
+        # assert that the record isn't spuriously tombstoned
+        self.assertTrue('dNSTombstoned' not in records[0] or
+                        str(record['dNSTombstoned']) == 'FALSE')
+
     def test_dns_wildcards(self):
         """
         Ensure that DNS wild card entries can be added deleted and queried