summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-11-07 05:35:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:41 +0100
commit27c9f6c235c3c625f4c4e60a73d8f2e86bd4a186 (patch)
tree7da75f98dfa650b0d0bf5ad80262a0fddcf42690 /testprogs/ejs
parent1cbb73f235b926a5809bbcf35f0b1ef522e11faa (diff)
downloadsamba-27c9f6c235c3c625f4c4e60a73d8f2e86bd4a186.tar.gz
samba-27c9f6c235c3c625f4c4e60a73d8f2e86bd4a186.tar.bz2
samba-27c9f6c235c3c625f4c4e60a73d8f2e86bd4a186.zip
r25891: Test that we get the correct return value when we attempt to reference
invalid entries with a linked attribute. Make Samba4 pass that test, by fixing a silly bug in the linked_attributes module. (By passing down the 'original' request structure, tdb would override our handle, and therefore we would never be called for the 'wait', which collects the errors). Fix up the provision templates to handle the newly required referential integrity. Andrew Bartlett (This used to be commit 0377d85bbdcb2c4f110b0519005f0d1d10bc0c0b)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/ldap.js46
1 files changed, 29 insertions, 17 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index 56fbf4f0df..c012f84bf0 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -31,6 +31,20 @@ function basic_tests(ldb, gc_ldb, base_dn, configuration_dn, schema_dn)
ldb.del("cn=ldaptestuser,cn=users," + base_dn);
+ ldb.del("cn=ldaptestgroup,cn=users," + base_dn);
+
+ println("Testing group add with invalid member");
+ var ok = ldb.add("
+dn: cn=ldaptestgroup,cn=uSers," + base_dn + "
+objectclass: group
+member: cn=ldaptestuser,cn=useRs," + base_dn + "
+");
+
+ if (ok.error != 32) { /* LDAP_NO_SUCH_OBJECT */
+ println(ok.errstr);
+ assert(ok.error == 32);
+ }
+
var ok = ldb.add("
dn: cn=ldaptestuser,cn=uSers," + base_dn + "
objectclass: user
@@ -55,28 +69,14 @@ 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);
- }
+ println(ok.errstr);
+ assert(ok.error == 0);
}
var ok = ldb.add("
@@ -185,6 +185,18 @@ member: cn=ldaptestcomputer,cn=computers," + base_dn + "
ok = ldb.del("cn=ldaptestuser3,cn=users," + base_dn);
+ println("Testing adding non-existent user to a group");
+ ok = ldb.modify("
+dn: cn=ldaptestgroup,cn=users," + base_dn + "
+changetype: modify
+add: member
+member: cn=ldaptestuser3,cn=users," + base_dn + "
+");
+ if (ok.error != 32) { /* LDAP_NO_SUCH_OBJECT */
+ println(ok.errstr);
+ assert(ok.error == 32);
+ }
+
println("Testing Renames");
ok = ldb.rename("cn=ldaptestuser2,cn=users," + base_dn, "cn=ldaptestuser3,cn=users," + base_dn);
@@ -895,7 +907,7 @@ var base_dn = find_basedn(ldb);
var configuration_dn = find_configurationdn(ldb);
var schema_dn = find_schemadn(ldb);
-printf("baseDN: %s\n", base_dn);
+println("baseDN: %s\n", base_dn);
var ok = gc_ldb.connect("ldap://" + host + ":3268");
if (!ok) {