summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-07-09 19:22:01 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-01 09:36:01 +0200
commit81cc92c5af1a6e8c140e5c388d610f9061ca86db (patch)
treec1524fdd9f33f4e95dc90113c99700219adcd3f4 /source4/dsdb/tests/python
parent3cdc83d4f9a67011cfa51b242cb84f3f6b59e226 (diff)
downloadsamba-81cc92c5af1a6e8c140e5c388d610f9061ca86db.tar.gz
samba-81cc92c5af1a6e8c140e5c388d610f9061ca86db.tar.bz2
samba-81cc92c5af1a6e8c140e5c388d610f9061ca86db.zip
s4:ldap.py - performs some "systemFlags" testing
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py56
1 files changed, 56 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index de8e89b7f8..9911d5d249 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -890,6 +890,53 @@ objectClass: container
self.delete_force(self.ldb, "cn=ldaptestuser3,cn=users," + self.base_dn)
+ # Performs some "systemFlags" testing
+
+ # Move failing since no "SYSTEM_FLAG_CONFIG_ALLOW_MOVE"
+ try:
+ ldb.rename("CN=DisplaySpecifiers," + self.configuration_dn, "CN=DisplaySpecifiers,CN=Services," + self.configuration_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # Limited move failing since no "SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE"
+ try:
+ ldb.rename("CN=Directory Service,CN=Windows NT,CN=Services," + self.configuration_dn, "CN=Directory Service,CN=RRAS,CN=Services," + self.configuration_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # Rename failing since no "SYSTEM_FLAG_CONFIG_ALLOW_RENAME"
+ try:
+ ldb.rename("CN=DisplaySpecifiers," + self.configuration_dn, "CN=DisplaySpecifiers2," + self.configuration_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # It's not really possible to test moves on the schema partition since
+ # there don't exist subcontainers on it.
+
+ # Rename failing since "SYSTEM_FLAG_SCHEMA_BASE_OBJECT"
+ try:
+ ldb.rename("CN=Top," + self.schema_dn, "CN=Top2," + self.schema_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # Move failing since "SYSTEM_FLAG_DOMAIN_DISALLOW_MOVE"
+ try:
+ ldb.rename("CN=Users," + self.base_dn, "CN=Users,CN=Computers," + self.base_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # Rename failing since "SYSTEM_FLAG_DOMAIN_DISALLOW_RENAME"
+ try:
+ ldb.rename("CN=Users," + self.base_dn, "CN=Users2," + self.base_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
def test_rename_twice(self):
"""Tests the rename operation twice - this corresponds to a past bug"""
print "Tests the rename twice operation"""
@@ -1560,6 +1607,15 @@ objectClass: container
self.delete_force(self.ldb, "cn=entry2,cn=ldaptestcontainer," + self.base_dn)
self.delete_force(self.ldb, "cn=ldaptestcontainer," + self.base_dn)
+ # Performs some "systemFlags" testing
+
+ # Delete failing since "SYSTEM_FLAG_DISALLOW_DELETE"
+ try:
+ ldb.delete("CN=Users," + self.base_dn)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
def test_all(self):
"""Basic tests"""