summaryrefslogtreecommitdiff
path: root/python/samba/tests/dns.py
diff options
context:
space:
mode:
authorAaron Haslett <aaronhaslett@catalyst.net.nz>2018-06-07 16:51:37 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-07-12 04:31:56 +0200
commitf0210f5d17f27641bccb651313f30087d53c6ef0 (patch)
treec02b28e75f0c69bdfcec63fdd4f7eb2f5392eebb /python/samba/tests/dns.py
parent8ef42d4dab4dfaf5ad225b33f7748914f14dcd8c (diff)
downloadsamba-f0210f5d17f27641bccb651313f30087d53c6ef0.tar.gz
dns: static records
Modifies bind9 and internal dns to match windows static records behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10812 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/tests/dns.py')
-rw-r--r--python/samba/tests/dns.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index faf4c524076..508d49f47d8 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -1093,6 +1093,42 @@ class TestZones(DNSTest):
self.assertEqual(len(recs), 1)
self.assertEqual(recs[0].dwTimeStamp, 0)
+ def test_static_record_dynamic_update(self):
+ name,txt = 'agingtest', ['test txt']
+ txt2 = ['test txt2']
+ self.set_aging(enable=True)
+ rec_buf = dnsserver.DNS_RPC_RECORD_BUF()
+ rec_buf.rec = TXTRecord(txt)
+ self.rpc_conn.DnssrvUpdateRecord2(dnsserver.DNS_CLIENT_VERSION_LONGHORN,
+ 0, self.server_ip,
+ self.zone, name, rec_buf, None)
+
+ rec2 = self.dns_update_record(name, txt2)
+ self.assertEqual(rec2.dwTimeStamp, 0)
+
+ def test_dynamic_record_static_update(self):
+ name,txt = 'agingtest', ['test txt']
+ txt2 = ['test txt2']
+ txt3 = ['test txt3']
+ self.set_aging(enable=True)
+
+ self.dns_update_record(name, txt)
+
+ rec_buf = dnsserver.DNS_RPC_RECORD_BUF()
+ rec_buf.rec = TXTRecord(txt2)
+ self.rpc_conn.DnssrvUpdateRecord2(dnsserver.DNS_CLIENT_VERSION_LONGHORN,
+ 0, self.server_ip,
+ self.zone, name, rec_buf, None)
+
+ self.dns_update_record(name, txt3)
+
+ recs = self.ldap_get_dns_records(name)
+ # Put in dict because ldap recs might be out of order
+ recs = {str(r.data.str):r for r in recs}
+ self.assertNotEqual(recs[str(txt)].dwTimeStamp, 0)
+ self.assertEqual(recs[str(txt2)].dwTimeStamp, 0)
+ self.assertEqual(recs[str(txt3)].dwTimeStamp, 0)
+
def test_dns_tombstone_custom_match_rule(self):
lp = self.get_loadparm()
self.samdb = SamDB(url = lp.samdb_url(), lp = lp,