diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-11 09:19:02 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-06-11 09:19:02 +0200 |
commit | 315602f8455fd8fa86254585a27cca91f1542201 (patch) | |
tree | fe403b94430a455adfba24575a8a314dbe9657a9 /source4/lib | |
parent | ace9bd6560fcbd918ea38e6541137bbfe99da73c (diff) | |
download | samba-315602f8455fd8fa86254585a27cca91f1542201.tar.gz samba-315602f8455fd8fa86254585a27cca91f1542201.tar.xz samba-315602f8455fd8fa86254585a27cca91f1542201.zip |
s4:ldap.py - check how the directory server behaves when the 'distinguishedName' attribute wasn't set correctly
(On add operations the server does completely ignore it and uses the "header"
DN)
Diffstat (limited to 'source4/lib')
-rwxr-xr-x | source4/lib/ldb/tests/python/ldap.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py index bd482b2e913..ddf0254c21e 100755 --- a/source4/lib/ldb/tests/python/ldap.py +++ b/source4/lib/ldb/tests/python/ldap.py @@ -691,9 +691,19 @@ class BasicTests(unittest.TestCase): """Tests the 'distinguishedName' attribute""" print "Tests the 'distinguishedName' attribute""" + # a wrong "distinguishedName" attribute is obviously tolerated self.ldb.add({ - "dn": "cn=ldaptestgroup,cn=users," + self.base_dn, - "objectclass": "group"}) + "dn": "cn=ldaptestgroup,cn=users," + self.base_dn, + "objectclass": "group", + "distinguishedName": "cn=ldaptest,cn=users," + self.base_dn}) + + # proof if the DN has been set correctly + res = ldb.search("cn=ldaptestgroup,cn=users," + self.base_dn, + scope=SCOPE_BASE, attrs=["distinguishedName"]) + self.assertTrue(len(res) == 1) + self.assertTrue("distinguishedName" in res[0]) + self.assertTrue(Dn(ldb, res[0]["distinguishedName"][0]) + == Dn(ldb, "cn=ldaptestgroup, cn=users," + self.base_dn)) m = Message() m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn) |