summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-02-05 16:22:11 +1300
committerAndrew Bartlett <abartlet@samba.org>2014-02-05 10:41:37 +0100
commit741e5dca09053d0fc9a6e2a112113f1828a95759 (patch)
treeca6feee2539f191ca18037c12656bcbadd5a6149 /source4
parentf279a297a4a94c5cbc049c9b2cde14b02960a76f (diff)
downloadsamba-741e5dca09053d0fc9a6e2a112113f1828a95759.tar.gz
samba-741e5dca09053d0fc9a6e2a112113f1828a95759.tar.xz
samba-741e5dca09053d0fc9a6e2a112113f1828a95759.zip
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
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/common/tests/dsdb_dn.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/dsdb/common/tests/dsdb_dn.c b/source4/dsdb/common/tests/dsdb_dn.c
index 9ae0c8a0494..66c7e125a47 100644
--- a/source4/dsdb/common/tests/dsdb_dn.c
+++ b/source4/dsdb/common/tests/dsdb_dn.c
@@ -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;
}