summaryrefslogtreecommitdiff
path: root/source4/torture/libnet
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-05-28 04:45:40 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-05-28 22:30:08 +0300
commit3a899e24d513de7c56363e39efb74b2c88c29854 (patch)
treece811719319a0ae5dc67d663809ba4a8c95f19b8 /source4/torture/libnet
parentcf794355456b82927cecfd183e49b47be6568385 (diff)
downloadsamba-3a899e24d513de7c56363e39efb74b2c88c29854.tar.gz
s4/test: make samr_close handle functio public
It is to be used further for closing opened handles when testing using SAMR interface
Diffstat (limited to 'source4/torture/libnet')
-rw-r--r--source4/torture/libnet/utils.c22
-rw-r--r--source4/torture/libnet/utils.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/source4/torture/libnet/utils.c b/source4/torture/libnet/utils.c
index 564c601455e..cbd6d045f4d 100644
--- a/source4/torture/libnet/utils.c
+++ b/source4/torture/libnet/utils.c
@@ -295,6 +295,28 @@ bool test_group_create(struct torture_context *tctx,
return true;
}
+/**
+ * Closes SAMR handle obtained from Connect, Open User/Domain, etc
+ */
+bool test_samr_close_handle(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *samr_handle)
+{
+ struct samr_Close r;
+
+ r.in.handle = samr_handle;
+ r.out.handle = samr_handle;
+
+ torture_assert_ntstatus_ok(tctx,
+ dcerpc_samr_Close_r(b, mem_ctx, &r),
+ "Close SAMR handle RPC call failed");
+ torture_assert_ntstatus_ok(tctx, r.out.result,
+ "Close SAMR handle failed");
+
+ return true;
+}
+
void msg_handler(struct monitor_msg *m)
{
diff --git a/source4/torture/libnet/utils.h b/source4/torture/libnet/utils.h
index 7a16d8f174c..04ea3e2febb 100644
--- a/source4/torture/libnet/utils.h
+++ b/source4/torture/libnet/utils.h
@@ -49,4 +49,8 @@ bool test_group_cleanup(struct torture_context *tctx,
struct policy_handle *domain_handle,
const char *name);
+bool test_samr_close_handle(struct torture_context *tctx,
+ struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
+ struct policy_handle *samr_handle);
+
void msg_handler(struct monitor_msg *m);