From df7546ac16db6e802f8c8ef7bac6f01acc9233b2 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 9 Nov 2009 21:26:02 +1100 Subject: s4:dsdb/repl Split the 'convert' or 'commit' stages in the DRS import This will allow us in future to do tests on the LDB values we generate from the DRS replication. Andrew Bartlett --- source4/torture/libnet/libnet_BecomeDC.c | 64 +++++++++++++++++++------------- 1 file changed, 38 insertions(+), 26 deletions(-) (limited to 'source4/torture/libnet') diff --git a/source4/torture/libnet/libnet_BecomeDC.c b/source4/torture/libnet/libnet_BecomeDC.c index 342463875d..d990e803be 100644 --- a/source4/torture/libnet/libnet_BecomeDC.c +++ b/source4/torture/libnet/libnet_BecomeDC.c @@ -258,19 +258,19 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s, s->self_made_schema = NULL; s->schema = dsdb_get_schema(s->ldb); - status = dsdb_extended_replicated_objects_commit(s->ldb, - c->partition->nc.dn, - mapping_ctr, - object_count, - first_object, - linked_attributes_count, - linked_attributes, - s_dsa, - uptodateness_vector, - c->gensec_skey, - s, &objs, &seq_num); + status = dsdb_extended_replicated_objects_convert(s->ldb, + c->partition->nc.dn, + mapping_ctr, + object_count, + first_object, + linked_attributes_count, + linked_attributes, + s_dsa, + uptodateness_vector, + c->gensec_skey, + s, &objs); if (!W_ERROR_IS_OK(status)) { - DEBUG(0,("Failed to commit objects: %s\n", win_errstr(status))); + DEBUG(0,("Failed to convert objects: %s\n", win_errstr(status))); return werror_to_ntstatus(status); } @@ -285,6 +285,13 @@ static NTSTATUS test_apply_schema(struct test_become_dc_state *s, } } + status = dsdb_extended_replicated_objects_commit(s->ldb, + objs, &seq_num); + if (!W_ERROR_IS_OK(status)) { + DEBUG(0,("Failed to commit objects: %s\n", win_errstr(status))); + return werror_to_ntstatus(status); + } + msg = ldb_msg_new(objs); NT_STATUS_HAVE_NO_MEMORY(msg); msg->dn = objs->partition_dn; @@ -500,19 +507,19 @@ static NTSTATUS test_become_dc_store_chunk(void *private_data, c->partition->nc.dn, object_count, linked_attributes_count)); } - status = dsdb_extended_replicated_objects_commit(s->ldb, - c->partition->nc.dn, - mapping_ctr, - object_count, - first_object, - linked_attributes_count, - linked_attributes, - s_dsa, - uptodateness_vector, - c->gensec_skey, - s, &objs, &seq_num); + status = dsdb_extended_replicated_objects_convert(s->ldb, + c->partition->nc.dn, + mapping_ctr, + object_count, + first_object, + linked_attributes_count, + linked_attributes, + s_dsa, + uptodateness_vector, + c->gensec_skey, + s, &objs); if (!W_ERROR_IS_OK(status)) { - DEBUG(0,("Failed to commit objects: %s\n", win_errstr(status))); + DEBUG(0,("Failed to convert objects: %s\n", win_errstr(status))); return werror_to_ntstatus(status); } @@ -526,8 +533,13 @@ static NTSTATUS test_become_dc_store_chunk(void *private_data, NDR_PRINT_DEBUG(replPropertyMetaDataBlob, objs->objects[i].meta_data); } } + status = dsdb_extended_replicated_objects_commit(s->ldb, objs, &seq_num); talloc_free(s_dsa); talloc_free(objs); + if (!W_ERROR_IS_OK(status)) { + DEBUG(0,("Failed to commit objects: %s\n", win_errstr(status))); + return werror_to_ntstatus(status); + } for (i=0; i < linked_attributes_count; i++) { const struct dsdb_attribute *sa; @@ -618,7 +630,7 @@ bool torture_net_become_dc(struct torture_context *torture) status = libnet_BecomeDC(s->ctx, s, &b); if (!NT_STATUS_IS_OK(status)) { - printf("libnet_BecomeDC() failed - %s\n", nt_errstr(status)); + printf("libnet_BecomeDC() failed - %s %s\n", nt_errstr(status), b.out.error_string); ret = false; goto cleanup; } @@ -693,7 +705,7 @@ cleanup: status = libnet_UnbecomeDC(s->ctx, s, &u); if (!NT_STATUS_IS_OK(status)) { - printf("libnet_UnbecomeDC() failed - %s\n", nt_errstr(status)); + printf("libnet_UnbecomeDC() failed - %s %s\n", nt_errstr(status), u.out.error_string); ret = false; } -- cgit