From 2d2dbf53ee110bfcd2f193d3e5c8d0e27759c4f3 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 9 Oct 2010 05:40:32 +0300 Subject: [PATCH] s4-test-msds_intid: Verify ATTIDs for Linked Attributes Autobuild-User: Kamen Mazdrashki Autobuild-Date: Sat Oct 9 03:43:34 UTC 2010 on sn-devel-104 --- source4/torture/drs/rpc/msds_intid.c | 45 ++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/source4/torture/drs/rpc/msds_intid.c b/source4/torture/drs/rpc/msds_intid.c index 6fded004cea..2b2fa5e10d9 100644 --- a/source4/torture/drs/rpc/msds_intid.c +++ b/source4/torture/drs/rpc/msds_intid.c @@ -489,6 +489,7 @@ static bool test_dsintid_schema(struct torture_context *tctx, struct DsIntIdTest const struct drsuapi_DsReplicaAttribute *drs_attr; const struct drsuapi_DsReplicaAttributeCtr *attr_ctr; const struct drsuapi_DsReplicaObjectListItemEx *cur; + const struct drsuapi_DsReplicaLinkedAttribute *la; TALLOC_CTX *mem_ctx; mem_ctx = talloc_new(ctx); @@ -531,6 +532,27 @@ static bool test_dsintid_schema(struct torture_context *tctx, struct DsIntIdTest } } + /* verify ATTIDs for Linked Attributes */ + torture_comment(tctx, "Verify ATTIDs for Linked Attributes (%u)\n", + ctr6->linked_attributes_count); + for (i = 0; i < ctr6->linked_attributes_count; i++) { + la = &ctr6->linked_attributes[i]; + dsdb_attr = dsdb_attribute_by_attributeID_id(ldap_schema, la->attid); + + torture_assert(tctx, + la->attid == dsdb_attr->attributeID_id, + _make_error_message(ctx, la->attid, + dsdb_attr, + la->identifier)) + if (dsdb_attr->msDS_IntId) { + torture_assert(tctx, + drs_attr->attid != dsdb_attr->msDS_IntId, + _make_error_message(ctx, la->attid, + dsdb_attr, + la->identifier)) + } + } + talloc_free(mem_ctx); return true; @@ -551,6 +573,7 @@ static bool test_dsintid_domain(struct torture_context *tctx, struct DsIntIdTest const struct drsuapi_DsReplicaAttribute *drs_attr; const struct drsuapi_DsReplicaAttributeCtr *attr_ctr; const struct drsuapi_DsReplicaObjectListItemEx *cur; + const struct drsuapi_DsReplicaLinkedAttribute *la; TALLOC_CTX *mem_ctx; mem_ctx = talloc_new(ctx); @@ -593,6 +616,28 @@ static bool test_dsintid_domain(struct torture_context *tctx, struct DsIntIdTest } } + /* verify ATTIDs for Linked Attributes */ + torture_comment(tctx, "Verify ATTIDs for Linked Attributes (%u)\n", + ctr6->linked_attributes_count); + for (i = 0; i < ctr6->linked_attributes_count; i++) { + la = &ctr6->linked_attributes[i]; + dsdb_attr = dsdb_attribute_by_attributeID_id(ldap_schema, la->attid); + + if (dsdb_attr->msDS_IntId) { + torture_assert(tctx, + la->attid == dsdb_attr->msDS_IntId, + _make_error_message(ctx, la->attid, + dsdb_attr, + la->identifier)); + } else { + torture_assert(tctx, + la->attid == dsdb_attr->attributeID_id, + _make_error_message(ctx, la->attid, + dsdb_attr, + la->identifier)); + } + } + talloc_free(mem_ctx); return true;