From fc05386c0d9bf2cf39223e05d3a633a8559c5973 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Tue, 3 Nov 2009 07:49:36 +0100 Subject: 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 --- source4/torture/drs/unit/prefixmap_tests.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/torture/drs/unit') 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); -- cgit