From: Douglas Bagnall Date: Thu, 17 Jun 2021 11:10:50 +0000 (+1200) Subject: pytest: dns_aging: test RPC updates of disparate types X-Git-Tag: tevent-0.11.0~261 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b24b82336f22570314c8240872213109d80ef641;p=thirdparty%2Fsamba.git pytest: dns_aging: test RPC updates of disparate types Can a TXT record be replaced by an A record in an RPC update? According to Windows, yes. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/dns_aging.py b/python/samba/tests/dns_aging.py index 3219e63151b..49fda672821 100644 --- a/python/samba/tests/dns_aging.py +++ b/python/samba/tests/dns_aging.py @@ -25,7 +25,7 @@ from samba.auth import system_session import ldb from samba import credentials from samba.dcerpc import dns, dnsp, dnsserver -from samba.dnsserver import TXTRecord +from samba.dnsserver import TXTRecord, ARecord from samba.dnsserver import recbuf_from_string from samba.tests.subunitrun import SubunitOptions, TestProgram from samba import werror, WERRORError @@ -1798,6 +1798,21 @@ class TestDNSAging(DNSTest): rec = self.dns_update_record('ldap', 'test') self.assertEqual(rec.dwSerial, 123) + def test_rpc_update_disparate_types(self): + """Can we use update to replace a TXT with an AAAA?""" + name = 'x' + old = TXTRecord("x") + new = ARecord("127.0.0.111") + self.rpc_replace(name, None, old) + recs = self.ldap_get_records(name) + self.assertEqual(len(recs), 1) + self.assertEqual(recs[0].wType, old.wType) + + self.rpc_replace(name, old, new) + recs = self.ldap_get_records(name) + self.assertEqual(len(recs), 1) + self.assertEqual(recs[0].wType, new.wType) + def test_add_update_many(self): # Samba fails often in this set, but we want to see how it # goes further down, so we print the problems and defer the