summaryrefslogtreecommitdiff
path: root/source4/dsdb/tests/python
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-01 21:12:50 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-08-01 21:30:30 +0200
commite92f44782385be5315daa77f7821296f96ea729d (patch)
tree59a86366007d79bff782646ae3f1afc96319cb30 /source4/dsdb/tests/python
parentc38219adfc12828d436bd46b17107feba619aa55 (diff)
downloadsamba-e92f44782385be5315daa77f7821296f96ea729d.tar.gz
samba-e92f44782385be5315daa77f7821296f96ea729d.tar.bz2
samba-e92f44782385be5315daa77f7821296f96ea729d.zip
s4:ldap.py - additional "instanceType" checks
Diffstat (limited to 'source4/dsdb/tests/python')
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index ea0aa3a3f9..728c537015 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -658,6 +658,7 @@ class BasicTests(unittest.TestCase):
"""Tests the 'instanceType' attribute"""
print "Tests the 'instanceType' attribute"""
+ # The instance type is single-valued
try:
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
@@ -667,6 +668,28 @@ class BasicTests(unittest.TestCase):
except LdbError, (num, _):
self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+ # The head NC flag cannot be set without the write flag
+ try:
+ self.ldb.add({
+ "dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
+ "objectclass": "group",
+ "instanceType": "1" })
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+ # We cannot manipulate NCs without the head NC flag
+ try:
+ self.ldb.add({
+ "dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
+ "objectclass": "group",
+ "instanceType": "32" })
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
+
+
+
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})