summaryrefslogtreecommitdiff
path: root/source4/torture/ldb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-05-08 10:20:00 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-05-10 23:45:20 +0300
commit983606dbe0a23cab28d0f33a32a0e4ab0acf99a7 (patch)
tree7af199bece9254d43ca221ea9226eef86cca7071 /source4/torture/ldb
parent1f3faea0463782d16bdbfd34b3b51624aca2bc90 (diff)
downloadsamba-983606dbe0a23cab28d0f33a32a0e4ab0acf99a7.tar.gz
s4/tort: Add test for comparing special DNs
Diffstat (limited to 'source4/torture/ldb')
-rw-r--r--source4/torture/ldb/ldb.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/torture/ldb/ldb.c b/source4/torture/ldb/ldb.c
index dbfd96c59b2..8bc6357e3dc 100644
--- a/source4/torture/ldb/ldb.c
+++ b/source4/torture/ldb/ldb.c
@@ -587,6 +587,7 @@ static bool torture_ldb_dn(struct torture_context *torture)
struct ldb_dn *dn;
struct ldb_dn *child_dn;
struct ldb_dn *typo_dn;
+ struct ldb_dn *special_dn;
struct ldb_val val;
torture_assert(torture,
@@ -656,6 +657,23 @@ static bool torture_ldb_dn(struct torture_context *torture)
ldb_dn_compare_base(dn, typo_dn) != 0,
"Base Comparison on dc=samba,dc=org and c=samba,dc=org should != 0");
+ /* Check comparisons with a special DN */
+ torture_assert(torture,
+ special_dn = ldb_dn_new(mem_ctx, ldb, "@special_dn"),
+ "Failed to create 'special' DN");
+
+ torture_assert(torture,
+ ldb_dn_compare(dn, special_dn) != 0,
+ "Comparison on dc=samba,dc=org and @special_dn should != 0");
+
+ torture_assert(torture,
+ ldb_dn_compare_base(special_dn, dn) > 0,
+ "Base Comparison of @special_dn and dc=samba,dc=org should > 0");
+
+ torture_assert(torture,
+ ldb_dn_compare_base(dn, special_dn) < 0,
+ "Base Comparison on dc=samba,dc=org and @special_dn should < 0");
+
/* Check DN based on MS-ADTS:3.1.1.5.1.2 Naming Constraints*/
torture_assert(torture,
dn = ldb_dn_new(mem_ctx, ldb, "CN=New\nLine,DC=SAMBA,DC=org"),