1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r26479: Further test behaviour of 'attribute or value exists'.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2007-12-17 02:13:41 +01:00 committed by Stefan Metzmacher
parent d88527a9d6
commit 11c153163c

View File

@ -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
@ -146,6 +147,32 @@ servicePrincipalName: host/ldaptest2computer
servicePrincipalName: cifs/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.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);