2 Unix SMB/CIFS implementation.
6 Copyright (C) Andrew Tridgell 2003
7 Copyright (C) Stefan (metze) Metzmacher 2004
8 Copyright (C) Andrew Bartlett <abartlet@samba.org> 2005-2006
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #include "torture/torture.h"
26 #include "librpc/gen_ndr/ndr_drsuapi_c.h"
27 #include "torture/rpc/rpc.h"
29 #define TEST_MACHINE_NAME "torturetest"
31 bool test_DsBind(struct dcerpc_pipe *p, struct torture_context *tctx,
32 struct DsPrivate *priv)
35 struct drsuapi_DsBind r;
37 GUID_from_string(DRSUAPI_DS_BIND_GUID, &priv->bind_guid);
39 r.in.bind_guid = &priv->bind_guid;
40 r.in.bind_info = NULL;
41 r.out.bind_handle = &priv->bind_handle;
43 torture_comment(tctx, "testing DsBind\n");
45 status = dcerpc_drsuapi_DsBind(p, tctx, &r);
46 if (!NT_STATUS_IS_OK(status)) {
47 const char *errstr = nt_errstr(status);
48 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
49 errstr = dcerpc_errstr(tctx, p->last_fault_code);
51 torture_fail(tctx, "dcerpc_drsuapi_DsBind failed");
52 } else if (!W_ERROR_IS_OK(r.out.result)) {
53 torture_fail(tctx, "DsBind failed");
59 static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture_context *torture,
60 struct DsPrivate *priv)
63 struct drsuapi_DsGetDomainControllerInfo r;
72 .name = torture_join_dom_netbios_name(priv->join),
76 .name = torture_join_dom_dns_name(priv->join),
80 .name = "__UNKNOWN_DOMAIN__",
81 .expected = WERR_DS_OBJ_NOT_FOUND
84 .name = "unknown.domain.samba.example.com",
85 .expected = WERR_DS_OBJ_NOT_FOUND
88 int levels[] = {1, 2};
91 for (i=0; i < ARRAY_SIZE(levels); i++) {
92 for (j=0; j < ARRAY_SIZE(names); j++) {
94 r.in.bind_handle = &priv->bind_handle;
97 r.in.req.req1.domain_name = names[j].name;
98 r.in.req.req1.level = level;
100 torture_comment(torture,
101 "testing DsGetDomainControllerInfo level %d on domainname '%s'\n",
102 r.in.req.req1.level, r.in.req.req1.domain_name);
104 status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r);
105 torture_assert_ntstatus_ok(torture, status,
106 "dcerpc_drsuapi_DsGetDomainControllerInfo with dns domain failed");
107 torture_assert_werr_equal(torture,
108 r.out.result, names[j].expected,
109 "DsGetDomainControllerInfo level with dns domain failed");
111 if (!W_ERROR_IS_OK(r.out.result)) {
112 /* If this was an error, we can't read the result structure */
116 torture_assert_int_equal(torture,
117 r.in.req.req1.level, r.out.level_out,
118 "dcerpc_drsuapi_DsGetDomainControllerInfo level");
122 for (k=0; k < r.out.ctr.ctr1.count; k++) {
123 if (strcasecmp_m(r.out.ctr.ctr1.array[k].netbios_name,
124 torture_join_netbios_name(priv->join)) == 0) {
131 for (k=0; k < r.out.ctr.ctr2.count; k++) {
132 if (strcasecmp_m(r.out.ctr.ctr2.array[k].netbios_name,
133 torture_join_netbios_name(priv->join)) == 0) {
135 priv->dcinfo = r.out.ctr.ctr2.array[k];
141 torture_assert(torture, found,
142 "dcerpc_drsuapi_DsGetDomainControllerInfo: Failed to find the domain controller we just created during the join");
146 r.in.bind_handle = &priv->bind_handle;
149 r.in.req.req1.domain_name = "__UNKNOWN_DOMAIN__"; /* This is clearly ignored for this level */
150 r.in.req.req1.level = -1;
152 printf("testing DsGetDomainControllerInfo level %d on domainname '%s'\n",
153 r.in.req.req1.level, r.in.req.req1.domain_name);
155 status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r);
157 torture_assert_ntstatus_ok(torture, status,
158 "dcerpc_drsuapi_DsGetDomainControllerInfo with dns domain failed");
159 torture_assert_werr_ok(torture, r.out.result,
160 "DsGetDomainControllerInfo with dns domain failed");
163 const char *dc_account = talloc_asprintf(torture, "%s\\%s$",
164 torture_join_dom_netbios_name(priv->join),
165 priv->dcinfo.netbios_name);
166 for (k=0; k < r.out.ctr.ctr01.count; k++) {
167 if (strcasecmp_m(r.out.ctr.ctr01.array[k].client_account,
173 torture_assert(torture, found,
174 "dcerpc_drsuapi_DsGetDomainControllerInfo level: Failed to find the domain controller in last logon records");
181 static BOOL test_DsWriteAccountSpn(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
182 struct DsPrivate *priv)
185 struct drsuapi_DsWriteAccountSpn r;
186 struct drsuapi_DsNameString names[2];
189 r.in.bind_handle = &priv->bind_handle;
192 printf("testing DsWriteAccountSpn\n");
194 r.in.req.req1.operation = DRSUAPI_DS_SPN_OPERATION_ADD;
195 r.in.req.req1.unknown1 = 0;
196 r.in.req.req1.object_dn = priv->dcinfo.computer_dn;
197 r.in.req.req1.count = 2;
198 r.in.req.req1.spn_names = names;
199 names[0].str = talloc_asprintf(mem_ctx, "smbtortureSPN/%s",priv->dcinfo.netbios_name);
200 names[1].str = talloc_asprintf(mem_ctx, "smbtortureSPN/%s",priv->dcinfo.dns_name);
202 status = dcerpc_drsuapi_DsWriteAccountSpn(p, mem_ctx, &r);
203 if (!NT_STATUS_IS_OK(status)) {
204 const char *errstr = nt_errstr(status);
205 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
206 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
208 printf("dcerpc_drsuapi_DsWriteAccountSpn failed - %s\n", errstr);
210 } else if (!W_ERROR_IS_OK(r.out.result)) {
211 printf("DsWriteAccountSpn failed - %s\n", win_errstr(r.out.result));
215 r.in.req.req1.operation = DRSUAPI_DS_SPN_OPERATION_DELETE;
216 r.in.req.req1.unknown1 = 0;
218 status = dcerpc_drsuapi_DsWriteAccountSpn(p, mem_ctx, &r);
219 if (!NT_STATUS_IS_OK(status)) {
220 const char *errstr = nt_errstr(status);
221 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
222 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
224 printf("dcerpc_drsuapi_DsWriteAccountSpn failed - %s\n", errstr);
226 } else if (!W_ERROR_IS_OK(r.out.result)) {
227 printf("DsWriteAccountSpn failed - %s\n", win_errstr(r.out.result));
234 static BOOL test_DsReplicaGetInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
235 struct DsPrivate *priv)
238 struct drsuapi_DsReplicaGetInfo r;
247 DRSUAPI_DS_REPLICA_GET_INFO,
248 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS,
251 DRSUAPI_DS_REPLICA_GET_INFO,
252 DRSUAPI_DS_REPLICA_INFO_CURSORS,
255 DRSUAPI_DS_REPLICA_GET_INFO,
256 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA,
259 DRSUAPI_DS_REPLICA_GET_INFO,
260 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES,
263 DRSUAPI_DS_REPLICA_GET_INFO,
264 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES,
267 DRSUAPI_DS_REPLICA_GET_INFO,
268 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS,
271 DRSUAPI_DS_REPLICA_GET_INFO2,
272 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA,
275 DRSUAPI_DS_REPLICA_GET_INFO2,
276 DRSUAPI_DS_REPLICA_INFO_CURSORS2,
279 DRSUAPI_DS_REPLICA_GET_INFO2,
280 DRSUAPI_DS_REPLICA_INFO_CURSORS3,
283 DRSUAPI_DS_REPLICA_GET_INFO2,
284 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2,
287 DRSUAPI_DS_REPLICA_GET_INFO2,
288 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2,
291 DRSUAPI_DS_REPLICA_GET_INFO2,
292 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02,
295 DRSUAPI_DS_REPLICA_GET_INFO2,
296 DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04,
299 DRSUAPI_DS_REPLICA_GET_INFO2,
300 DRSUAPI_DS_REPLICA_INFO_CURSORS05,
303 DRSUAPI_DS_REPLICA_GET_INFO2,
304 DRSUAPI_DS_REPLICA_INFO_06,
309 if (lp_parm_bool(-1, "torture", "samba4", False)) {
310 printf("skipping DsReplicaGetInfo test against Samba4\n");
314 r.in.bind_handle = &priv->bind_handle;
316 for (i=0; i < ARRAY_SIZE(array); i++) {
317 const char *object_dn;
319 printf("testing DsReplicaGetInfo level %d infotype %d\n",
320 array[i].level, array[i].infotype);
322 object_dn = (array[i].obj_dn ? array[i].obj_dn : priv->domain_obj_dn);
324 r.in.level = array[i].level;
326 case DRSUAPI_DS_REPLICA_GET_INFO:
327 r.in.req.req1.info_type = array[i].infotype;
328 r.in.req.req1.object_dn = object_dn;
329 ZERO_STRUCT(r.in.req.req1.guid1);
331 case DRSUAPI_DS_REPLICA_GET_INFO2:
332 r.in.req.req2.info_type = array[i].infotype;
333 r.in.req.req2.object_dn = object_dn;
334 ZERO_STRUCT(r.in.req.req1.guid1);
335 r.in.req.req2.unknown1 = 0;
336 r.in.req.req2.string1 = NULL;
337 r.in.req.req2.string2 = NULL;
338 r.in.req.req2.unknown2 = 0;
342 status = dcerpc_drsuapi_DsReplicaGetInfo(p, mem_ctx, &r);
343 if (!NT_STATUS_IS_OK(status)) {
344 const char *errstr = nt_errstr(status);
345 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
346 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
348 if (p->last_fault_code != DCERPC_FAULT_INVALID_TAG) {
349 printf("dcerpc_drsuapi_DsReplicaGetInfo failed - %s\n", errstr);
352 printf("DsReplicaGetInfo level %d and/or infotype %d not supported by server\n",
353 array[i].level, array[i].infotype);
355 } else if (!W_ERROR_IS_OK(r.out.result)) {
356 printf("DsReplicaGetInfo failed - %s\n", win_errstr(r.out.result));
364 static BOOL test_DsReplicaSync(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
365 struct DsPrivate *priv)
370 struct drsuapi_DsReplicaSync r;
371 struct drsuapi_DsReplicaObjectIdentifier nc;
372 struct GUID null_guid;
373 struct dom_sid null_sid;
382 if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
383 printf("DsReplicaSync disabled - enable dangerous tests to use\n");
387 if (lp_parm_bool(-1, "torture", "samba4", False)) {
388 printf("skipping DsReplicaSync test against Samba4\n");
392 ZERO_STRUCT(null_guid);
393 ZERO_STRUCT(null_sid);
395 r.in.bind_handle = &priv->bind_handle;
397 for (i=0; i < ARRAY_SIZE(array); i++) {
398 printf("testing DsReplicaSync level %d\n",
401 r.in.level = array[i].level;
406 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
408 r.in.req.req1.naming_context = &nc;
409 r.in.req.req1.source_dsa_guid = priv->dcinfo.ntds_guid;
410 r.in.req.req1.other_info = NULL;
411 r.in.req.req1.options = 16;
415 status = dcerpc_drsuapi_DsReplicaSync(p, mem_ctx, &r);
416 if (!NT_STATUS_IS_OK(status)) {
417 const char *errstr = nt_errstr(status);
418 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
419 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
421 printf("dcerpc_drsuapi_DsReplicaSync failed - %s\n", errstr);
423 } else if (!W_ERROR_IS_OK(r.out.result)) {
424 printf("DsReplicaSync failed - %s\n", win_errstr(r.out.result));
432 static BOOL test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
433 struct DsPrivate *priv)
438 struct drsuapi_DsReplicaUpdateRefs r;
439 struct drsuapi_DsReplicaObjectIdentifier nc;
440 struct GUID null_guid;
441 struct dom_sid null_sid;
450 if (lp_parm_bool(-1, "torture", "samba4", False)) {
451 printf("skipping DsReplicaUpdateRefs test against Samba4\n");
455 ZERO_STRUCT(null_guid);
456 ZERO_STRUCT(null_sid);
458 r.in.bind_handle = &priv->bind_handle;
460 for (i=0; i < ARRAY_SIZE(array); i++) {
461 printf("testing DsReplicaUpdateRefs level %d\n",
464 r.in.level = array[i].level;
469 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
471 r.in.req.req1.naming_context = &nc;
472 r.in.req.req1.dest_dsa_dns_name = talloc_asprintf(mem_ctx, "__some_dest_dsa_guid_string._msdn.%s",
473 priv->domain_dns_name);
474 r.in.req.req1.dest_dsa_guid = null_guid;
475 r.in.req.req1.options = 0;
479 status = dcerpc_drsuapi_DsReplicaUpdateRefs(p, mem_ctx, &r);
480 if (!NT_STATUS_IS_OK(status)) {
481 const char *errstr = nt_errstr(status);
482 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
483 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
485 printf("dcerpc_drsuapi_DsReplicaUpdateRefs failed - %s\n", errstr);
487 } else if (!W_ERROR_IS_OK(r.out.result)) {
488 printf("DsReplicaUpdateRefs failed - %s\n", win_errstr(r.out.result));
496 static BOOL test_DsGetNCChanges(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
497 struct DsPrivate *priv)
502 struct drsuapi_DsGetNCChanges r;
503 struct drsuapi_DsReplicaObjectIdentifier nc;
504 struct GUID null_guid;
505 struct dom_sid null_sid;
517 if (lp_parm_bool(-1, "torture", "samba4", False)) {
518 printf("skipping DsGetNCChanges test against Samba4\n");
522 ZERO_STRUCT(null_guid);
523 ZERO_STRUCT(null_sid);
525 for (i=0; i < ARRAY_SIZE(array); i++) {
526 printf("testing DsGetNCChanges level %d\n",
529 r.in.bind_handle = &priv->bind_handle;
530 r.in.level = &array[i].level;
532 switch (*r.in.level) {
536 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
538 r.in.req.req5.destination_dsa_guid = GUID_random();
539 r.in.req.req5.source_dsa_invocation_id = null_guid;
540 r.in.req.req5.naming_context = &nc;
541 r.in.req.req5.highwatermark.tmp_highest_usn = 0;
542 r.in.req.req5.highwatermark.reserved_usn = 0;
543 r.in.req.req5.highwatermark.highest_usn = 0;
544 r.in.req.req5.uptodateness_vector = NULL;
545 r.in.req.req5.replica_flags = 0;
546 if (lp_parm_bool(-1, "drsuapi","compression", False)) {
547 r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
549 r.in.req.req5.max_object_count = 0;
550 r.in.req.req5.max_ndr_size = 0;
551 r.in.req.req5.unknown4 = 0;
552 r.in.req.req5.h1 = 0;
558 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
560 r.in.req.req8.destination_dsa_guid = GUID_random();
561 r.in.req.req8.source_dsa_invocation_id = null_guid;
562 r.in.req.req8.naming_context = &nc;
563 r.in.req.req8.highwatermark.tmp_highest_usn = 0;
564 r.in.req.req8.highwatermark.reserved_usn = 0;
565 r.in.req.req8.highwatermark.highest_usn = 0;
566 r.in.req.req8.uptodateness_vector = NULL;
567 r.in.req.req8.replica_flags = 0;
568 if (lp_parm_bool(-1,"drsuapi","compression",False)) {
569 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
571 if (lp_parm_bool(-1,"drsuapi","neighbour_writeable",True)) {
572 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE;
574 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
575 | DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS
576 | DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS
577 | DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED
579 r.in.req.req8.max_object_count = 402;
580 r.in.req.req8.max_ndr_size = 402116;
581 r.in.req.req8.unknown4 = 0;
582 r.in.req.req8.h1 = 0;
583 r.in.req.req8.unique_ptr1 = 0;
584 r.in.req.req8.unique_ptr2 = 0;
585 r.in.req.req8.mapping_ctr.num_mappings = 0;
586 r.in.req.req8.mapping_ctr.mappings = NULL;
591 status = dcerpc_drsuapi_DsGetNCChanges(p, mem_ctx, &r);
592 if (!NT_STATUS_IS_OK(status)) {
593 const char *errstr = nt_errstr(status);
594 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
595 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
597 printf("dcerpc_drsuapi_DsGetNCChanges failed - %s\n", errstr);
599 } else if (!W_ERROR_IS_OK(r.out.result)) {
600 printf("DsGetNCChanges failed - %s\n", win_errstr(r.out.result));
608 BOOL test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
609 struct DsPrivate *priv)
612 struct drsuapi_QuerySitesByCost r;
615 const char *my_site = "Default-First-Site-Name";
616 const char *remote_site1 = "smbtorture-nonexisting-site1";
617 const char *remote_site2 = "smbtorture-nonexisting-site2";
619 r.in.bind_handle = &priv->bind_handle;
621 r.in.req.req1.site_from = talloc_strdup(mem_ctx, my_site);
622 r.in.req.req1.num_req = 2;
623 r.in.req.req1.site_to = talloc_zero_array(mem_ctx, const char *, r.in.req.req1.num_req);
624 r.in.req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1);
625 r.in.req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2);
626 r.in.req.req1.flags = 0;
628 status = dcerpc_drsuapi_QuerySitesByCost(p, mem_ctx, &r);
629 if (!NT_STATUS_IS_OK(status)) {
630 const char *errstr = nt_errstr(status);
631 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
632 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
634 printf("drsuapi_QuerySitesByCost - %s\n", errstr);
636 } else if (!W_ERROR_IS_OK(r.out.result)) {
637 printf("QuerySitesByCost failed - %s\n", win_errstr(r.out.result));
641 if (W_ERROR_IS_OK(r.out.result)) {
643 if (!W_ERROR_EQUAL(r.out.ctr.ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) ||
644 !W_ERROR_EQUAL(r.out.ctr.ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) {
645 printf("expected error_code WERR_DS_OBJ_NOT_FOUND, got %s\n",
646 win_errstr(r.out.ctr.ctr1.info[0].error_code));
650 if ((r.out.ctr.ctr1.info[0].site_cost != (uint32_t) -1) ||
651 (r.out.ctr.ctr1.info[1].site_cost != (uint32_t) -1)) {
652 printf("expected site_cost %d, got %d\n",
653 (uint32_t) -1, r.out.ctr.ctr1.info[0].site_cost);
663 BOOL test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
664 struct DsPrivate *priv)
667 struct drsuapi_DsUnbind r;
670 r.in.bind_handle = &priv->bind_handle;
671 r.out.bind_handle = &priv->bind_handle;
673 printf("testing DsUnbind\n");
675 status = dcerpc_drsuapi_DsUnbind(p, mem_ctx, &r);
676 if (!NT_STATUS_IS_OK(status)) {
677 const char *errstr = nt_errstr(status);
678 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
679 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
681 printf("dcerpc_drsuapi_DsUnbind failed - %s\n", errstr);
683 } else if (!W_ERROR_IS_OK(r.out.result)) {
684 printf("DsBind failed - %s\n", win_errstr(r.out.result));
691 bool torture_rpc_drsuapi(struct torture_context *torture)
694 struct dcerpc_pipe *p;
696 struct DsPrivate priv;
697 struct cli_credentials *machine_credentials;
701 priv.join = torture_join_domain(TEST_MACHINE_NAME, ACB_SVRTRUST,
702 &machine_credentials);
704 torture_fail(torture, "Failed to join as BDC");
707 status = torture_rpc_connection(torture,
710 if (!NT_STATUS_IS_OK(status)) {
711 torture_leave_domain(priv.join);
712 torture_fail(torture, "Unable to connect to DRSUAPI pipe");
715 ret &= test_DsBind(p, torture, &priv);
717 ret &= test_QuerySitesByCost(p, torture, &priv);
719 ret &= test_DsGetDomainControllerInfo(p, torture, &priv);
721 ret &= test_DsCrackNames(p, torture, &priv);
723 ret &= test_DsWriteAccountSpn(p, torture, &priv);
725 ret &= test_DsReplicaGetInfo(p, torture, &priv);
727 ret &= test_DsReplicaSync(p, torture, &priv);
729 ret &= test_DsReplicaUpdateRefs(p, torture, &priv);
731 ret &= test_DsGetNCChanges(p, torture, &priv);
733 ret &= test_DsUnbind(p, torture, &priv);
735 torture_leave_domain(priv.join);
741 bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
744 struct dcerpc_pipe *p;
746 struct DsPrivate priv;
747 struct cli_credentials *machine_credentials;
749 torture_comment(torture, "Connected to DRSUAPI pipe\n");
753 priv.join = torture_join_domain(TEST_MACHINE_NAME, ACB_SVRTRUST,
754 &machine_credentials);
756 torture_fail(torture, "Failed to join as BDC\n");
759 status = torture_rpc_connection(torture,
762 if (!NT_STATUS_IS_OK(status)) {
763 torture_leave_domain(priv.join);
764 torture_fail(torture, "Unable to connect to DRSUAPI pipe");
767 ret &= test_DsBind(p, torture, &priv);
770 /* We don't care if this fails, we just need some info from it */
771 test_DsGetDomainControllerInfo(p, torture, &priv);
773 ret &= test_DsCrackNames(p, torture, &priv);
775 ret &= test_DsUnbind(p, torture, &priv);
778 torture_leave_domain(priv.join);