summaryrefslogtreecommitdiff
path: root/source4/torture/libnet/libnet_rpc.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-23 15:31:27 +0100
committerGünther Deschner <gd@samba.org>2010-03-23 16:13:54 +0100
commit97a974e5b7b4645544b10ff48459125c5580580d (patch)
tree0ea5bbd6169fabd40f1794796bef4b4fd2585192 /source4/torture/libnet/libnet_rpc.c
parentf5eb8eb97fb494501359e0c5ee368f2bb64ad717 (diff)
downloadsamba-97a974e5b7b4645544b10ff48459125c5580580d.tar.gz
samba-97a974e5b7b4645544b10ff48459125c5580580d.tar.bz2
samba-97a974e5b7b4645544b10ff48459125c5580580d.zip
s4-smbtorture: use torture_context for debugging output everywhere in libnet torture tests.
Mimir, please check. Guenther
Diffstat (limited to 'source4/torture/libnet/libnet_rpc.c')
-rw-r--r--source4/torture/libnet/libnet_rpc.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/source4/torture/libnet/libnet_rpc.c b/source4/torture/libnet/libnet_rpc.c
index d30053d79c..d4a87a8f26 100644
--- a/source4/torture/libnet/libnet_rpc.c
+++ b/source4/torture/libnet/libnet_rpc.c
@@ -29,7 +29,8 @@
#include "param/param.h"
-static bool test_connect_service(struct libnet_context *ctx,
+static bool test_connect_service(struct torture_context *tctx,
+ struct libnet_context *ctx,
const struct ndr_interface_table *iface,
const char *binding_string,
const char *hostname,
@@ -55,7 +56,7 @@ static bool test_connect_service(struct libnet_context *ctx,
status = libnet_RpcConnect(ctx, ctx, &connect_r);
if (!NT_STATUS_EQUAL(status, expected_status)) {
- d_printf("Connecting to rpc service %s on %s.\n\tFAILED. Expected: %s."
+ torture_comment(tctx, "Connecting to rpc service %s on %s.\n\tFAILED. Expected: %s."
"Received: %s\n",
connect_r.in.dcerpc_iface->name, connect_r.in.binding, nt_errstr(expected_status),
nt_errstr(status));
@@ -63,18 +64,18 @@ static bool test_connect_service(struct libnet_context *ctx,
return false;
}
- d_printf("PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status),
+ torture_comment(tctx, "PASSED. Expected: %s, received: %s\n", nt_errstr(expected_status),
nt_errstr(status));
if (connect_r.level == LIBNET_RPC_CONNECT_DC_INFO && NT_STATUS_IS_OK(status)) {
- d_printf("Domain Controller Info:\n");
- d_printf("\tDomain Name:\t %s\n", connect_r.out.domain_name);
- d_printf("\tDomain SID:\t %s\n", dom_sid_string(ctx, connect_r.out.domain_sid));
- d_printf("\tRealm:\t\t %s\n", connect_r.out.realm);
- d_printf("\tGUID:\t\t %s\n", GUID_string(ctx, connect_r.out.guid));
+ torture_comment(tctx, "Domain Controller Info:\n");
+ torture_comment(tctx, "\tDomain Name:\t %s\n", connect_r.out.domain_name);
+ torture_comment(tctx, "\tDomain SID:\t %s\n", dom_sid_string(ctx, connect_r.out.domain_sid));
+ torture_comment(tctx, "\tRealm:\t\t %s\n", connect_r.out.realm);
+ torture_comment(tctx, "\tGUID:\t\t %s\n", GUID_string(ctx, connect_r.out.guid));
} else if (!NT_STATUS_IS_OK(status)) {
- d_printf("Error string: %s\n", connect_r.out.error_string);
+ torture_comment(tctx, "Error string: %s\n", connect_r.out.error_string);
}
return true;
@@ -90,38 +91,39 @@ static bool torture_rpc_connect(struct torture_context *torture,
ctx = libnet_context_init(torture->ev, torture->lp_ctx);
ctx->cred = cmdline_credentials;
- d_printf("Testing connection to LSA interface\n");
- if (!test_connect_service(ctx, &ndr_table_lsarpc, bindstr,
+ torture_comment(torture, "Testing connection to LSA interface\n");
+
+ if (!test_connect_service(torture, ctx, &ndr_table_lsarpc, bindstr,
hostname, level, false, NT_STATUS_OK)) {
- d_printf("failed to connect LSA interface\n");
+ torture_comment(torture, "failed to connect LSA interface\n");
return false;
}
- d_printf("Testing connection to SAMR interface\n");
- if (!test_connect_service(ctx, &ndr_table_samr, bindstr,
+ torture_comment(torture, "Testing connection to SAMR interface\n");
+ if (!test_connect_service(torture, ctx, &ndr_table_samr, bindstr,
hostname, level, false, NT_STATUS_OK)) {
- d_printf("failed to connect SAMR interface\n");
+ torture_comment(torture, "failed to connect SAMR interface\n");
return false;
}
- d_printf("Testing connection to SRVSVC interface\n");
- if (!test_connect_service(ctx, &ndr_table_srvsvc, bindstr,
+ torture_comment(torture, "Testing connection to SRVSVC interface\n");
+ if (!test_connect_service(torture, ctx, &ndr_table_srvsvc, bindstr,
hostname, level, false, NT_STATUS_OK)) {
- d_printf("failed to connect SRVSVC interface\n");
+ torture_comment(torture, "failed to connect SRVSVC interface\n");
return false;
}
- d_printf("Testing connection to LSA interface with wrong credentials\n");
- if (!test_connect_service(ctx, &ndr_table_lsarpc, bindstr,
+ torture_comment(torture, "Testing connection to LSA interface with wrong credentials\n");
+ if (!test_connect_service(torture, ctx, &ndr_table_lsarpc, bindstr,
hostname, level, true, NT_STATUS_LOGON_FAILURE)) {
- d_printf("failed to test wrong credentials on LSA interface\n");
+ torture_comment(torture, "failed to test wrong credentials on LSA interface\n");
return false;
}
- d_printf("Testing connection to SAMR interface with wrong credentials\n");
- if (!test_connect_service(ctx, &ndr_table_samr, bindstr,
+ torture_comment(torture, "Testing connection to SAMR interface with wrong credentials\n");
+ if (!test_connect_service(torture, ctx, &ndr_table_samr, bindstr,
hostname, level, true, NT_STATUS_LOGON_FAILURE)) {
- d_printf("failed to test wrong credentials on SAMR interface\n");
+ torture_comment(torture, "failed to test wrong credentials on SAMR interface\n");
return false;
}