summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-01-02 16:11:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:08:11 -0500
commitfa010c96766fb97e5c4f02f485a5ea774ac07d63 (patch)
tree8124d2b681685f549e27a872d51152871de60d30 /source4/torture/rpc
parent7b4c02bf05c9c9508ce15cf0843dad1a354a5547 (diff)
downloadsamba-fa010c96766fb97e5c4f02f485a5ea774ac07d63.tar.gz
samba-fa010c96766fb97e5c4f02f485a5ea774ac07d63.tar.bz2
samba-fa010c96766fb97e5c4f02f485a5ea774ac07d63.zip
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)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/dssetup.c24
1 files changed, 16 insertions, 8 deletions
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);