summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-01 15:23:48 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-03 16:20:55 +0000
commit9d4eeaeb194d071f02b19aaca3ad1b89d81d3637 (patch)
tree179cdedb7e17367a03b939a2d99a8a9da5316205 /source4/dsdb/tests/python
parentd873fb72bc3f7b410a66f98b5045101292718717 (diff)
downloadsamba-9d4eeaeb194d071f02b19aaca3ad1b89d81d3637.tar.gz
samba-9d4eeaeb194d071f02b19aaca3ad1b89d81d3637.tar.bz2
samba-9d4eeaeb194d071f02b19aaca3ad1b89d81d3637.zip
s4:objectclass LDB module - the structural objectclass has always to be specified
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed Nov 3 16:20:55 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index e8bc625807..36c12a2930 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -152,6 +152,15 @@ class BasicTests(unittest.TestCase):
try:
self.ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
+ "objectClass": [] })
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
+
+ # Invalid objectclass specified
+ try:
+ self.ldb.add({
+ "dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "X" })
self.fail()
except LdbError, (num, _):
@@ -304,6 +313,16 @@ class BasicTests(unittest.TestCase):
except LdbError, (num, _):
self.assertEquals(num, ERR_OBJECT_CLASS_VIOLATION)
+ # We cannot remove all object classes by an empty replace
+ m = Message()
+ m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn)
+ m["objectClass"] = MessageElement([], FLAG_MOD_REPLACE, "objectClass")
+ try:
+ ldb.modify(m)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_OBJECT_CLASS_VIOLATION)
+
m = Message()
m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn)
m["objectClass"] = MessageElement(["top", "computer"], FLAG_MOD_REPLACE,