diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-07-28 18:09:37 +1000 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2014-08-07 18:54:28 +0200 |
commit | 93c30e2d685fac83cd5d48c3ad80a18b34cf3a2d (patch) | |
tree | 0628de1279f768e8b59a13afdf54ce30490a39f4 /python | |
parent | 6f46d801eece8a625428e3b64505acc82875d37c (diff) | |
download | samba-93c30e2d685fac83cd5d48c3ad80a18b34cf3a2d.tar.gz |
tests: dnsserver: Add a update test with name set to '.'
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jul 29 19:33:19 CEST 2014 on sn-devel-104
(cherry picked from commit 6d104182d9667e4f996439d24cfa052f34098ce4)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10742
samba-tool dns add 172.31.9.161 s4xdom.base . NS mydns.org. => NO_MEMORY
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Thu Aug 7 18:54:28 CEST 2014 on sn-devel-104
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/tests/dcerpc/dnsserver.py | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/python/samba/tests/dcerpc/dnsserver.py b/python/samba/tests/dcerpc/dnsserver.py index 59d6eee761..e2c666727d 100644 --- a/python/samba/tests/dcerpc/dnsserver.py +++ b/python/samba/tests/dcerpc/dnsserver.py @@ -19,7 +19,7 @@ from samba.dcerpc import dnsp, dnsserver from samba.tests import RpcInterfaceTestCase, env_get_var_value -from samba.netcmd.dns import ARecord +from samba.netcmd.dns import ARecord, NSRecord class DnsserverTests(RpcInterfaceTestCase): @@ -239,3 +239,42 @@ class DnsserverTests(RpcInterfaceTestCase): select_flags, None, None) + + def test_updaterecords2_soa(self): + client_version = dnsserver.DNS_CLIENT_VERSION_LONGHORN + record_type = dnsp.DNS_TYPE_NS + select_flags = (dnsserver.DNS_RPC_VIEW_AUTHORITY_DATA | + dnsserver.DNS_RPC_VIEW_NO_CHILDREN) + + nameserver = 'ns.example.local' + rec = NSRecord(nameserver) + + # Add record + add_rec_buf = dnsserver.DNS_RPC_RECORD_BUF() + add_rec_buf.rec = rec + self.conn.DnssrvUpdateRecord2(client_version, + 0, + self.server, + self.zone, + '.', + add_rec_buf, + None) + + buflen, result = self.conn.DnssrvEnumRecords2(client_version, + 0, + self.server, + self.zone, + '@', + None, + record_type, + select_flags, + None, + None) + self.assertEquals(1, result.count) + self.assertEquals(2, result.rec[0].wRecordCount) + match = False + for i in range(2): + self.assertEquals(dnsp.DNS_TYPE_NS, result.rec[0].records[i].wType) + if result.rec[0].records[i].data.str.rstrip('.') == nameserver: + match = True + self.assertEquals(match, True) |