summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python/ldap.py
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-09-17 10:47:08 +0200
committerAndrew Bartlett <abartlet@samba.org>2010-09-24 09:25:43 +1000
commit9123bcbf77260551bd2b97e93445ae0e67ad89a3 (patch)
tree67079c9c6ed901da5edc267474eeeb6905890622 /source4/dsdb/tests/python/ldap.py
parent76c346dfc186faf2bc75ecd37b71b182d24e71f4 (diff)
downloadsamba-9123bcbf77260551bd2b97e93445ae0e67ad89a3.tar.gz
samba-9123bcbf77260551bd2b97e93445ae0e67ad89a3.tar.bz2
samba-9123bcbf77260551bd2b97e93445ae0e67ad89a3.zip
s4:ldap.py - add tests for the "dsServiceName", "serverName", "dnsHostName" and "ldapServiceName" rootDSE attributes
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/tests/python/ldap.py')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index 82b5de2147..e4c163304f 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -2979,6 +2979,40 @@ class BaseDnTests(unittest.TestCase):
self.assertTrue(res[0]["configurationNamingContext"][0] in ncs)
self.assertTrue(res[0]["schemaNamingContext"][0] in ncs)
+ def test_serverPath(self):
+ """Testing the server paths in rootDSE"""
+ res = self.ldb.search("", scope=SCOPE_BASE,
+ attrs=["dsServiceName", "serverName"])
+ self.assertEquals(len(res), 1)
+
+ self.assertTrue("CN=Servers" in res[0]["dsServiceName"][0])
+ self.assertTrue("CN=Sites" in res[0]["dsServiceName"][0])
+ self.assertTrue("CN=NTDS Settings" in res[0]["dsServiceName"][0])
+ self.assertTrue("CN=Servers" in res[0]["serverName"][0])
+ self.assertTrue("CN=Sites" in res[0]["serverName"][0])
+ self.assertFalse("CN=NTDS Settings" in res[0]["serverName"][0])
+
+ def test_dnsHostname(self):
+ """Testing the DNS hostname in rootDSE"""
+ res = self.ldb.search("", scope=SCOPE_BASE,
+ attrs=["dnsHostName", "serverName"])
+ self.assertEquals(len(res), 1)
+
+ res2 = self.ldb.search(res[0]["serverName"][0], scope=SCOPE_BASE,
+ attrs=["dNSHostName"])
+ self.assertEquals(len(res2), 1)
+
+ self.assertEquals(res[0]["dnsHostName"][0], res2[0]["dNSHostName"][0])
+
+ def test_ldapServiceName(self):
+ """Testing the ldap service name in rootDSE"""
+ res = self.ldb.search("", scope=SCOPE_BASE,
+ attrs=["ldapServiceName", "dNSHostName"])
+ self.assertEquals(len(res), 1)
+
+ (hostname, _, dns_domainname) = res[0]["dNSHostName"][0].partition(".")
+ self.assertTrue(":%s$@%s" % (hostname, dns_domainname.upper())
+ in res[0]["ldapServiceName"][0])
if not "://" in host:
if os.path.isfile(host):