summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-11-27 04:43:20 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:46:20 +0100
commit470043bf7ae038e590a011e90bbf610c76d53767 (patch)
tree0635a646b4b06024124b52b83cf4ff203bbcad13 /testprogs
parentc4d7646f294df54d6b5e7a3ac236dfa4e861c501 (diff)
downloadsamba-470043bf7ae038e590a011e90bbf610c76d53767.tar.gz
samba-470043bf7ae038e590a011e90bbf610c76d53767.tar.bz2
samba-470043bf7ae038e590a011e90bbf610c76d53767.zip
r26140: Add a new test for searches by distinguieshedName and dn, and
implement these in the simple ldap mapping module. We still don't pass this test, because we must get linked attributes into OpenLDAP. Andrew Bartlett (This used to be commit d41f34e979bb119f71ab3cc2fdb3c08e4b92849c)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/ldap.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index ddf5d814f5..40ce404890 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -230,6 +230,28 @@ member: cn=ldaptestuser3,cn=users," + base_dn + "
assert(res.msgs[0].cn == "ldaptestUSER3");
assert(res.msgs[0].name == "ldaptestUSER3");
+ println("Testing ldb.search for (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ var res = ldb.search("(dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ assert(res.error == 0);
+ assert(res.msgs.length == 1);
+ }
+ assert(res.msgs[0].dn == ("CN=ldaptestUSER3,CN=Users," + base_dn));
+ assert(res.msgs[0].cn == "ldaptestUSER3");
+ assert(res.msgs[0].name == "ldaptestUSER3");
+
+ println("Testing ldb.search for (distinguishedName=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ var res = ldb.search("(distinguishedName=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (dn=CN=ldaptestUSER3,CN=Users," + base_dn + ")");
+ assert(res.error == 0);
+ assert(res.msgs.length == 1);
+ }
+ assert(res.msgs[0].dn == ("CN=ldaptestUSER3,CN=Users," + base_dn));
+ assert(res.msgs[0].cn == "ldaptestUSER3");
+ assert(res.msgs[0].name == "ldaptestUSER3");
+
// ensure we cannot add it again
ok = ldb.add("
dn: cn=ldaptestuser3,cn=userS," + base_dn + "