diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-11-09 21:26:02 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-11-12 16:34:10 +1100 |
commit | df7546ac16db6e802f8c8ef7bac6f01acc9233b2 (patch) | |
tree | 6f3d65861d90b964c920d36e066b55d2ecd8ef17 /source4/torture | |
parent | d6563801d1783a8cb1b9740878d0a07d40085f32 (diff) | |
download | samba-df7546ac16db6e802f8c8ef7bac6f01acc9233b2.tar.gz samba-df7546ac16db6e802f8c8ef7bac6f01acc9233b2.tar.bz2 samba-df7546ac16db6e802f8c8ef7bac6f01acc9233b2.zip |
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
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/libnet/libnet_BecomeDC.c | 64 |
1 files changed, 38 insertions, 26 deletions
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; } |