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"
28 #include "param/param.h"
30 #define TEST_MACHINE_NAME "torturetest"
32 bool test_DsBind(struct dcerpc_pipe *p, struct torture_context *tctx,
33 struct DsPrivate *priv)
36 struct drsuapi_DsBind r;
38 GUID_from_string(DRSUAPI_DS_BIND_GUID, &priv->bind_guid);
40 r.in.bind_guid = &priv->bind_guid;
41 r.in.bind_info = NULL;
42 r.out.bind_handle = &priv->bind_handle;
44 torture_comment(tctx, "testing DsBind\n");
46 status = dcerpc_drsuapi_DsBind(p, tctx, &r);
47 if (!NT_STATUS_IS_OK(status)) {
48 const char *errstr = nt_errstr(status);
49 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
50 errstr = dcerpc_errstr(tctx, p->last_fault_code);
52 torture_fail(tctx, "dcerpc_drsuapi_DsBind failed");
53 } else if (!W_ERROR_IS_OK(r.out.result)) {
54 torture_fail(tctx, "DsBind failed");
60 static bool test_DsGetDomainControllerInfo(struct dcerpc_pipe *p, struct torture_context *torture,
61 struct DsPrivate *priv)
64 struct drsuapi_DsGetDomainControllerInfo r;
73 .name = torture_join_dom_netbios_name(priv->join),
77 .name = torture_join_dom_dns_name(priv->join),
81 .name = "__UNKNOWN_DOMAIN__",
82 .expected = WERR_DS_OBJ_NOT_FOUND
85 .name = "unknown.domain.samba.example.com",
86 .expected = WERR_DS_OBJ_NOT_FOUND
89 int levels[] = {1, 2};
92 for (i=0; i < ARRAY_SIZE(levels); i++) {
93 for (j=0; j < ARRAY_SIZE(names); j++) {
95 r.in.bind_handle = &priv->bind_handle;
98 r.in.req.req1.domain_name = names[j].name;
99 r.in.req.req1.level = level;
101 torture_comment(torture,
102 "testing DsGetDomainControllerInfo level %d on domainname '%s'\n",
103 r.in.req.req1.level, r.in.req.req1.domain_name);
105 status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r);
106 torture_assert_ntstatus_ok(torture, status,
107 "dcerpc_drsuapi_DsGetDomainControllerInfo with dns domain failed");
108 torture_assert_werr_equal(torture,
109 r.out.result, names[j].expected,
110 "DsGetDomainControllerInfo level with dns domain failed");
112 if (!W_ERROR_IS_OK(r.out.result)) {
113 /* If this was an error, we can't read the result structure */
117 torture_assert_int_equal(torture,
118 r.in.req.req1.level, r.out.level_out,
119 "dcerpc_drsuapi_DsGetDomainControllerInfo level");
123 for (k=0; k < r.out.ctr.ctr1.count; k++) {
124 if (strcasecmp_m(r.out.ctr.ctr1.array[k].netbios_name,
125 torture_join_netbios_name(priv->join)) == 0) {
132 for (k=0; k < r.out.ctr.ctr2.count; k++) {
133 if (strcasecmp_m(r.out.ctr.ctr2.array[k].netbios_name,
134 torture_join_netbios_name(priv->join)) == 0) {
136 priv->dcinfo = r.out.ctr.ctr2.array[k];
142 torture_assert(torture, found,
143 "dcerpc_drsuapi_DsGetDomainControllerInfo: Failed to find the domain controller we just created during the join");
147 r.in.bind_handle = &priv->bind_handle;
150 r.in.req.req1.domain_name = "__UNKNOWN_DOMAIN__"; /* This is clearly ignored for this level */
151 r.in.req.req1.level = -1;
153 printf("testing DsGetDomainControllerInfo level %d on domainname '%s'\n",
154 r.in.req.req1.level, r.in.req.req1.domain_name);
156 status = dcerpc_drsuapi_DsGetDomainControllerInfo(p, torture, &r);
158 torture_assert_ntstatus_ok(torture, status,
159 "dcerpc_drsuapi_DsGetDomainControllerInfo with dns domain failed");
160 torture_assert_werr_ok(torture, r.out.result,
161 "DsGetDomainControllerInfo with dns domain failed");
164 const char *dc_account = talloc_asprintf(torture, "%s\\%s$",
165 torture_join_dom_netbios_name(priv->join),
166 priv->dcinfo.netbios_name);
167 for (k=0; k < r.out.ctr.ctr01.count; k++) {
168 if (strcasecmp_m(r.out.ctr.ctr01.array[k].client_account,
174 torture_assert(torture, found,
175 "dcerpc_drsuapi_DsGetDomainControllerInfo level: Failed to find the domain controller in last logon records");
182 static bool test_DsWriteAccountSpn(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
183 struct DsPrivate *priv)
186 struct drsuapi_DsWriteAccountSpn r;
187 struct drsuapi_DsNameString names[2];
190 r.in.bind_handle = &priv->bind_handle;
193 printf("testing DsWriteAccountSpn\n");
195 r.in.req.req1.operation = DRSUAPI_DS_SPN_OPERATION_ADD;
196 r.in.req.req1.unknown1 = 0;
197 r.in.req.req1.object_dn = priv->dcinfo.computer_dn;
198 r.in.req.req1.count = 2;
199 r.in.req.req1.spn_names = names;
200 names[0].str = talloc_asprintf(mem_ctx, "smbtortureSPN/%s",priv->dcinfo.netbios_name);
201 names[1].str = talloc_asprintf(mem_ctx, "smbtortureSPN/%s",priv->dcinfo.dns_name);
203 status = dcerpc_drsuapi_DsWriteAccountSpn(p, mem_ctx, &r);
204 if (!NT_STATUS_IS_OK(status)) {
205 const char *errstr = nt_errstr(status);
206 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
207 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
209 printf("dcerpc_drsuapi_DsWriteAccountSpn failed - %s\n", errstr);
211 } else if (!W_ERROR_IS_OK(r.out.result)) {
212 printf("DsWriteAccountSpn failed - %s\n", win_errstr(r.out.result));
216 r.in.req.req1.operation = DRSUAPI_DS_SPN_OPERATION_DELETE;
217 r.in.req.req1.unknown1 = 0;
219 status = dcerpc_drsuapi_DsWriteAccountSpn(p, mem_ctx, &r);
220 if (!NT_STATUS_IS_OK(status)) {
221 const char *errstr = nt_errstr(status);
222 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
223 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
225 printf("dcerpc_drsuapi_DsWriteAccountSpn failed - %s\n", errstr);
227 } else if (!W_ERROR_IS_OK(r.out.result)) {
228 printf("DsWriteAccountSpn failed - %s\n", win_errstr(r.out.result));
235 static bool test_DsReplicaGetInfo(struct dcerpc_pipe *p, struct torture_context *tctx,
236 struct DsPrivate *priv)
239 struct drsuapi_DsReplicaGetInfo r;
240 union drsuapi_DsReplicaGetInfoRequest req;
249 DRSUAPI_DS_REPLICA_GET_INFO,
250 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS,
253 DRSUAPI_DS_REPLICA_GET_INFO,
254 DRSUAPI_DS_REPLICA_INFO_CURSORS,
257 DRSUAPI_DS_REPLICA_GET_INFO,
258 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA,
261 DRSUAPI_DS_REPLICA_GET_INFO,
262 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_CONNECT_FAILURES,
265 DRSUAPI_DS_REPLICA_GET_INFO,
266 DRSUAPI_DS_REPLICA_INFO_KCC_DSA_LINK_FAILURES,
269 DRSUAPI_DS_REPLICA_GET_INFO,
270 DRSUAPI_DS_REPLICA_INFO_PENDING_OPS,
273 DRSUAPI_DS_REPLICA_GET_INFO2,
274 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA,
277 DRSUAPI_DS_REPLICA_GET_INFO2,
278 DRSUAPI_DS_REPLICA_INFO_CURSORS2,
281 DRSUAPI_DS_REPLICA_GET_INFO2,
282 DRSUAPI_DS_REPLICA_INFO_CURSORS3,
285 DRSUAPI_DS_REPLICA_GET_INFO2,
286 DRSUAPI_DS_REPLICA_INFO_OBJ_METADATA2,
289 DRSUAPI_DS_REPLICA_GET_INFO2,
290 DRSUAPI_DS_REPLICA_INFO_ATTRIBUTE_VALUE_METADATA2,
293 DRSUAPI_DS_REPLICA_GET_INFO2,
294 DRSUAPI_DS_REPLICA_INFO_NEIGHBORS02,
297 DRSUAPI_DS_REPLICA_GET_INFO2,
298 DRSUAPI_DS_REPLICA_INFO_CONNECTIONS04,
301 DRSUAPI_DS_REPLICA_GET_INFO2,
302 DRSUAPI_DS_REPLICA_INFO_CURSORS05,
305 DRSUAPI_DS_REPLICA_GET_INFO2,
306 DRSUAPI_DS_REPLICA_INFO_06,
311 if (torture_setting_bool(tctx, "samba4", false)) {
312 printf("skipping DsReplicaGetInfo test against Samba4\n");
316 r.in.bind_handle = &priv->bind_handle;
318 for (i=0; i < ARRAY_SIZE(array); i++) {
319 const char *object_dn;
321 printf("testing DsReplicaGetInfo level %d infotype %d\n",
322 array[i].level, array[i].infotype);
324 object_dn = (array[i].obj_dn ? array[i].obj_dn : priv->domain_obj_dn);
326 r.in.level = array[i].level;
328 case DRSUAPI_DS_REPLICA_GET_INFO:
329 req.req1.info_type = array[i].infotype;
330 req.req1.object_dn = object_dn;
331 ZERO_STRUCT(req.req1.guid1);
333 case DRSUAPI_DS_REPLICA_GET_INFO2:
334 req.req2.info_type = array[i].infotype;
335 req.req2.object_dn = object_dn;
336 ZERO_STRUCT(req.req1.guid1);
337 req.req2.unknown1 = 0;
338 req.req2.string1 = NULL;
339 req.req2.string2 = NULL;
340 req.req2.unknown2 = 0;
345 status = dcerpc_drsuapi_DsReplicaGetInfo(p, tctx, &r);
346 if (!NT_STATUS_IS_OK(status)) {
347 const char *errstr = nt_errstr(status);
348 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
349 errstr = dcerpc_errstr(tctx, p->last_fault_code);
351 if (p->last_fault_code != DCERPC_FAULT_INVALID_TAG) {
352 printf("dcerpc_drsuapi_DsReplicaGetInfo failed - %s\n", errstr);
355 printf("DsReplicaGetInfo level %d and/or infotype %d not supported by server\n",
356 array[i].level, array[i].infotype);
358 } else if (!W_ERROR_IS_OK(r.out.result)) {
359 printf("DsReplicaGetInfo failed - %s\n", win_errstr(r.out.result));
367 static bool test_DsReplicaSync(struct dcerpc_pipe *p, struct torture_context *tctx,
368 struct DsPrivate *priv)
373 struct drsuapi_DsReplicaSync r;
374 struct drsuapi_DsReplicaObjectIdentifier nc;
375 struct GUID null_guid;
376 struct dom_sid null_sid;
385 if (!torture_setting_bool(tctx, "dangerous", false)) {
386 printf("DsReplicaSync disabled - enable dangerous tests to use\n");
390 if (torture_setting_bool(tctx, "samba4", false)) {
391 printf("skipping DsReplicaSync test against Samba4\n");
395 ZERO_STRUCT(null_guid);
396 ZERO_STRUCT(null_sid);
398 r.in.bind_handle = &priv->bind_handle;
400 for (i=0; i < ARRAY_SIZE(array); i++) {
401 printf("testing DsReplicaSync level %d\n",
404 r.in.level = array[i].level;
409 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
411 r.in.req.req1.naming_context = &nc;
412 r.in.req.req1.source_dsa_guid = priv->dcinfo.ntds_guid;
413 r.in.req.req1.other_info = NULL;
414 r.in.req.req1.options = 16;
418 status = dcerpc_drsuapi_DsReplicaSync(p, tctx, &r);
419 if (!NT_STATUS_IS_OK(status)) {
420 const char *errstr = nt_errstr(status);
421 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
422 errstr = dcerpc_errstr(tctx, p->last_fault_code);
424 printf("dcerpc_drsuapi_DsReplicaSync failed - %s\n", errstr);
426 } else if (!W_ERROR_IS_OK(r.out.result)) {
427 printf("DsReplicaSync failed - %s\n", win_errstr(r.out.result));
435 static bool test_DsReplicaUpdateRefs(struct dcerpc_pipe *p, struct torture_context *tctx,
436 struct DsPrivate *priv)
441 struct drsuapi_DsReplicaUpdateRefs r;
442 struct drsuapi_DsReplicaObjectIdentifier nc;
443 struct GUID null_guid;
444 struct dom_sid null_sid;
453 if (torture_setting_bool(tctx, "samba4", false)) {
454 printf("skipping DsReplicaUpdateRefs test against Samba4\n");
458 ZERO_STRUCT(null_guid);
459 ZERO_STRUCT(null_sid);
461 r.in.bind_handle = &priv->bind_handle;
463 for (i=0; i < ARRAY_SIZE(array); i++) {
464 printf("testing DsReplicaUpdateRefs level %d\n",
467 r.in.level = array[i].level;
472 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
474 r.in.req.req1.naming_context = &nc;
475 r.in.req.req1.dest_dsa_dns_name = talloc_asprintf(tctx, "__some_dest_dsa_guid_string._msdn.%s",
476 priv->domain_dns_name);
477 r.in.req.req1.dest_dsa_guid = null_guid;
478 r.in.req.req1.options = 0;
482 status = dcerpc_drsuapi_DsReplicaUpdateRefs(p, tctx, &r);
483 if (!NT_STATUS_IS_OK(status)) {
484 const char *errstr = nt_errstr(status);
485 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
486 errstr = dcerpc_errstr(tctx, p->last_fault_code);
488 printf("dcerpc_drsuapi_DsReplicaUpdateRefs failed - %s\n", errstr);
490 } else if (!W_ERROR_IS_OK(r.out.result)) {
491 printf("DsReplicaUpdateRefs failed - %s\n", win_errstr(r.out.result));
499 static bool test_DsGetNCChanges(struct dcerpc_pipe *p, struct torture_context *tctx,
500 struct DsPrivate *priv)
505 struct drsuapi_DsGetNCChanges r;
506 struct drsuapi_DsReplicaObjectIdentifier nc;
507 struct GUID null_guid;
508 struct dom_sid null_sid;
520 if (torture_setting_bool(tctx, "samba4", false)) {
521 printf("skipping DsGetNCChanges test against Samba4\n");
525 ZERO_STRUCT(null_guid);
526 ZERO_STRUCT(null_sid);
528 for (i=0; i < ARRAY_SIZE(array); i++) {
529 printf("testing DsGetNCChanges level %d\n",
532 r.in.bind_handle = &priv->bind_handle;
533 r.in.level = &array[i].level;
535 switch (*r.in.level) {
539 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
541 r.in.req.req5.destination_dsa_guid = GUID_random();
542 r.in.req.req5.source_dsa_invocation_id = null_guid;
543 r.in.req.req5.naming_context = &nc;
544 r.in.req.req5.highwatermark.tmp_highest_usn = 0;
545 r.in.req.req5.highwatermark.reserved_usn = 0;
546 r.in.req.req5.highwatermark.highest_usn = 0;
547 r.in.req.req5.uptodateness_vector = NULL;
548 r.in.req.req5.replica_flags = 0;
549 if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi","compression", false)) {
550 r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
552 r.in.req.req5.max_object_count = 0;
553 r.in.req.req5.max_ndr_size = 0;
554 r.in.req.req5.extended_op = DRSUAPI_EXOP_NONE;
555 r.in.req.req5.fsmo_info = 0;
561 nc.dn = priv->domain_obj_dn?priv->domain_obj_dn:"";
563 r.in.req.req8.destination_dsa_guid = GUID_random();
564 r.in.req.req8.source_dsa_invocation_id = null_guid;
565 r.in.req.req8.naming_context = &nc;
566 r.in.req.req8.highwatermark.tmp_highest_usn = 0;
567 r.in.req.req8.highwatermark.reserved_usn = 0;
568 r.in.req.req8.highwatermark.highest_usn = 0;
569 r.in.req.req8.uptodateness_vector = NULL;
570 r.in.req.req8.replica_flags = 0;
571 if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "compression", false)) {
572 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
574 if (lp_parm_bool(tctx->lp_ctx, NULL, "drsuapi", "neighbour_writeable", true)) {
575 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE;
577 r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
578 | DRSUAPI_DS_REPLICA_NEIGHBOUR_DO_SCHEDULED_SYNCS
579 | DRSUAPI_DS_REPLICA_NEIGHBOUR_RETURN_OBJECT_PARENTS
580 | DRSUAPI_DS_REPLICA_NEIGHBOUR_NEVER_SYNCED
582 r.in.req.req8.max_object_count = 402;
583 r.in.req.req8.max_ndr_size = 402116;
584 r.in.req.req8.extended_op = DRSUAPI_EXOP_NONE;
585 r.in.req.req8.fsmo_info = 0;
586 r.in.req.req8.partial_attribute_set = NULL;
587 r.in.req.req8.partial_attribute_set_ex = NULL;
588 r.in.req.req8.mapping_ctr.num_mappings = 0;
589 r.in.req.req8.mapping_ctr.mappings = NULL;
594 status = dcerpc_drsuapi_DsGetNCChanges(p, tctx, &r);
595 if (!NT_STATUS_IS_OK(status)) {
596 const char *errstr = nt_errstr(status);
597 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
598 errstr = dcerpc_errstr(tctx, p->last_fault_code);
600 printf("dcerpc_drsuapi_DsGetNCChanges failed - %s\n", errstr);
602 } else if (!W_ERROR_IS_OK(r.out.result)) {
603 printf("DsGetNCChanges failed - %s\n", win_errstr(r.out.result));
611 bool test_QuerySitesByCost(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
612 struct DsPrivate *priv)
615 struct drsuapi_QuerySitesByCost r;
616 union drsuapi_QuerySitesByCostRequest req;
619 const char *my_site = "Default-First-Site-Name";
620 const char *remote_site1 = "smbtorture-nonexisting-site1";
621 const char *remote_site2 = "smbtorture-nonexisting-site2";
623 req.req1.site_from = talloc_strdup(mem_ctx, my_site);
624 req.req1.num_req = 2;
625 req.req1.site_to = talloc_zero_array(mem_ctx, const char *, 2);
626 req.req1.site_to[0] = talloc_strdup(mem_ctx, remote_site1);
627 req.req1.site_to[1] = talloc_strdup(mem_ctx, remote_site2);
630 r.in.bind_handle = &priv->bind_handle;
634 status = dcerpc_drsuapi_QuerySitesByCost(p, mem_ctx, &r);
635 if (!NT_STATUS_IS_OK(status)) {
636 const char *errstr = nt_errstr(status);
637 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
638 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
640 printf("drsuapi_QuerySitesByCost - %s\n", errstr);
642 } else if (!W_ERROR_IS_OK(r.out.result)) {
643 printf("QuerySitesByCost failed - %s\n", win_errstr(r.out.result));
647 if (W_ERROR_IS_OK(r.out.result)) {
649 if (!W_ERROR_EQUAL(r.out.ctr->ctr1.info[0].error_code, WERR_DS_OBJ_NOT_FOUND) ||
650 !W_ERROR_EQUAL(r.out.ctr->ctr1.info[1].error_code, WERR_DS_OBJ_NOT_FOUND)) {
651 printf("expected error_code WERR_DS_OBJ_NOT_FOUND, got %s\n",
652 win_errstr(r.out.ctr->ctr1.info[0].error_code));
656 if ((r.out.ctr->ctr1.info[0].site_cost != (uint32_t) -1) ||
657 (r.out.ctr->ctr1.info[1].site_cost != (uint32_t) -1)) {
658 printf("expected site_cost %d, got %d\n",
659 (uint32_t) -1, r.out.ctr->ctr1.info[0].site_cost);
669 bool test_DsUnbind(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
670 struct DsPrivate *priv)
673 struct drsuapi_DsUnbind r;
676 r.in.bind_handle = &priv->bind_handle;
677 r.out.bind_handle = &priv->bind_handle;
679 printf("testing DsUnbind\n");
681 status = dcerpc_drsuapi_DsUnbind(p, mem_ctx, &r);
682 if (!NT_STATUS_IS_OK(status)) {
683 const char *errstr = nt_errstr(status);
684 if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
685 errstr = dcerpc_errstr(mem_ctx, p->last_fault_code);
687 printf("dcerpc_drsuapi_DsUnbind failed - %s\n", errstr);
689 } else if (!W_ERROR_IS_OK(r.out.result)) {
690 printf("DsBind failed - %s\n", win_errstr(r.out.result));
697 bool torture_rpc_drsuapi(struct torture_context *torture)
700 struct dcerpc_pipe *p;
702 struct DsPrivate priv;
703 struct cli_credentials *machine_credentials;
707 priv.join = torture_join_domain(torture, TEST_MACHINE_NAME, ACB_SVRTRUST,
708 &machine_credentials);
710 torture_fail(torture, "Failed to join as BDC");
713 status = torture_rpc_connection(torture,
716 if (!NT_STATUS_IS_OK(status)) {
717 torture_leave_domain(torture, priv.join);
718 torture_fail(torture, "Unable to connect to DRSUAPI pipe");
721 ret &= test_DsBind(p, torture, &priv);
723 ret &= test_QuerySitesByCost(p, torture, &priv);
725 ret &= test_DsGetDomainControllerInfo(p, torture, &priv);
727 ret &= test_DsCrackNames(torture, p, torture, &priv);
729 ret &= test_DsWriteAccountSpn(p, torture, &priv);
731 ret &= test_DsReplicaGetInfo(p, torture, &priv);
733 ret &= test_DsReplicaSync(p, torture, &priv);
735 ret &= test_DsReplicaUpdateRefs(p, torture, &priv);
737 ret &= test_DsGetNCChanges(p, torture, &priv);
739 ret &= test_DsUnbind(p, torture, &priv);
741 torture_leave_domain(torture, priv.join);
747 bool torture_rpc_drsuapi_cracknames(struct torture_context *torture)
750 struct dcerpc_pipe *p;
752 struct DsPrivate priv;
753 struct cli_credentials *machine_credentials;
755 torture_comment(torture, "Connected to DRSUAPI pipe\n");
759 priv.join = torture_join_domain(torture, TEST_MACHINE_NAME, ACB_SVRTRUST,
760 &machine_credentials);
762 torture_fail(torture, "Failed to join as BDC\n");
765 status = torture_rpc_connection(torture,
768 if (!NT_STATUS_IS_OK(status)) {
769 torture_leave_domain(torture, priv.join);
770 torture_fail(torture, "Unable to connect to DRSUAPI pipe");
773 ret &= test_DsBind(p, torture, &priv);
776 /* We don't care if this fails, we just need some info from it */
777 test_DsGetDomainControllerInfo(p, torture, &priv);
779 ret &= test_DsCrackNames(torture, p, torture, &priv);
781 ret &= test_DsUnbind(p, torture, &priv);
784 torture_leave_domain(torture, priv.join);