summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-10-27 14:12:35 +0200
committerJeremy Allison <jra@samba.org>2016-11-15 01:14:21 +0100
commitb53b3b8e327c5f7983be8f2e403aa252145487a4 (patch)
tree6cb2e18737513817c9d5294e2d1af3d3358c9f73 /source4/torture/rpc
parent8f4e426f33fbbca0c363592c315fcb4ffd79fd67 (diff)
downloadsamba-b53b3b8e327c5f7983be8f2e403aa252145487a4.tar.gz
s4-torture: add torture_rpc_connection_with_binding()
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/rpc.c21
-rw-r--r--source4/torture/rpc/torture_rpc.h4
2 files changed, 21 insertions, 4 deletions
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index e0ed70ccbc9..3fc20c0190c 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -75,16 +75,29 @@ _PUBLIC_ NTSTATUS torture_rpc_connection(struct torture_context *tctx,
NTSTATUS status;
struct dcerpc_binding *binding;
- dcerpc_init();
-
status = torture_rpc_binding(tctx, &binding);
if (NT_STATUS_IS_ERR(status))
return status;
- status = dcerpc_pipe_connect_b(tctx,
+ return torture_rpc_connection_with_binding(tctx, binding, p, table);
+}
+
+/**
+ * open a rpc connection to the chosen binding string
+ */
+_PUBLIC_ NTSTATUS torture_rpc_connection_with_binding(struct torture_context *tctx,
+ struct dcerpc_binding *binding,
+ struct dcerpc_pipe **p,
+ const struct ndr_interface_table *table)
+{
+ NTSTATUS status;
+
+ dcerpc_init();
+
+ status = dcerpc_pipe_connect_b(tctx,
p, binding, table,
cmdline_credentials, tctx->ev, tctx->lp_ctx);
-
+
if (NT_STATUS_IS_ERR(status)) {
torture_warning(tctx, "Failed to connect to remote server: %s %s\n",
dcerpc_binding_string(tctx, binding), nt_errstr(status));
diff --git a/source4/torture/rpc/torture_rpc.h b/source4/torture/rpc/torture_rpc.h
index 2f65baa64f7..77df5de341d 100644
--- a/source4/torture/rpc/torture_rpc.h
+++ b/source4/torture/rpc/torture_rpc.h
@@ -45,6 +45,10 @@ struct torture_rpc_tcase_data {
NTSTATUS torture_rpc_connection(struct torture_context *tctx,
struct dcerpc_pipe **p,
const struct ndr_interface_table *table);
+NTSTATUS torture_rpc_connection_with_binding(struct torture_context *tctx,
+ struct dcerpc_binding *binding,
+ struct dcerpc_pipe **p,
+ const struct ndr_interface_table *table);
struct test_join *torture_join_domain(struct torture_context *tctx,
const char *machine_name,