summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-10-31 02:50:13 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:47 +0100
commitdbb3c74464d84ff2b7bf1f98daa9db3db7d50734 (patch)
treeb31b3ee21ceba9127bb4b3e8e627b3d9c18e382a /testprogs/ejs
parent56fb8d3c0022a766444d9919d727e5ede99a5ea2 (diff)
downloadsamba-dbb3c74464d84ff2b7bf1f98daa9db3db7d50734.tar.gz
samba-dbb3c74464d84ff2b7bf1f98daa9db3db7d50734.tar.bz2
samba-dbb3c74464d84ff2b7bf1f98daa9db3db7d50734.zip
r25760: Test out relative distinguished name behaviour under renames.
Andrew Bartlett (This used to be commit 0019596b715f888e7b7dbd71de832c6e2941c625)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/ldap.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index 65e13a479d..c3003355b5 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -150,6 +150,30 @@ cn: LDAPtestUSER2
assert(ok.error == 0);
}
+ ok = ldb.rename("cn=ldaptestuser3,cn=users," + base_dn, "cn=ldaptestuser3,cn=users," + base_dn);
+ if (ok.error != 0) {
+ println("Could not rename cn=ldaptestuser3,cn=users," + base_dn + " onto itself: " + ok.errstr);
+ assert(ok.error == 0);
+ }
+
+ ok = ldb.rename("cn=ldaptestuser3,cn=users," + base_dn, "cn=ldaptestUSER3,cn=users," + base_dn);
+ if (ok.error != 0) {
+ println("Could not rename cn=ldaptestuser3,cn=users," + base_dn + " into cn=ldaptestUSER3,cn=users," + base_dn + ": " + ok.errstr);
+ assert(ok.error == 0);
+ }
+
+ println("Testing ldb.search for (&(cn=ldaptestuser3)(objectClass=user))");
+ var res = ldb.search("(&(cn=ldaptestuser3)(objectClass=user))");
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (&(cn=ldaptestuser3)(objectClass=user))");
+ 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 + "