summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-01-03 19:53:01 +0100
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-01-05 20:55:45 +0100
commitbbf988501352801f88c714a67e5ab2b9d19a7af1 (patch)
treed70ea5f2ddb6f147e55a1883ca0479c8dcf2eb76
parentd8ca002a8c7b56712aeaadc19885f70d762ac059 (diff)
downloadsamba-bbf988501352801f88c714a67e5ab2b9d19a7af1.tar.gz
samba-bbf988501352801f88c714a67e5ab2b9d19a7af1.tar.bz2
samba-bbf988501352801f88c714a67e5ab2b9d19a7af1.zip
s4:ldap_schema.py - add an additional check for validity of "defaultObjectCategory"
-rwxr-xr-xsource4/lib/ldb/tests/python/ldap_schema.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/ldap_schema.py b/source4/lib/ldb/tests/python/ldap_schema.py
index 9dd9240414..9e54732104 100755
--- a/source4/lib/ldb/tests/python/ldap_schema.py
+++ b/source4/lib/ldb/tests/python/ldap_schema.py
@@ -142,6 +142,31 @@ systemOnly: FALSE
class_name = "test-Class" + time.strftime("%s", time.gmtime())
class_ldap_display_name = class_name.replace("-", "")
+ # First try to create a class with a wrong "defaultObjectCategory"
+ ldif = """
+dn: CN=%s,%s""" % (class_name, self.schema_dn) + """
+objectClass: top
+objectClass: classSchema
+defaultObjectCategory: CN=_
+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: organizationalPerson
+systemFlags: 16
+rDNAttID: cn
+systemMustContain: cn
+systemMustContain: """ + attr_ldap_display_name + """
+systemOnly: FALSE
+"""
+ try:
+ self.ldb.add_ldif(ldif)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
+
ldif = """
dn: CN=%s,%s""" % (class_name, self.schema_dn) + """
objectClass: top