diff options
author | Rafal Szczesniak <mimir@samba.org> | 2006-05-15 21:50:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:07:24 -0500 |
commit | e7b1b2e79d01a213238222786d59c5259cfe17aa (patch) | |
tree | 386b6ed1e499f82ba3b1670cbed6b491408c0a8f /source4/torture/libnet/libnet_rpc.c | |
parent | 16b5eac38df91b2377cbffe3009cc956fcb8a78a (diff) | |
download | samba-e7b1b2e79d01a213238222786d59c5259cfe17aa.tar.gz samba-e7b1b2e79d01a213238222786d59c5259cfe17aa.tar.bz2 samba-e7b1b2e79d01a213238222786d59c5259cfe17aa.zip |
r15626: Modify the tests to fit them in current changes in libnet
functions.
rafal
(This used to be commit 849e3eee9476100d629be318610369662a114dd0)
Diffstat (limited to 'source4/torture/libnet/libnet_rpc.c')
-rw-r--r-- | source4/torture/libnet/libnet_rpc.c | 46 |
1 files changed, 41 insertions, 5 deletions
diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c index b7d94813a6..39023886ad 100644 --- a/source4/torture/libnet/libnet_rpc.c +++ b/source4/torture/libnet/libnet_rpc.c @@ -101,6 +101,36 @@ static BOOL test_samr_connect(struct libnet_context *ctx) return True; } + +static BOOL test_samr_dcinfo_connect(struct libnet_context *ctx) +{ + NTSTATUS status; + struct libnet_RpcConnect connect; + connect.level = LIBNET_RPC_CONNECT_DC_INFO; + connect.in.binding = lp_parm_string(-1, "torture", "binding"); + connect.in.dcerpc_iface = &dcerpc_table_samr; + + status = libnet_RpcConnect(ctx, ctx, &connect); + + if (!NT_STATUS_IS_OK(status)) { + printf("Couldn't connect to rpc service %s on %s: %s\n", + connect.in.dcerpc_iface->name, connect.in.binding, + nt_errstr(status)); + + return False; + } + + printf("Domain Controller Info:\n"); + printf("\tDomain Name:\t %s\n", connect.out.domain_name); + printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect.out.domain_sid)); + printf("\tRealm:\t\t %s\n", connect.out.realm); + printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect.out.guid)); + + return True; +} + + + BOOL torture_rpc_connect(struct torture_context *torture) { struct libnet_context *ctx; @@ -108,21 +138,27 @@ BOOL torture_rpc_connect(struct torture_context *torture) ctx = libnet_context_init(NULL); ctx->cred = cmdline_credentials; - printf("Testing connection to lsarpc interface\n"); + printf("Testing connection to LSA interface\n"); if (!test_lsa_connect(ctx)) { - printf("failed to connect lsarpc interface\n"); + printf("failed to connect LSA interface\n"); return False; } - printf("Testing connection with domain info to lsarpc interface\n"); + printf("Testing connection with domain info to LSA interface\n"); if (!test_lsa_dcinfo_connect(ctx)) { - printf("failed to connect lsarpc interface\n"); + printf("failed to connect LSA interface\n"); return False; } printf("Testing connection to SAMR service\n"); if (!test_samr_connect(ctx)) { - printf("failed to connect samr interface\n"); + printf("failed to connect SAMR interface\n"); + return False; + } + + printf("Testing connection with domain info to SAMR interface\n"); + if (!test_samr_dcinfo_connect(ctx)) { + printf("failed to connect SAMR interface\n"); return False; } |