summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-05 22:23:22 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-07 14:22:42 +0200
commit299b59b7c3603642154d78a5e3251926c8ce6e62 (patch)
tree44d9c7ec55b6ec63cc3ebe187447deb6a3a9be2c /source4/dsdb
parent89c71a8f06414a62c04d3460e9b4c9348bfb7fd1 (diff)
downloadsamba-299b59b7c3603642154d78a5e3251926c8ce6e62.tar.gz
samba-299b59b7c3603642154d78a5e3251926c8ce6e62.tar.bz2
samba-299b59b7c3603642154d78a5e3251926c8ce6e62.zip
s4:ldap.py - proof for the impossibility to add a LSA-specific object over LDAP
Diffstat (limited to 'source4/dsdb')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index 6ef8b6c7d0..17100904a0 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -118,11 +118,21 @@ class BasicTests(unittest.TestCase):
self.delete_force(self.ldb, "cn=ldaptestobject," + self.base_dn)
self.delete_force(self.ldb, "description=xyz,cn=users," + self.base_dn)
self.delete_force(self.ldb, "ou=testou,cn=users," + self.base_dn)
+ self.delete_force(self.ldb, "cn=testsecret,cn=system," + self.base_dn)
def test_objectclasses(self):
"""Test objectClass behaviour"""
print "Test objectClass behaviour"""
+ # We cannot create LSA-specific objects (oc "secret" or "trustedDomain")
+ try:
+ self.ldb.add({
+ "dn": "cn=testsecret,cn=system," + self.base_dn,
+ "objectClass": "secret" })
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
# Invalid objectclass specified
try:
self.ldb.add({
@@ -322,6 +332,7 @@ class BasicTests(unittest.TestCase):
self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
self.delete_force(self.ldb, "cn=ldaptestobject," + self.base_dn)
+ self.delete_force(self.ldb, "cn=testsecret,cn=system," + self.base_dn)
def test_invalid_parent(self):
"""Test adding an object with invalid parent"""