summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-11-03 07:49:36 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-06 14:05:44 +0100
commitfc05386c0d9bf2cf39223e05d3a633a8559c5973 (patch)
treedb9ca3ce635e10ee497940734a5be40152d187f6 /source4/torture
parentba4d87f81790d5773c033a79ea0b9cd37debd19d (diff)
downloadsamba-fc05386c0d9bf2cf39223e05d3a633a8559c5973.tar.gz
samba-fc05386c0d9bf2cf39223e05d3a633a8559c5973.tar.bz2
samba-fc05386c0d9bf2cf39223e05d3a633a8559c5973.zip
s4/drs: dsdb_schema_pfm_from_drsuapi_pfm() to accept partial drsuapi_prefixMap
"partial drsuapi_prefixMap" is a prefix map without last entry being special - i.e. map that does not contains schema_info entry. Test for dsdb_schema_pfm_from_drsuapi_pfm() were also extended to cover both 'full' and 'partial' map conversion. Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/drs/unit/prefixmap_tests.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/torture/drs/unit/prefixmap_tests.c b/source4/torture/drs/unit/prefixmap_tests.c
index ea5802fcca..f89d5d95d7 100644
--- a/source4/torture/drs/unit/prefixmap_tests.c
+++ b/source4/torture/drs/unit/prefixmap_tests.c
@@ -391,9 +391,19 @@ static bool torture_drs_unit_pfm_to_from_drsuapi(struct torture_context *tctx, s
torture_assert_werr_ok(tctx, werr, "dsdb_schema_pfm_contains_drsuapi_pfm() failed");
/* convert back drsuapi_prefixMap to schema_prefixMap */
- werr = dsdb_schema_pfm_from_drsuapi_pfm(ctr, mem_ctx, &pfm, &schema_info);
+ werr = dsdb_schema_pfm_from_drsuapi_pfm(ctr, true, mem_ctx, &pfm, &schema_info);
torture_assert_werr_ok(tctx, werr, "dsdb_schema_pfm_from_drsuapi_pfm() failed");
+ torture_assert_str_equal(tctx, schema_info, schema_info_default, "Fetched schema_info is different");
+ /* compare against the original */
+ if (!_torture_drs_pfm_compare_same(tctx, priv->pfm_full, pfm)) {
+ talloc_free(mem_ctx);
+ return false;
+ }
+ /* test conversion with partial drsuapi_prefixMap */
+ ctr->num_mappings--;
+ werr = dsdb_schema_pfm_from_drsuapi_pfm(ctr, false, mem_ctx, &pfm, NULL);
+ torture_assert_werr_ok(tctx, werr, "dsdb_schema_pfm_from_drsuapi_pfm() failed");
/* compare against the original */
if (!_torture_drs_pfm_compare_same(tctx, priv->pfm_full, pfm)) {
talloc_free(mem_ctx);