From fa010c96766fb97e5c4f02f485a5ea774ac07d63 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 2 Jan 2005 16:11:59 +0000 Subject: r4483: - rename same structs, enums and uninons of the dssetup pipe to match the style we are using in other pipes - first fillin local vars and only set the out parameter on success - for the server code only to the samdb lookup when it's needed NOTE: the DsRoleGetPrimaryDomainInformation() code with DS_ROLE_MEMBER_SERVER is not tested yet, does someone has a w2k3 member server to test with? metze (This used to be commit e6d1136497f501fe0687bfb34a155db6a9d87bde) --- source4/torture/rpc/dssetup.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source4/torture/rpc/dssetup.c') diff --git a/source4/torture/rpc/dssetup.c b/source4/torture/rpc/dssetup.c index 7e63243e8a..eb9dc83df6 100644 --- a/source4/torture/rpc/dssetup.c +++ b/source4/torture/rpc/dssetup.c @@ -24,22 +24,30 @@ #include "librpc/gen_ndr/ndr_dssetup.h" -static BOOL test_RolerGetPrimaryDomainInformation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +static BOOL test_DsRoleGetPrimaryDomainInformation(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) { - struct ds_RolerGetPrimaryDomainInformation r; + struct dssetup_DsRoleGetPrimaryDomainInformation r; NTSTATUS status; BOOL ret = True; int i; - printf("\ntesting RolerGetPrimaryDomainInformation\n"); + printf("\ntesting DsRoleGetPrimaryDomainInformation\n"); - for (i=DS_BASIC_INFORMATION;i<=DS_ROLE_OP_STATUS;i++) { + for (i=DS_ROLE_BASIC_INFORMATION; i <= DS_ROLE_OP_STATUS; i++) { r.in.level = i; - status = dcerpc_ds_RolerGetPrimaryDomainInformation(p, mem_ctx, &r); + status = dcerpc_dssetup_DsRoleGetPrimaryDomainInformation(p, mem_ctx, &r); if (!NT_STATUS_IS_OK(status)) { - printf("RolerGetPrimaryDomainInformation level %d failed - %s\n", - i, nt_errstr(status)); + const char *errstr = nt_errstr(status); + if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) { + errstr = dcerpc_errstr(mem_ctx, p->last_fault_code); + } + printf("dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level %d failed - %s\n", + i, errstr); + ret = False; + } else if (!W_ERROR_IS_OK(r.out.result)) { + printf("DsRoleGetPrimaryDomainInformation level %d failed - %s\n", + i, win_errstr(r.out.result)); ret = False; } } @@ -64,7 +72,7 @@ BOOL torture_rpc_dssetup(void) return False; } - ret &= test_RolerGetPrimaryDomainInformation(p, mem_ctx); + ret &= test_DsRoleGetPrimaryDomainInformation(p, mem_ctx); talloc_destroy(mem_ctx); -- cgit