revert ...
[metze/samba/wip.git] / source4 / torture / drs / rpc / dssync.c
index 2f92f8ac667ad5faa70fc77df1dfd904b00510c2..67fde7c2b6137247417fb0a68d81befc225fc912 100644 (file)
@@ -347,8 +347,6 @@ static bool test_analyse_objects(struct torture_context *tctx,
                                 const struct drsuapi_DsReplicaOIDMapping_Ctr *mapping_ctr,
                                 uint32_t object_count,
                                 const struct drsuapi_DsReplicaObjectListItemEx *first_object,
-                                uint32_t linked_attributes_count,
-                                const struct drsuapi_DsReplicaLinkedAttribute *linked_attributes,
                                 const DATA_BLOB *gensec_skey)
 {
        static uint32_t object_id;
@@ -377,8 +375,7 @@ static bool test_analyse_objects(struct torture_context *tctx,
                                                 mapping_ctr,
                                                 object_count,
                                                 first_object,
-                                                linked_attributes_count,
-                                                linked_attributes,
+                                                0, NULL,
                                                 NULL, NULL,
                                                 gensec_skey,
                                                 0,
@@ -395,13 +392,11 @@ static bool test_analyse_objects(struct torture_context *tctx,
                struct ldb_request *search_req;
                struct ldb_result *res;
                struct ldb_message *new_msg, *drs_msg, *ldap_msg;
-               size_t num_attrs = objs->objects[i].msg->num_elements+1+1;
+               size_t num_attrs = objs->objects[i].msg->num_elements+1;
                const char **attrs = talloc_array(objs, const char *, num_attrs);
                for (j=0; j < objs->objects[i].msg->num_elements; j++) {
                        attrs[j] = objs->objects[i].msg->elements[j].name;
                }
-               attrs[j] = "uSNChanged";
-               j++;
                attrs[j] = NULL;
                res = talloc_zero(objs, struct ldb_result);
                if (!res) {
@@ -425,11 +420,6 @@ static bool test_analyse_objects(struct torture_context *tctx,
                        return false;
                }
 
-               ret = ldb_request_add_control(search_req, LDB_CONTROL_SHOW_RECYCLED_OID, false, NULL);
-               if (ret != LDB_SUCCESS) {
-                       return false;
-               }
-
                ret = ldb_request_add_control(search_req, LDB_CONTROL_EXTENDED_DN_OID, true, extended_dn_ctrl);
                if (ret != LDB_SUCCESS) {
                        return false;
@@ -446,16 +436,6 @@ static bool test_analyse_objects(struct torture_context *tctx,
                                                         ldb_errstring(ldb)));
                torture_assert_int_equal(tctx, res->count, 1, "Could not re-fetch object just delivered over DRS");
                ldap_msg = res->msgs[0];
-
-{
-uint64_t usn = ldb_msg_find_attr_as_int64(ldap_msg, "uSNChanged", 0);
-struct GUID g;
-GUID_from_ndr_blob(&objs->objects[i].guid_value, &g);
-torture_comment(tctx, "o[%d] usn_changed[%llu]: %s - %s\n", i, (unsigned long long)usn,
-       GUID_string(objs, &g),
-               ldb_dn_get_linearized(objs->objects[i].msg->dn));
-continue;
-}
                for (j=0; j < ldap_msg->num_elements; j++) {
                        ldap_msg->elements[j].flags = LDB_FLAG_MOD_ADD;
                        /* For unknown reasons, there is no nTSecurityDescriptor on cn=deleted objects over LDAP, but there is over DRS!  Skip it on both transports for now here so */
@@ -563,12 +543,6 @@ continue;
                talloc_free(search_req);
        }
 
-       for (i=0; i < objs->linked_attributes_count; i++) {
-torture_comment(tctx, "l[%d] usn_changed[%llu]: attid[%u] %s\n", i,
-       (unsigned long long)objs->linked_attributes[i].meta_data.originating_usn,
-       objs->linked_attributes[i].attid,
-       GUID_string(objs, &objs->linked_attributes[i].identifier->guid));
-       }
        if (!lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
                talloc_free(objs);
                return true;
@@ -717,29 +691,6 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                }
        };
 
-       struct drsuapi_DsReplicaCursorCtrEx utdv;
-       struct drsuapi_DsReplicaCursor cursors[1];
-
-       ZERO_STRUCT(utdv);
-       utdv.version = 1;
-       utdv.count = ARRAY_SIZE(cursors);
-       utdv.cursors = cursors;
-       ZERO_STRUCT(cursors);
-       GUID_from_string("0d36ca05-5507-4e62-aca3-354bab0d39e1",
-                       &cursors[0].source_dsa_invocation_id);
-       cursors[0].highest_usn = 12755;
-/*
-                    uptodateness_vector      : *
-                        uptodateness_vector: struct drsuapi_DsReplicaCursorCtrEx
-                            version                  : 0x00000001 (1)
-                            reserved1                : 0x00000000 (0)
-                            count                    : 0x00000001 (1)
-                            reserved2                : 0x00000000 (0)
-                            cursors: ARRAY(1)
-                                cursors: struct drsuapi_DsReplicaCursor
-                                    source_dsa_invocation_id : 0d36ca05-5507-4e62-aca3-354bab0d39e1
-                                    highest_usn              : 0x00000000000031d3 (12755)
-*/
        ZERO_STRUCT(null_guid);
        ZERO_STRUCT(null_sid);
 
@@ -813,7 +764,7 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                        r.in.req->req8.highwatermark.tmp_highest_usn    = highest_usn;
                        r.in.req->req8.highwatermark.reserved_usn       = 0;
                        r.in.req->req8.highwatermark.highest_usn        = highest_usn;
-                       r.in.req->req8.uptodateness_vector              = NULL;//&utdv;
+                       r.in.req->req8.uptodateness_vector              = NULL;
                        r.in.req->req8.replica_flags                    = 0;
                        if (lpcfg_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
                                r.in.req->req8.replica_flags            |= DRSUAPI_DRS_USE_COMPRESSION;
@@ -826,8 +777,6 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                                                        | DRSUAPI_DRS_GET_ANC
                                                                        | DRSUAPI_DRS_NEVER_SYNCED
                                                                        ;
-                       r.in.req->req8.replica_flags = 0x00201074;
-                       //r.in.req->req8.replica_flags |= DRSUAPI_DRS_GET_ANC;
                        r.in.req->req8.max_object_count                 = 402;
                        r.in.req->req8.max_ndr_size                     = 402116;
 
@@ -887,7 +836,7 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                                (unsigned long long) ctr1->new_highwatermark.highest_usn);
 
                                if (!test_analyse_objects(tctx, ctx, nc_dn_str, &ctr1->mapping_ctr,  ctr1->object_count,
-                                                         ctr1->first_object, 0, NULL, &gensec_skey)) {
+                                                         ctr1->first_object, &gensec_skey)) {
                                        return false;
                                }
 
@@ -922,10 +871,7 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                                (unsigned long long) ctr6->new_highwatermark.highest_usn);
 
                                if (!test_analyse_objects(tctx, ctx, nc_dn_str, &ctr6->mapping_ctr,  ctr6->object_count,
-                                                         ctr6->first_object,
-                                                         ctr6->linked_attributes_count,
-                                                         ctr6->linked_attributes,
-                                                         &gensec_skey)) {
+                                                         ctr6->first_object, &gensec_skey)) {
                                        return false;
                                }