summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-06 20:47:51 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-11-06 21:10:40 +0100
commit39ed810feb8b042faedaf7bc836f34162ce5fb67 (patch)
treec8f9182c4a87556e2722e392b75df53dea339955
parentacb8a8d3304c8060e6039eac53a564d86331e264 (diff)
downloadsamba-39ed810feb8b042faedaf7bc836f34162ce5fb67.tar.gz
samba-39ed810feb8b042faedaf7bc836f34162ce5fb67.tar.bz2
samba-39ed810feb8b042faedaf7bc836f34162ce5fb67.zip
s4:ldap.py - enhance the "distinguishedName" tests
The "dn" shortcut isn't supported by AD.
-rwxr-xr-xsource4/dsdb/tests/python/ldap.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py
index c3a4087fdb..b4fe8cd2ee 100755
--- a/source4/dsdb/tests/python/ldap.py
+++ b/source4/dsdb/tests/python/ldap.py
@@ -965,6 +965,18 @@ class BasicTests(unittest.TestCase):
"""Tests the 'distinguishedName' attribute"""
print "Tests the 'distinguishedName' attribute"""
+ # The "dn" shortcut isn't supported
+ m = Message()
+ m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
+ m["objectClass"] = MessageElement("group", 0, "objectClass")
+ m["dn"] = MessageElement("cn=ldaptestgroup,cn=users," + self.base_dn, 0,
+ "dn")
+ try:
+ ldb.add(m)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_NO_SUCH_ATTRIBUTE)
+
# a wrong "distinguishedName" attribute is obviously tolerated
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
@@ -979,6 +991,18 @@ class BasicTests(unittest.TestCase):
self.assertTrue(Dn(ldb, res[0]["distinguishedName"][0])
== Dn(ldb, "cn=ldaptestgroup, cn=users," + self.base_dn))
+ # The "dn" shortcut isn't supported
+ m = Message()
+ m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
+ m["dn"] = MessageElement(
+ "cn=ldaptestgroup,cn=users," + self.base_dn, FLAG_MOD_REPLACE,
+ "dn")
+ try:
+ ldb.modify(m)
+ self.fail()
+ except LdbError, (num, _):
+ self.assertEquals(num, ERR_NO_SUCH_ATTRIBUTE)
+
m = Message()
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["distinguishedName"] = MessageElement(