From 72ce2ab2ee51b67eaf85544d207316a45198cc1c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 15 Nov 2006 18:33:53 +0000 Subject: r19729: - split basedn related tests to a new function - and add some 'netlogon' attriubte related tests metze (This used to be commit d643c3cc5cd4547dbb7cead768993a9abee4e2eb) --- testprogs/ejs/ldap.js | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js index 4f810ae5eb..1b7a8f891e 100755 --- a/testprogs/ejs/ldap.js +++ b/testprogs/ejs/ldap.js @@ -393,13 +393,6 @@ objectClass: user assert(res[0].cn == "ldaptestutf8user2 èùéìòà"); } - println("Testing for highestCommittedUSN"); - var attrs = new Array("highestCommittedUSN"); - var res = ldb.search("", "", ldb.SCOPE_BASE, attrs); - assert(res.length == 1); - assert(res[0].highestCommittedUSN != undefined); - assert(res[0].highestCommittedUSN != 0); - println("Testing that we can't get at the configuration DN from the main search base"); var attrs = new Array("cn"); var res = ldb.search("objectClass=crossRef", base_dn, ldb.SCOPE_SUBTREE, attrs); @@ -429,6 +422,31 @@ objectClass: user } +function basedn_tests(ldb, gc_ldb) +{ + println("Testing for all rootDSE attributes"); + var attrs = new Array(); + var res = ldb.search("", "", ldb.SCOPE_BASE, attrs); + assert(res.length == 1); + + println("Testing for highestCommittedUSN"); + var attrs = new Array("highestCommittedUSN"); + var res = ldb.search("", "", ldb.SCOPE_BASE, attrs); + assert(res.length == 1); + assert(res[0].highestCommittedUSN != undefined); + assert(res[0].highestCommittedUSN != 0); + + println("Testing for netlogon via LDAP"); + var attrs = new Array("netlogon"); + var res = ldb.search("", "", ldb.SCOPE_BASE, attrs); + assert(res.length == 0); + + println("Testing for netlogon and highestCommittedUSN via LDAP"); + var attrs = new Array("netlogon", "highestCommittedUSN"); + var res = ldb.search("", "", ldb.SCOPE_BASE, attrs); + assert(res.length == 0); +} + function find_basedn(ldb) { var attrs = new Array("defaultNamingContext"); @@ -462,4 +480,6 @@ if (!ok) { basic_tests(ldb, gc_ldb, base_dn, configuration_dn) +basedn_tests(ldb, gc_ldb) + return 0; -- cgit