summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-13 12:25:40 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-13 12:32:34 +0100
commit113a9c1806863f9794c3a611ed4c4d910c3bf11b (patch)
treee02f18787efae6e3ce89d7a0cee81261fec19901 /source4/dsdb/tests/python
parentb9cfe109453937f5c2ae5008bee4b12226d68914 (diff)
downloadsamba-113a9c1806863f9794c3a611ed4c4d910c3bf11b.tar.gz
samba-113a9c1806863f9794c3a611ed4c4d910c3bf11b.tar.bz2
samba-113a9c1806863f9794c3a611ed4c4d910c3bf11b.zip
s4:objectclass LDB module - multiple "objectClass" change elements are unfortunately still allowed
The test message has been compressed - therefore I've now used "modify_ldif".
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py21
1 files changed, 9 insertions, 12 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index 0ac57d5247..00cc450109 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -310,18 +310,15 @@ class BasicTests(unittest.TestCase):
except LdbError, (num, _):
self.assertEquals(num, ERR_OBJECT_CLASS_VIOLATION)
- # More than one change operation is not allowed
- m = Message()
- m.dn = Dn(ldb, "cn=ldaptestuser,cn=users," + self.base_dn)
- m["objectClass"] = MessageElement("bootableDevice", FLAG_MOD_DELETE,
- "objectClass")
- m["objectClass"] = MessageElement("bootableDevice", FLAG_MOD_ADD,
- "objectClass")
- try:
- ldb.modify(m)
- self.fail()
- except LdbError, (num, _):
- self.assertEquals(num, ERR_ATTRIBUTE_OR_VALUE_EXISTS)
+ # More than one change operation is allowed
+ ldb.modify_ldif("""
+dn: cn=ldaptestuser,cn=users, """ + self.base_dn + """
+changetype: modify
+delete: objectClass
+objectClass: bootableDevice
+add: objectClass
+objectClass: bootableDevice
+""")
# We cannot remove all object classes by an empty replace
m = Message()