1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

dsdb: Add more tests for DN+String and DN+Binary comparisons

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Feb  5 10:41:37 CET 2014 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2014-02-05 16:22:11 +13:00
parent f279a297a4
commit 741e5dca09

View File

@ -77,6 +77,13 @@ static bool torture_dsdb_dn_attrs(struct torture_context *torture)
syntax->comparison_fn(ldb, mem_ctx, &dn1, &dn2) != 0,
"compare of binary+dn an dn should have failed");
/* Test compare (false) with different binary prefix */
dn1 = data_blob_string_const("B:6:abcdef:dc=samba,dc=org");
dn2 = data_blob_string_const("B:4:abcd:dc=samba,dc=org");
torture_assert(torture,
syntax->comparison_fn(ldb, mem_ctx, &dn1, &dn2) != 0,
"compare of binary+dn an dn should have failed");
/* Test DN+String behaviour */
torture_assert(torture, syntax = ldb_samba_syntax_by_name(ldb, DSDB_SYNTAX_STRING_DN),
"Failed to get DN+String schema attribute");
@ -107,6 +114,13 @@ static bool torture_dsdb_dn_attrs(struct torture_context *torture)
syntax->comparison_fn(ldb, mem_ctx, &dn1, &dn2) != 0,
"compare of string+dn an dn should have failed");
/* Test compare (false) with different string prefix */
dn1 = data_blob_string_const("S:6:abcdef:dc=samba,dc=org");
dn2 = data_blob_string_const("S:6:abcXYZ:dc=samba,dc=org");
torture_assert(torture,
syntax->comparison_fn(ldb, mem_ctx, &dn1, &dn2) != 0,
"compare of string+dn an dn should have failed");
talloc_free(mem_ctx);
return true;
}