From d86e701b7ca42f3d21d6c5b7b6a1827bd37f0ee6 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 22 Oct 2011 12:44:02 +0200 Subject: s4:ldap.py - re-introduce the "(dn=CN=ldaptestUSER3,CN=Users,DC=wallnoefer2,DC=local)" test This syntax is not supported by Windows AD and should also be denied by s4/LDB. Reviewed-by: Andrew Bartlett Signed-off-by: Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Mon Mar 26 02:30:53 CEST 2012 on sn-devel-104 --- source4/dsdb/tests/python/ldap.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'source4/dsdb/tests') diff --git a/source4/dsdb/tests/python/ldap.py b/source4/dsdb/tests/python/ldap.py index 0682939edf..5ca4c26dab 100755 --- a/source4/dsdb/tests/python/ldap.py +++ b/source4/dsdb/tests/python/ldap.py @@ -1928,20 +1928,13 @@ servicePrincipalName: host/ldaptest2computer29 res = ldb.search(expression="(&(&(cn=ldaptestuser3)(userAccountControl=547))(objectClass=user))") self.assertEquals(len(res), 0, "(&(&(cn=ldaptestuser3)(userAccountControl=547))(objectClass=user))") - # This is a Samba special, and does not exist in real AD - # print "Testing ldb.search for (dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")" - # res = ldb.search("(dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") - # if (res.error != 0 || len(res) != 1) { - # print "Could not find (dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")" - # self.assertEquals(len(res), 1) - # } - # self.assertEquals(res[0].dn, ("CN=ldaptestUSER3,CN=Users," + self.base_dn)) - # self.assertEquals(res[0].cn, "ldaptestUSER3") - # self.assertEquals(res[0].name, "ldaptestUSER3") + print "Testing ldb.search for (dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ") - should not work" + res = ldb.search(expression="(dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") + self.assertEquals(len(res), 0, "Could find (dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") print "Testing ldb.search for (distinguishedName=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")" res = ldb.search(expression="(distinguishedName=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") - self.assertEquals(len(res), 1, "Could not find (dn=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") + self.assertEquals(len(res), 1, "Could not find (distinguishedName=CN=ldaptestUSER3,CN=Users," + self.base_dn + ")") self.assertEquals(str(res[0].dn), ("CN=ldaptestUSER3,CN=Users," + self.base_dn)) self.assertEquals(str(res[0]["cn"]), "ldaptestUSER3") self.assertEquals(str(res[0]["name"]), "ldaptestUSER3") -- cgit