diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-11-01 12:34:06 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:43:56 +0100 |
commit | 8a8948a17a947bccf04df817f5011093c0c5c523 (patch) | |
tree | 152b7c04ad8da39d348ca52db91507fec78eab72 /testprogs/ejs | |
parent | 5df2dfa2fc0a15113f7d46fc70ab1f0ac2c40776 (diff) | |
download | samba-8a8948a17a947bccf04df817f5011093c0c5c523.tar.gz samba-8a8948a17a947bccf04df817f5011093c0c5c523.tar.xz samba-8a8948a17a947bccf04df817f5011093c0c5c523.zip |
r25781: Handle and test linked attribute renames.
Andrew Bartlett
(This used to be commit 56d9dd5140b6d7d7bbaa2f59ecdff7ee70c4faac)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-x | testprogs/ejs/ldap.js | 67 |
1 files changed, 65 insertions, 2 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js index b5c73e4f65a..c18e2937803 100755 --- a/testprogs/ejs/ldap.js +++ b/testprogs/ejs/ldap.js @@ -55,6 +55,30 @@ cN: LDAPtestUSER } } + ldb.del("cn=ldaptestgroup,cn=users," + base_dn); + + var ok = ldb.add(" +dn: cn=ldaptestgroup,cn=uSers," + base_dn + " +objectclass: group +member: cn=ldaptestuser,cn=useRs," + base_dn + " +"); + if (ok.error != 0) { + ok = ldb.del("cn=ldaptestgroup,cn=users," + base_dn); + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + ok = ldb.add(" +dn: cn=ldaptestgroup,cn=uSers," + base_dn + " +objectclass: group +member: cn=ldaptestuser,cn=useRs," + base_dn + " +"); + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + } + var ok = ldb.add(" dn: cn=ldaptestcomputer,cn=computers," + base_dn + " objectclass: computer @@ -77,6 +101,11 @@ cn: LDAPtestCOMPUTER } } + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + var ok = ldb.add(" dn: cn=ldaptest2computer,cn=computers," + base_dn + " objectClass: computer @@ -140,6 +169,20 @@ cn: LDAPtestUSER2 } } + println("Testing Group Modifies"); + ok = ldb.modify(" +dn: cn=ldaptestgroup,cn=users," + base_dn + " +changetype: modify +add: member +member: cn=ldaptestuser2,cn=users," + base_dn + " +member: cn=ldaptestcomputer,cn=computers," + base_dn + " +"); + + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + ok = ldb.del("cn=ldaptestuser3,cn=users," + base_dn); println("Testing Renames"); @@ -230,6 +273,14 @@ cn: LDAPtestUSER3 ok = ldb.del("cn=ldaptestuser5,cn=users," + base_dn); + ok = ldb.del("cn=ldaptestgroup2,cn=users," + base_dn); + + ok = ldb.rename("cn=ldaptestgroup,cn=users," + base_dn, "cn=ldaptestgroup2,cn=users," + base_dn); + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + println("Testing subtree Renames"); ok = ldb.add(" @@ -562,7 +613,13 @@ objectClass: user // assert(res.msgs[0].userAccountControl == 4098); - var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor"); + ok = ldb.del(res.msgs[0].dn); + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + + var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor", "memberOf"); 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) { @@ -581,7 +638,7 @@ objectClass: user assert(res.msgs[0].objectGUID != undefined); assert(res.msgs[0].whenCreated != undefined); assert(res.msgs[0].nTSecurityDescriptor != undefined); - + assert(res.msgs[0].memberOf[0] == ("CN=ldaptestgroup2,CN=Users," + base_dn)); ok = ldb.del(res.msgs[0].dn); if (ok.error != 0) { @@ -614,6 +671,12 @@ objectClass: user assert(ok.error == 0); } + ok = ldb.del(("CN=ldaptestgroup2,CN=Users," + base_dn)) + if (ok.error != 0) { + println(ok.errstr); + assert(ok.error == 0); + } + println("Testing ldb.search for (&(cn=ldaptestutf8user2 ÈÙÉÌÒÀ)(objectClass=user))"); var res = ldb.search("(&(cn=ldaptestutf8user ÈÙÉÌÒÀ)(objectClass=user))"); |