summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-11-02 02:51:54 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:58 +0100
commit96116b7f849779119beec701db67ff18d28fdede (patch)
tree90e13d692c49f4938d79a1cd932618b38aba96a0 /testprogs
parent605032d9978c6d44f6570418c8d66af0fe705a35 (diff)
downloadsamba-96116b7f849779119beec701db67ff18d28fdede.tar.gz
samba-96116b7f849779119beec701db67ff18d28fdede.tar.bz2
samba-96116b7f849779119beec701db67ff18d28fdede.zip
r25787: Assert that we handle the group membership updating correctly,
including when we delete members from the DB. Andrew Bartlett (This used to be commit 2c95274e257da1d392a8a91bc291debc41c18f30)
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/ejs/ldap.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index c18e293780..dec45a7697 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -509,6 +509,7 @@ objectClass: user
assert(res.msgs[0].primaryGroupID == 513);
// assert(res.msgs[0].sAMAccountType == 805306368);
// assert(res.msgs[0].userAccountControl == 546);
+ assert(res.msgs[0].memberOf[0] == ("CN=ldaptestgroup2,CN=Users," + base_dn));
println("Testing ldb.search for (&(cn=ldaptestcomputer)(objectCategory=cn=computer,cn=schema,cn=configuration," + base_dn + "))");
var res2 = ldb.search("(&(cn=ldaptestcomputer)(objectCategory=cn=computer,cn=schema,cn=configuration," + base_dn + "))");
@@ -640,7 +641,26 @@ objectClass: user
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);
+ var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor", "member");
+ println("Testing ldb.search for (&(cn=ldaptestgroup2)(objectClass=group))");
+ var res = ldb.search("(&(cn=ldaptestgroup2)(objectClass=group))", base_dn, ldb.SCOPE_SUBTREE, attrs);
+ if (res.error != 0 || res.msgs.length != 1) {
+ println("Could not find (&(cn=ldaptestgroup2)(objectClass=group))");
+ assert(res.error == 0);
+ assert(res.msgs.length == 1);
+ }
+
+ assert(res.msgs[0].dn == ("CN=ldaptestgroup2,CN=Users," + base_dn));
+ assert(res.msgs[0].cn == "ldaptestgroup2");
+ assert(res.msgs[0].name == "ldaptestgroup2");
+ assert(res.msgs[0].objectClass[0] == "top");
+ assert(res.msgs[0].objectClass[1] == "group");
+ assert(res.msgs[0].objectGUID != undefined);
+ assert(res.msgs[0].whenCreated != undefined);
+ assert(res.msgs[0].nTSecurityDescriptor != undefined);
+ assert(res.msgs[0].member[0] == ("CN=ldaptestuser2,CN=Users," + base_dn));
+
+ ok = ldb.del(("CN=ldaptestuser2,CN=Users," + base_dn));
if (ok.error != 0) {
println(ok.errstr);
assert(ok.error == 0);