diff options
-rwxr-xr-x | testprogs/ejs/ldap.js | 27 |
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 |