From c7d0e6f39b15e54264dff2a897256f6bf9736333 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Wed, 31 Jan 2018 16:13:14 +1300 Subject: [PATCH] samba-tool/tests: Check that dns cleanup does not spuriously remove entries This might happen in the multi-record case. Signed-off-by: Garming Sam Reviewed-by: Douglas Bagnall Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Feb 8 10:00:13 CET 2018 on sn-devel-144 --- python/samba/tests/samba_tool/dnscmd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/samba/tests/samba_tool/dnscmd.py b/python/samba/tests/samba_tool/dnscmd.py index 780af4f8bd0..bcd2c73981b 100644 --- a/python/samba/tests/samba_tool/dnscmd.py +++ b/python/samba/tests/samba_tool/dnscmd.py @@ -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 -- 2.47.3