s4/test: make samr_close handle functio public
authorKamen Mazdrashki <kamenim@samba.org>
Fri, 28 May 2010 01:45:40 +0000 (04:45 +0300)
committerKamen Mazdrashki <kamenim@samba.org>
Fri, 28 May 2010 19:30:08 +0000 (22:30 +0300)
It is to be used further for closing opened handles when testing
using SAMR interface

source4/torture/libnet/utils.c
source4/torture/libnet/utils.h

index 564c601455e0993ffaeaf7af5ebe3b837f01d9b7..cbd6d045f4d643cdbbf4bff6ee00868b22f06098 100644 (file)
@@ -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)
 {
index 7a16d8f174cc91884c43cf639e6e5e64bf53eeda..04ea3e2febb7f1283e72b67a07163c0fe73f80d5 100644 (file)
@@ -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);