summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorZahari Zahariev <zahari.zahariev@postpath.com>2010-11-09 14:55:32 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-11 10:03:40 +0100
commit4fe63d927e5e684d3e2bec9642a1e77b056ab2ed (patch)
treeaff35b130742a5fbc4abda8c5c0abe4ad66ce1fc /source4
parente96c9df817326197a0866a18ad53621405b8bee8 (diff)
downloadsamba-4fe63d927e5e684d3e2bec9642a1e77b056ab2ed.tar.gz
samba-4fe63d927e5e684d3e2bec9642a1e77b056ab2ed.tar.bz2
samba-4fe63d927e5e684d3e2bec9642a1e77b056ab2ed.zip
Cannot create OU using custom Schema class
If we define our own child class 'subClassOf' system Schema class e.g. organizationalUnit then we cannot create OU in the Dafualt Naming Context that has this custom Schama class in the objectClass attribute.
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/dsdb/tests/python/ldap_schema.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py
index 77dd6cc25a..a296b8daaf 100755
--- a/source4/dsdb/tests/python/ldap_schema.py
+++ b/source4/dsdb/tests/python/ldap_schema.py
@@ -205,6 +205,62 @@ name: """ + object_name + """
# Delete the object
self.delete_force(self.ldb, "cn=%s,cn=Users,%s" % (object_name, self.base_dn))
+ def test_subClassOf(self):
+ """ Testing usage of custom child schamaClass
+ """
+
+ class_name = "my-Class" + time.strftime("%s", time.gmtime())
+ class_ldap_display_name = class_name.replace("-", "")
+
+ ldif = """
+dn: CN=%s,%s""" % (class_name, self.schema_dn) + """
+objectClass: top
+objectClass: classSchema
+adminDescription: """ + class_name + """
+adminDisplayName: """ + class_name + """
+cn: """ + class_name + """
+governsId: 1.2.840.""" + str(random.randint(1,100000)) + """.1.5.9939
+instanceType: 4
+objectClassCategory: 1
+subClassOf: organizationalUnit
+systemFlags: 16
+systemOnly: FALSE
+"""
+ self.ldb.add_ldif(ldif)
+
+ # Search for created objectclass
+ res = []
+ res = self.ldb.search("cn=%s,%s" % (class_name, self.schema_dn), scope=SCOPE_BASE, attrs=["*"])
+ self.assertEquals(len(res), 1)
+ self.assertEquals(res[0]["lDAPDisplayName"][0], class_ldap_display_name)
+ self.assertEquals(res[0]["defaultObjectCategory"][0], res[0]["distinguishedName"][0])
+ self.assertTrue("schemaIDGUID" in res[0])
+
+ ldif = """
+dn:
+changetype: modify
+add: schemaUpdateNow
+schemaUpdateNow: 1
+"""
+ self.ldb.modify_ldif(ldif)
+
+ object_name = "org" + time.strftime("%s", time.gmtime())
+
+ ldif = """
+dn: OU=%s,%s""" % (object_name, self.base_dn) + """
+objectClass: """ + class_ldap_display_name + """
+ou: """ + object_name + """
+instanceType: 4
+"""
+ self.ldb.add_ldif(ldif)
+
+ # Search for created object
+ res = []
+ res = self.ldb.search("ou=%s,%s" % (object_name, self.base_dn), scope=SCOPE_BASE, attrs=["*"])
+ self.assertEquals(len(res), 1)
+ # Delete the object
+ self.delete_force(self.ldb, "ou=%s,%s" % (object_name, self.base_dn))
+
class SchemaTests_msDS_IntId(unittest.TestCase):