summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-12-17 02:13:41 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:50:37 +0100
commit449c681d5bbab9ad4b432d8c5233046c863f954a (patch)
treebb54730ca8e6d0511226780a7cab7838b972d054 /testprogs/ejs
parent440fd879613b94cc75eb0737af91602d96c89bf9 (diff)
downloadsamba-449c681d5bbab9ad4b432d8c5233046c863f954a.tar.gz
samba-449c681d5bbab9ad4b432d8c5233046c863f954a.tar.bz2
samba-449c681d5bbab9ad4b432d8c5233046c863f954a.zip
r26479: Further test behaviour of 'attribute or value exists'.
Andrew Bartlett (This used to be commit 11c153163c359fd07402daa61b93872387e12568)
Diffstat (limited to 'testprogs/ejs')
-rwxr-xr-xtestprogs/ejs/ldap.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/testprogs/ejs/ldap.js b/testprogs/ejs/ldap.js
index bc7d8ec341..6af70971eb 100755
--- a/testprogs/ejs/ldap.js
+++ b/testprogs/ejs/ldap.js
@@ -137,6 +137,7 @@ displayname: ldap testy
}
}
+ println("Testing attribute or value exists behaviour");
ok = ldb.modify("
dn: cn=ldaptest2computer,cn=computers," + base_dn + "
changetype: modify
@@ -152,6 +153,32 @@ servicePrincipalName: cifs/ldaptest2computer
assert(ok.error == 20);
}
+ ok = ldb.modify("
+dn: cn=ldaptest2computer,cn=computers," + base_dn + "
+changetype: modify
+replace: servicePrincipalName
+servicePrincipalName: host/ldaptest2computer
+servicePrincipalName: cifs/ldaptest2computer
+");
+
+ if (ok.error != 0) {
+ println("Failed to replace servicePrincpalName:" + ok.errstr);
+ assert(ok.error == 20);
+ }
+
+ ok = ldb.modify("
+dn: cn=ldaptest2computer,cn=computers," + base_dn + "
+changetype: modify
+add: servicePrincipalName
+servicePrincipalName: host/ldaptest2computer
+");
+
+//LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS
+ if (ok.error != 20) {
+ println("Expected error LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS, got :" + ok.errstr);
+ assert(ok.error == 20);
+ }
+
ok = ldb.add("
dn: cn=ldaptestuser2,cn=useRs," + base_dn + "
objectClass: person