diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-06 20:47:51 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-06 21:10:40 +0100 |
commit | 39ed810feb8b042faedaf7bc836f34162ce5fb67 (patch) | |
tree | c8f9182c4a87556e2722e392b75df53dea339955 /source4/dsdb/tests | |
parent | acb8a8d3304c8060e6039eac53a564d86331e264 (diff) | |
download | samba-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.
Diffstat (limited to 'source4/dsdb/tests')
-rwxr-xr-x | source4/dsdb/tests/python/ldap.py | 24 |
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( |