diff options
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/test_ldb.sh | 7 | ||||
-rwxr-xr-x | testprogs/ejs/ldap.js | 46 |
2 files changed, 51 insertions, 2 deletions
diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh index 6ebb6c143b..8a019e18b7 100755 --- a/testprogs/blackbox/test_ldb.sh +++ b/testprogs/blackbox/test_ldb.sh @@ -77,6 +77,13 @@ echo "Extended DN Control test returned 0 items" failed=`expr $failed + 1` fi +echo "Test Domain scope Control" +nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=domain_scope:1 '(objectclass=user)' | grep sAMAccountName | wc -l` +if [ $nentries -lt 1 ]; then +echo "Extended Domain scope Control test returned 0 items" +failed=`expr $failed + 1` +fi + echo "Test Attribute Scope Query Control" nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l` if [ $nentries -lt 1 ]; then diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js index 5735b8b391..6515c7abfe 100755 --- a/testprogs/ejs/ldap.js +++ b/testprogs/ejs/ldap.js @@ -439,7 +439,7 @@ objectClass: user // assert(res.msgs[0].userAccountControl == 4098); - var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "ntSecurityDescriptor"); + var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor"); println("Testing ldb.search for (&(cn=ldaptestUSer2)(objectClass=user))"); var res = ldb.search("(&(cn=ldaptestUSer2)(objectClass=user))", base_dn, ldb.SCOPE_SUBTREE, attrs); if (res.error != 0 || res.msgs.length != 1) { @@ -457,7 +457,8 @@ objectClass: user assert(res.msgs[0].objectClass[3] == "user"); assert(res.msgs[0].objectGUID != undefined); assert(res.msgs[0].whenCreated != undefined); - assert(res.msgs[0].ntSecurityDescriptor != undefined); + assert(res.msgs[0].nTSecurityDescriptor != undefined); + ok = ldb.del(res.msgs[0].dn); if (ok.error != 0) { @@ -575,6 +576,47 @@ objectClass: user assert(res.msgs[0].objectClass[0] == "top"); assert(res.msgs[0].objectClass[1] == "domain"); assert(res.msgs[0].objectClass[2] == "domainDNS"); + +// check enumeration + + var attrs = new Array("cn"); + println("Testing ldb.search for objectCategory=person"); + var res = ldb.search("objectCategory=person", base_dn, ldb.SCOPE_SUBTREE, attrs); + assert(res.error == 0); + assert(res.msgs.length > 0); + + var attrs = new Array("cn"); + var controls = new Array("domain_scope:1"); + println("Testing ldb.search for objectCategory=person with domain scope control"); + var res = ldb.search("objectCategory=person", base_dn, ldb.SCOPE_SUBTREE, attrs, controls); + assert(res.error == 0); + assert(res.msgs.length > 0); + + var attrs = new Array("cn"); + println("Testing ldb.search for objectCategory=user"); + var res = ldb.search("objectCategory=user", base_dn, ldb.SCOPE_SUBTREE, attrs); + assert(res.error == 0); + assert(res.msgs.length > 0); + + var attrs = new Array("cn"); + var controls = new Array("domain_scope:1"); + println("Testing ldb.search for objectCategory=user with domain scope control"); + var res = ldb.search("objectCategory=user", base_dn, ldb.SCOPE_SUBTREE, attrs, controls); + assert(res.error == 0); + assert(res.msgs.length > 0); + + var attrs = new Array("cn"); + println("Testing ldb.search for objectCategory=group"); + var res = ldb.search("objectCategory=group", base_dn, ldb.SCOPE_SUBTREE, attrs); + assert(res.error == 0); + assert(res.msgs.length > 0); + + var attrs = new Array("cn"); + var controls = new Array("domain_scope:1"); + println("Testing ldb.search for objectCategory=group with domain scope control"); + var res = ldb.search("objectCategory=group", base_dn, ldb.SCOPE_SUBTREE, attrs, controls); + assert(res.error == 0); + assert(res.msgs.length > 0); } |