1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00

pytest/dns_aging: Correctly check that record is tombstoned

We were passing in as the name parameter to assert_tombstoned() an NDR
Python object, rather than a string. This meant that the LDAP search
filter would look something like this:

(&(objectClass=dnsNode)(name=<dnsp.DnssrvRpcRecord talloc based object at 0x29abee0>))

and we would fail to find any records.

These searches should have a better chance of working if we pass in the
name of the record instead.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton
2023-08-29 17:31:14 +12:00
committed by Andrew Bartlett
parent 8e5c998b1d
commit 472d80c1c9

View File

@@ -2162,7 +2162,7 @@ class TestDNSAging(DNSTest):
self.assertEqual(r.ancount, 0)
recs = self.ldap_get_records(D)
self.assertEqual(len(recs), 1)
self.assert_tombstoned(recs[0])
self.assert_tombstoned(D)
# others unchanged.
atime = self.get_unique_txt_record(A, A).dwTimeStamp
@@ -2182,17 +2182,17 @@ class TestDNSAging(DNSTest):
dsdb._dns_delete_tombstones(file_samdb)
recs = self.ldap_get_records(D)
self.assertEqual(len(recs), 1)
self.assert_tombstoned(recs[0])
self.assert_tombstoned(D)
# Let's delete C using rpc, and ensure it survives dns_delete_tombstones
self.rpc_delete_txt(C, C)
recs = self.ldap_get_records(C)
self.assertEqual(len(recs), 1)
self.assert_tombstoned(recs[0])
self.assert_tombstoned(C)
dsdb._dns_delete_tombstones(file_samdb)
recs = self.ldap_get_records(C)
self.assertEqual(len(recs), 1)
self.assert_tombstoned(recs[0])
self.assert_tombstoned(C)
# now let's wind A and B back to either side of the two week
# threshold. A should survive, B should not.
@@ -2202,7 +2202,7 @@ class TestDNSAging(DNSTest):
recs = self.ldap_get_records(A)
self.assertEqual(len(recs), 1)
self.assert_tombstoned(recs[0])
self.assert_tombstoned(A)
recs = self.ldap_get_records(B)
self.assertEqual(len(recs), 0)