s4:ldap.py Add test of namingContext behaviour after tridge found a bug
authorAndrew Bartlett <abartlet@samba.org>
Mon, 30 Nov 2009 07:39:58 +0000 (18:39 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 1 Dec 2009 01:17:00 +0000 (12:17 +1100)
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

index 029242274134c5e12d81ebff795d18da67f5e0ab..384e69e9bdca6455bb734531e52e8938b59bb20d 100755 (executable)
@@ -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: