summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-15 15:54:40 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-15 15:54:40 +1100
commit818d98acf1c1c80bd6d22868674f750ee704c0fc (patch)
tree7ad55eab87541293f0d9cca65d5eeaf5aae430de /source4/lib/ldb/tests
parentfdeeafb481778ee9ef7e87f8afa046d5f311a769 (diff)
downloadsamba-818d98acf1c1c80bd6d22868674f750ee704c0fc.tar.gz
samba-818d98acf1c1c80bd6d22868674f750ee704c0fc.tar.bz2
samba-818d98acf1c1c80bd6d22868674f750ee704c0fc.zip
s4-ldap: test the rDN size limit
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/python/ldap.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py
index 49aea28f5d..3011b7ed28 100755
--- a/source4/lib/ldb/tests/python/ldap.py
+++ b/source4/lib/ldb/tests/python/ldap.py
@@ -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())