summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-02-22 01:54:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:44 -0500
commit7dc7156bd76425df129102a42dd29a85fd8c7ebc (patch)
tree2da9bd209f1cd6f102a48b26094f838860e7e181 /testprogs/ejs
parent81adf162a80b6b0c6c24d40f783ddcd1c9813532 (diff)
downloadsamba-7dc7156bd76425df129102a42dd29a85fd8c7ebc.tar.gz
samba-7dc7156bd76425df129102a42dd29a85fd8c7ebc.tar.bz2
samba-7dc7156bd76425df129102a42dd29a85fd8c7ebc.zip
r21496: A number of ldb control and LDAP changes, surrounding the
'phantom_root' flag in the search_options control - Add in support for LDB controls to the js layer - Test the behaviour - Implement support for the 'phantom_root' flag in the partitions module - Make the LDAP server set the 'phantom_root' flag in the search_options control - This replaces the global_catalog flag passed down as an opaque pointer - Rework the string-format control parsing function into ldb_parse_control_strings(), returning errors by ldb_errorstring() method, rather than with printf to stderr - Rework some of the ldb_control handling logic Andrew Bartlett (This used to be commit 2b3df7f38d7790358dbb4de1b8609bf794a351fb)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/ldap.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index 67eb28f6e3..9fab283b70 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -218,6 +218,18 @@ objectClass: user
assert(res.msgs[0].dn == res3gc.msgs[0].dn);
}
+ println("Testing ldb.search for (&(cn=ldaptestuser)(objectCategory=PerSon)) in with 'phantom root' control");
+ var attrs = new Array("cn");
+ var controls = new Array("search_options:1:2");
+ var res3control = gc_ldb.search("(&(cn=ldaptestuser)(objectCategory=PerSon))", base_dn, ldb.SCOPE_SUBTREE, attrs, controls);
+ if (res3control.error != 0 || res3control.msgs.length != 1) {
+ println("Could not find (&(cn=ldaptestuser)(objectCategory=PerSon)) in Global Catalog");
+ assert(res3control.error == 0);
+ assert(res3control.msgs.length == 1);
+ }
+
+ assert(res.msgs[0].dn == res3control.msgs[0].dn);
+
ok = ldb.del(res.msgs[0].dn);
if (ok.error != 0) {
println(ok.errstr);
@@ -414,7 +426,21 @@ objectClass: user
assert(res.error == 0);
assert(res.msgs.length == 0);
+ println("Testing that we can get at the configuration DN from the main search base on the LDAP port with the 'phantom root' search_options control");
+ var attrs = new Array("cn");
+ var controls = new Array("search_options:1:2");
+ var res = ldb.search("objectClass=crossRef", base_dn, ldb.SCOPE_SUBTREE, attrs, controls);
+ assert(res.error == 0);
+ assert(res.msgs.length > 0);
+
if (gc_ldb != undefined) {
+ println("Testing that we can get at the configuration DN from the main search base on the GC port with the search_options control == 0");
+ var attrs = new Array("cn");
+ var controls = new Array("search_options:1:0");
+ var res = gc_ldb.search("objectClass=crossRef", base_dn, gc_ldb.SCOPE_SUBTREE, attrs, controls);
+ assert(res.error == 0);
+ assert(res.msgs.length > 0);
+
println("Testing that we do find configuration elements in the global catlog");
var attrs = new Array("cn");
var res = gc_ldb.search("objectClass=crossRef", base_dn, ldb.SCOPE_SUBTREE, attrs);