s4:ldap.py Add tests for subSchemaSubEntry
authorAndrew Bartlett <abartlet@samba.org>
Mon, 23 Nov 2009 23:18:33 +0000 (10:18 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 23 Nov 2009 23:39:10 +0000 (10:39 +1100)
source4/lib/ldb/tests/python/ldap.py

index 94bdf7e37d09838d344335e3f7b5c4fc9315cfee..52f3947b8de557e396ca988f532086e421624600 100755 (executable)
@@ -819,6 +819,18 @@ objectClass: container
         res2 = self.ldb.search(scope=SCOPE_BASE, attrs=["wellKnownObjects"], expression=("wellKnownObjects=%s") % res[0].dn)
         self.assertEquals(len(res2), 0)
 
+    def test_subschemasubentry(self):
+        """Test subSchemaSubEntry appears when requested, but not when not requested"""
+        print "Test subSchemaSubEntry"""
+
+        res = self.ldb.search(base=self.base_dn, scope=SCOPE_BASE, attrs=["subSchemaSubEntry"])
+        self.assertEquals(len(res), 1)
+        self.assertEquals(res[0]["subSchemaSubEntry"][0], "CN=Aggregate,"+self.schema_dn)
+
+        res = self.ldb.search(base=self.base_dn, scope=SCOPE_BASE, attrs=["*"])
+        self.assertEquals(len(res), 1)
+        self.assertTrue("subScheamSubEntry" not in res[0])
+
     def test_all(self):
         """Basic tests"""