From f65360840a43616d870b0f26925067f248aa6376 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 Nov 2009 18:39:58 +1100 Subject: s4:ldap.py Add test of namingContext behaviour after tridge found a bug Tridge found that the partitions.c module was being initialised twice, and setting the partitions into the rootDSE twice. Andrew Bartlett --- source4/lib/ldb/tests/python/ldap.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source4') diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index 0292422741..384e69e9bd 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -1923,6 +1923,21 @@ class BaseDnTests(unittest.TestCase): attrs=["netlogon", "highestCommittedUSN"]) self.assertEquals(len(res), 0) + def test_namingContexts(self): + """Testing for namingContexts in rootDSE""" + res = self.ldb.search("", scope=SCOPE_BASE, + attrs=["namingContexts", "defaultNamingContext", "schemaNamingContext", "configurationNamingContext"]) + self.assertEquals(len(res), 1) + + ncs = set([]) + for nc in res[0]["namingContexts"]: + self.assertTrue(nc not in ncs) + ncs.add(nc) + + self.assertTrue(res[0]["defaultNamingContext"][0] in ncs) + self.assertTrue(res[0]["configurationNamingContext"][0] in ncs) + self.assertTrue(res[0]["schemaNamingContext"][0] in ncs) + class SchemaTests(unittest.TestCase): def delete_force(self, ldb, dn): try: -- cgit