1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s4-ldap: test the rDN size limit

This commit is contained in:
Andrew Tridgell 2009-10-15 15:54:40 +11:00
parent fdeeafb481
commit 818d98acf1

View File

@ -484,6 +484,30 @@ class BasicTests(unittest.TestCase):
self.delete_force(self.ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
def test_largeRDN(self):
"""Testing large rDN (limit 64 characters)"""
rdn = "CN=a012345678901234567890123456789012345678901234567890123456789012";
self.delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
ldif = """
dn: %s,%s""" % (rdn,self.base_dn) + """
objectClass: container
"""
self.ldb.add_ldif(ldif)
self.delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
rdn = "CN=a0123456789012345678901234567890123456789012345678901234567890120";
self.delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
try:
ldif = """
dn: %s,%s""" % (rdn,self.base_dn) + """
objectClass: container
"""
self.ldb.add_ldif(ldif)
self.fail()
except LdbError, (num, _):
self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
self.delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
def test_rename(self):
"""Tests the rename operation"""
print "Tests the rename operations"""
@ -1848,6 +1872,7 @@ class SchemaTests(unittest.TestCase):
self.assertFalse("objectClasses" in res[0])
self.assertFalse("attributeTypes" in res[0])
def test_schemaUpdateNow(self):
"""Testing schemaUpdateNow"""
class_name = "test-class" + time.strftime("%s", time.gmtime())