2 Unix SMB/CIFS implementation.
4 DsGetNCChanges replication test
6 Copyright (C) Stefan (metze) Metzmacher 2005
7 Copyright (C) Brad Henry 2005
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "lib/cmdline/popt_common.h"
26 #include "librpc/gen_ndr/ndr_drsuapi_c.h"
27 #include "libcli/cldap/cldap.h"
28 #include "libcli/ldap/ldap_client.h"
29 #include "torture/ldap/proto.h"
31 struct DsSyncBindInfo
{
32 struct dcerpc_pipe
*pipe
;
33 struct drsuapi_DsBind req
;
34 struct GUID bind_guid
;
35 struct drsuapi_DsBindInfoCtr our_bind_info_ctr
;
36 struct drsuapi_DsBindInfo28 our_bind_info28
;
37 struct drsuapi_DsBindInfo28 peer_bind_info28
;
38 struct policy_handle bind_handle
;
41 struct DsSyncLDAPInfo
{
42 struct ldap_connection
*conn
;
46 struct dcerpc_binding
*drsuapi_binding
;
49 const char *site_name
;
51 const char *domain_dn
;
53 /* what we need to do as 'Administrator' */
55 struct cli_credentials
*credentials
;
56 struct DsSyncBindInfo drsuapi
;
57 struct DsSyncLDAPInfo ldap
;
60 /* what we need to do as the new dc machine account */
62 struct cli_credentials
*credentials
;
63 struct DsSyncBindInfo drsuapi
;
64 struct drsuapi_DsGetDCInfo2 dc_info2
;
65 struct GUID invocation_id
;
66 struct GUID object_guid
;
69 /* info about the old dc */
71 struct drsuapi_DsGetDomainControllerInfo dc_info
;
75 static struct DsSyncTest
*test_create_context(TALLOC_CTX
*mem_ctx
)
78 struct DsSyncTest
*ctx
;
79 struct drsuapi_DsBindInfo28
*our_bind_info28
;
80 struct drsuapi_DsBindInfoCtr
*our_bind_info_ctr
;
81 const char *binding
= lp_parm_string(-1, "torture", "binding");
82 ctx
= talloc_zero(mem_ctx
, struct DsSyncTest
);
83 if (!ctx
) return NULL
;
85 status
= dcerpc_parse_binding(ctx
, binding
, &ctx
->drsuapi_binding
);
86 if (!NT_STATUS_IS_OK(status
)) {
87 printf("Bad binding string %s\n", binding
);
90 ctx
->drsuapi_binding
->flags
|= DCERPC_SIGN
| DCERPC_SEAL
;
92 ctx
->ldap_url
= talloc_asprintf(ctx
, "ldap://%s/", ctx
->drsuapi_binding
->host
);
95 ctx
->admin
.credentials
= cmdline_credentials
;
97 our_bind_info28
= &ctx
->admin
.drsuapi
.our_bind_info28
;
98 our_bind_info28
->supported_extensions
= 0xFFFFFFFF;
99 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3
;
100 our_bind_info28
->site_guid
= GUID_zero();
101 our_bind_info28
->u1
= 0;
102 our_bind_info28
->repl_epoch
= 1;
104 our_bind_info_ctr
= &ctx
->admin
.drsuapi
.our_bind_info_ctr
;
105 our_bind_info_ctr
->length
= 28;
106 our_bind_info_ctr
->info
.info28
= *our_bind_info28
;
108 GUID_from_string(DRSUAPI_DS_BIND_GUID
, &ctx
->admin
.drsuapi
.bind_guid
);
110 ctx
->admin
.drsuapi
.req
.in
.bind_guid
= &ctx
->admin
.drsuapi
.bind_guid
;
111 ctx
->admin
.drsuapi
.req
.in
.bind_info
= our_bind_info_ctr
;
112 ctx
->admin
.drsuapi
.req
.out
.bind_handle
= &ctx
->admin
.drsuapi
.bind_handle
;
116 our_bind_info28
= &ctx
->new_dc
.drsuapi
.our_bind_info28
;
117 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_BASE
;
118 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_ASYNC_REPLICATION
;
119 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_REMOVEAPI
;
120 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_MOVEREQ_V2
;
121 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHG_COMPRESS
;
122 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V1
;
123 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_RESTORE_USN_OPTIMIZATION
;
124 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_KCC_EXECUTE
;
125 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2
;
126 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION
;
127 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2
;
128 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD
;
129 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND
;
130 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO
;
131 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION
;
132 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V01
;
133 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_TRANSITIVE_MEMBERSHIP
;
134 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_ADD_SID_HISTORY
;
135 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_POST_BETA3
;
136 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GET_MEMBERSHIPS2
;
137 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V6
;
138 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_NONDOMAIN_NCS
;
139 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREQ_V8
;
140 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V5
;
141 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V6
;
142 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3
;
143 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7
;
144 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT
;
145 if (lp_parm_bool(-1,"dssync","xpress",False
)) {
146 our_bind_info28
->supported_extensions
|= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS
;
148 our_bind_info28
->site_guid
= GUID_zero();
149 our_bind_info28
->u1
= 508;
150 our_bind_info28
->repl_epoch
= 0;
152 our_bind_info_ctr
= &ctx
->new_dc
.drsuapi
.our_bind_info_ctr
;
153 our_bind_info_ctr
->length
= 28;
154 our_bind_info_ctr
->info
.info28
= *our_bind_info28
;
156 GUID_from_string(DRSUAPI_DS_BIND_GUID_W2K3
, &ctx
->new_dc
.drsuapi
.bind_guid
);
158 ctx
->new_dc
.drsuapi
.req
.in
.bind_guid
= &ctx
->new_dc
.drsuapi
.bind_guid
;
159 ctx
->new_dc
.drsuapi
.req
.in
.bind_info
= our_bind_info_ctr
;
160 ctx
->new_dc
.drsuapi
.req
.out
.bind_handle
= &ctx
->new_dc
.drsuapi
.bind_handle
;
167 static BOOL
_test_DsBind(struct DsSyncTest
*ctx
, struct cli_credentials
*credentials
, struct DsSyncBindInfo
*b
)
171 struct event_context
*event
= NULL
;
173 status
= dcerpc_pipe_connect_b(ctx
,
174 &b
->pipe
, ctx
->drsuapi_binding
,
175 &dcerpc_table_drsuapi
,
178 if (!NT_STATUS_IS_OK(status
)) {
179 printf("Failed to connect to server as a BDC: %s\n", nt_errstr(status
));
183 status
= dcerpc_drsuapi_DsBind(b
->pipe
, ctx
, &b
->req
);
184 if (!NT_STATUS_IS_OK(status
)) {
185 const char *errstr
= nt_errstr(status
);
186 if (NT_STATUS_EQUAL(status
, NT_STATUS_NET_WRITE_FAULT
)) {
187 errstr
= dcerpc_errstr(ctx
, b
->pipe
->last_fault_code
);
189 printf("dcerpc_drsuapi_DsBind failed - %s\n", errstr
);
191 } else if (!W_ERROR_IS_OK(b
->req
.out
.result
)) {
192 printf("DsBind failed - %s\n", win_errstr(b
->req
.out
.result
));
196 ZERO_STRUCT(b
->peer_bind_info28
);
197 if (b
->req
.out
.bind_info
) {
198 switch (b
->req
.out
.bind_info
->length
) {
200 struct drsuapi_DsBindInfo24
*info24
;
201 info24
= &b
->req
.out
.bind_info
->info
.info24
;
202 b
->peer_bind_info28
.supported_extensions
= info24
->supported_extensions
;
203 b
->peer_bind_info28
.site_guid
= info24
->site_guid
;
204 b
->peer_bind_info28
.u1
= info24
->u1
;
205 b
->peer_bind_info28
.repl_epoch
= 0;
209 b
->peer_bind_info28
= b
->req
.out
.bind_info
->info
.info28
;
217 static BOOL
test_LDAPBind(struct DsSyncTest
*ctx
, struct cli_credentials
*credentials
, struct DsSyncLDAPInfo
*l
)
222 status
= torture_ldap_connection(ctx
, &l
->conn
, ctx
->ldap_url
);
223 if (!NT_STATUS_IS_OK(status
)) {
224 printf("failed to connect to LDAP: %s\n", ctx
->ldap_url
);
228 printf("connected to LDAP: %s\n", ctx
->ldap_url
);
230 status
= torture_ldap_bind_sasl(l
->conn
, credentials
);
231 if (!NT_STATUS_IS_OK(status
)) {
232 printf("failed to bind to LDAP:\n");
235 printf("bound to LDAP.\n");
240 static BOOL
test_GetInfo(struct DsSyncTest
*ctx
)
243 struct drsuapi_DsCrackNames r
;
244 struct drsuapi_DsNameString names
[1];
247 struct cldap_socket
*cldap
= cldap_socket_init(ctx
, NULL
);
248 struct cldap_netlogon search
;
250 r
.in
.bind_handle
= &ctx
->admin
.drsuapi
.bind_handle
;
252 r
.in
.req
.req1
.unknown1
= 0x000004e4;
253 r
.in
.req
.req1
.unknown2
= 0x00000407;
254 r
.in
.req
.req1
.count
= 1;
255 r
.in
.req
.req1
.names
= names
;
256 r
.in
.req
.req1
.format_flags
= DRSUAPI_DS_NAME_FLAG_NO_FLAGS
;
257 r
.in
.req
.req1
.format_offered
= DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT
;
258 r
.in
.req
.req1
.format_desired
= DRSUAPI_DS_NAME_FORMAT_FQDN_1779
;
259 names
[0].str
= talloc_asprintf(ctx
, "%s\\", lp_workgroup());
261 status
= dcerpc_drsuapi_DsCrackNames(ctx
->admin
.drsuapi
.pipe
, ctx
, &r
);
262 if (!NT_STATUS_IS_OK(status
)) {
263 const char *errstr
= nt_errstr(status
);
264 if (NT_STATUS_EQUAL(status
, NT_STATUS_NET_WRITE_FAULT
)) {
265 errstr
= dcerpc_errstr(ctx
, ctx
->admin
.drsuapi
.pipe
->last_fault_code
);
267 printf("dcerpc_drsuapi_DsCrackNames failed - %s\n", errstr
);
269 } else if (!W_ERROR_IS_OK(r
.out
.result
)) {
270 printf("DsCrackNames failed - %s\n", win_errstr(r
.out
.result
));
274 ctx
->domain_dn
= r
.out
.ctr
.ctr1
->array
[0].result_name
;
277 search
.in
.dest_address
= ctx
->drsuapi_binding
->host
;
278 search
.in
.acct_control
= -1;
279 search
.in
.version
= 6;
280 status
= cldap_netlogon(cldap
, ctx
, &search
);
281 if (!NT_STATUS_IS_OK(status
)) {
282 const char *errstr
= nt_errstr(status
);
283 ctx
->site_name
= talloc_asprintf(ctx
, "%s", "Default-First-Site-Name");
284 printf("cldap_netlogon() returned %s. Defaulting to Site-Name: %s\n", errstr
, ctx
->site_name
);
286 ctx
->site_name
= talloc_steal(ctx
, search
.out
.netlogon
.logon5
.site_name
);
287 printf("cldap_netlogon() returned Site-Name: %s.\n",ctx
->site_name
);
291 ctx
->new_dc
.invocation_id
= GUID_random();
296 static void test_analyse_objects(struct DsSyncTest
*ctx
,
297 struct drsuapi_DsReplicaObjectListItemEx
*cur
)
299 if (!lp_parm_bool(-1,"dssync","print_pwd_blobs",False
)) {
303 for (; cur
; cur
= cur
->next_object
) {
305 BOOL dn_printed
= False
;
308 if (!cur
->object
.identifier
) continue;
310 dn
= cur
->object
.identifier
->dn
;
312 for (i
=0; i
< cur
->object
.attribute_ctr
.num_attributes
; i
++) {
313 const char *name
= NULL
;
314 DATA_BLOB
*data
= NULL
;
315 struct drsuapi_DsReplicaAttribute
*attr
;
316 attr
= &cur
->object
.attribute_ctr
.attributes
[i
];
318 switch (attr
->attid
) {
319 case DRSUAPI_ATTRIBUTE_dBCSPwd
:
322 case DRSUAPI_ATTRIBUTE_unicodePwd
:
325 case DRSUAPI_ATTRIBUTE_ntPwdHistory
:
326 name
= "ntPwdHistory";
328 case DRSUAPI_ATTRIBUTE_lmPwdHistory
:
329 name
= "lmPwdHistory";
331 case DRSUAPI_ATTRIBUTE_supplementalCredentials
:
332 name
= "supplementalCredentials";
334 case DRSUAPI_ATTRIBUTE_msDS_KeyVersionNumber
:
335 name
= "msDS-KeyVersionNumber";
341 if (attr
->value_ctr
.data_blob
.num_values
!= 1) continue;
343 if (!attr
->value_ctr
.data_blob
.values
[0].data
) continue;
345 data
= attr
->value_ctr
.data_blob
.values
[0].data
;
348 DEBUG(0,("DN: %s\n", dn
));
351 DEBUGADD(0,("ATTR: %s data_blob.length=%lu\n",
352 name
, (long)data
->length
));
353 dump_data(0,data
->data
, data
->length
);
358 static BOOL
test_FetchData(struct DsSyncTest
*ctx
)
363 uint64_t highest_usn
= 0;
364 const char *partition
= NULL
;
365 struct drsuapi_DsGetNCChanges r
;
366 struct drsuapi_DsReplicaObjectIdentifier nc
;
367 struct drsuapi_DsGetNCChangesCtr1
*ctr1
= NULL
;
368 struct drsuapi_DsGetNCChangesCtr6
*ctr6
= NULL
;
369 int32_t out_level
= 0;
370 struct GUID null_guid
;
371 struct dom_sid null_sid
;
383 ZERO_STRUCT(null_guid
);
384 ZERO_STRUCT(null_sid
);
386 partition
= lp_parm_string(-1, "dssync", "partition");
387 if (partition
== NULL
) {
388 partition
= ctx
->domain_dn
;
389 printf("dssync:partition not specified, defaulting to %s.\n", ctx
->domain_dn
);
392 highest_usn
= lp_parm_int(-1, "dssync", "highest_usn", 0);
394 for (i
=0; i
< ARRAY_SIZE(array
); i
++) {
395 printf("testing DsGetNCChanges level %d\n",
398 r
.in
.bind_handle
= &ctx
->new_dc
.drsuapi
.bind_handle
;
399 r
.in
.level
= array
[i
].level
;
401 switch (r
.in
.level
) {
407 r
.in
.req
.req5
.destination_dsa_guid
= ctx
->new_dc
.invocation_id
;
408 r
.in
.req
.req5
.source_dsa_guid
= null_guid
;
409 r
.in
.req
.req5
.naming_context
= &nc
;
410 r
.in
.req
.req5
.highwatermark
.tmp_highest_usn
= highest_usn
;
411 r
.in
.req
.req5
.highwatermark
.reserved_usn
= 0;
412 r
.in
.req
.req5
.highwatermark
.highest_usn
= highest_usn
;
413 r
.in
.req
.req5
.uptodateness_vector
= NULL
;
414 r
.in
.req
.req5
.replica_flags
= 0;
415 if (lp_parm_bool(-1,"dssync","compression",False
)) {
416 r
.in
.req
.req5
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES
;
418 if (lp_parm_bool(-1,"dssync","neighbour_writeable",True
)) {
419 r
.in
.req
.req5
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE
;
421 r
.in
.req
.req5
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
422 | DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS
423 | DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS
424 | DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED
426 r
.in
.req
.req5
.unknown2
= 133;
427 r
.in
.req
.req5
.unknown3
= 1336770;
428 r
.in
.req
.req5
.unknown4
= 0;
429 r
.in
.req
.req5
.h1
= 0;
436 /* nc.dn can be set to any other ad partition */
438 r
.in
.req
.req8
.destination_dsa_guid
= ctx
->new_dc
.invocation_id
;
439 r
.in
.req
.req8
.source_dsa_guid
= null_guid
;
440 r
.in
.req
.req8
.naming_context
= &nc
;
441 r
.in
.req
.req8
.highwatermark
.tmp_highest_usn
= highest_usn
;
442 r
.in
.req
.req8
.highwatermark
.reserved_usn
= 0;
443 r
.in
.req
.req8
.highwatermark
.highest_usn
= highest_usn
;
444 r
.in
.req
.req8
.uptodateness_vector
= NULL
;
445 r
.in
.req
.req8
.replica_flags
= 0;
446 if (lp_parm_bool(-1,"dssync","compression",False
)) {
447 r
.in
.req
.req8
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES
;
449 if (lp_parm_bool(-1,"dssync","neighbour_writeable",True
)) {
450 r
.in
.req
.req8
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE
;
452 r
.in
.req
.req8
.replica_flags
|= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
453 | DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS
454 | DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS
455 | DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED
457 r
.in
.req
.req8
.unknown2
= 402;
458 r
.in
.req
.req8
.unknown3
= 402116;
460 r
.in
.req
.req8
.unknown4
= 0;
461 r
.in
.req
.req8
.h1
= 0;
462 r
.in
.req
.req8
.unique_ptr1
= 0;
463 r
.in
.req
.req8
.unique_ptr2
= 0;
464 r
.in
.req
.req8
.ctr12
.count
= 0;
465 r
.in
.req
.req8
.ctr12
.array
= NULL
;
470 printf("Dumping AD partition: %s\n", nc
.dn
);
474 if (r
.in
.level
== 5) {
475 DEBUG(0,("start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",y
,
476 (long long)r
.in
.req
.req5
.highwatermark
.tmp_highest_usn
,
477 (long long)r
.in
.req
.req5
.highwatermark
.highest_usn
));
480 if (r
.in
.level
== 8) {
481 DEBUG(0,("start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",y
,
482 (long long)r
.in
.req
.req8
.highwatermark
.tmp_highest_usn
,
483 (long long)r
.in
.req
.req8
.highwatermark
.highest_usn
));
486 status
= dcerpc_drsuapi_DsGetNCChanges(ctx
->new_dc
.drsuapi
.pipe
, ctx
, &r
);
487 if (!NT_STATUS_IS_OK(status
)) {
488 const char *errstr
= nt_errstr(status
);
489 if (NT_STATUS_EQUAL(status
, NT_STATUS_NET_WRITE_FAULT
)) {
490 errstr
= dcerpc_errstr(ctx
, ctx
->new_dc
.drsuapi
.pipe
->last_fault_code
);
492 printf("dcerpc_drsuapi_DsGetNCChanges failed - %s\n", errstr
);
494 } else if (!W_ERROR_IS_OK(r
.out
.result
)) {
495 printf("DsGetNCChanges failed - %s\n", win_errstr(r
.out
.result
));
499 if (ret
== True
&& r
.out
.level
== 1) {
501 ctr1
= &r
.out
.ctr
.ctr1
;
502 } else if (ret
== True
&& r
.out
.level
== 2) {
504 ctr1
= r
.out
.ctr
.ctr2
.ctr
.mszip1
.ctr1
;
507 if (out_level
== 1) {
508 DEBUG(0,("end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",y
,
509 (long long)ctr1
->new_highwatermark
.tmp_highest_usn
,
510 (long long)ctr1
->new_highwatermark
.highest_usn
));
512 test_analyse_objects(ctx
, ctr1
->first_object
);
514 if (ctr1
->new_highwatermark
.tmp_highest_usn
> ctr1
->new_highwatermark
.highest_usn
) {
515 r
.in
.req
.req5
.highwatermark
= ctr1
->new_highwatermark
;
520 if (ret
== True
&& r
.out
.level
== 6) {
522 ctr6
= &r
.out
.ctr
.ctr6
;
523 } else if (ret
== True
&& r
.out
.level
== 7
524 && r
.out
.ctr
.ctr7
.level
== 6
525 && r
.out
.ctr
.ctr7
.type
== DRSUAPI_COMPRESSION_TYPE_MSZIP
) {
527 ctr6
= r
.out
.ctr
.ctr7
.ctr
.mszip6
.ctr6
;
530 if (out_level
== 6) {
531 DEBUG(0,("end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",y
,
532 (long long)ctr6
->new_highwatermark
.tmp_highest_usn
,
533 (long long)ctr6
->new_highwatermark
.highest_usn
));
535 test_analyse_objects(ctx
, ctr6
->first_object
);
537 if (ctr6
->new_highwatermark
.tmp_highest_usn
> ctr6
->new_highwatermark
.highest_usn
) {
538 r
.in
.req
.req8
.highwatermark
= ctr6
->new_highwatermark
;
550 BOOL
torture_rpc_dssync(void)
554 struct DsSyncTest
*ctx
;
556 mem_ctx
= talloc_init("torture_rpc_dssync");
557 ctx
= test_create_context(mem_ctx
);
559 ret
&= _test_DsBind(ctx
, ctx
->admin
.credentials
, &ctx
->admin
.drsuapi
);
560 ret
&= test_LDAPBind(ctx
, ctx
->admin
.credentials
, &ctx
->admin
.ldap
);
561 ret
&= test_GetInfo(ctx
);
562 ret
&= _test_DsBind(ctx
, ctx
->admin
.credentials
, &ctx
->new_dc
.drsuapi
);
563 ret
&= test_FetchData(ctx
);