summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-05-28 22:14:39 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-05-28 22:30:10 +0300
commitc9c8de3dcb19c96ee9fab7f462b28f3a2f1997a1 (patch)
tree7d4817cad1e4304bf78b033d58ac25b5ec22ba14
parentc742f59bd24a3a35732489aa013187c35edde0a2 (diff)
downloadsamba-c9c8de3dcb19c96ee9fab7f462b28f3a2f1997a1.tar.gz
samba-c9c8de3dcb19c96ee9fab7f462b28f3a2f1997a1.tar.bz2
samba-c9c8de3dcb19c96ee9fab7f462b28f3a2f1997a1.zip
s4/test-libnet: Remove multiple test_samr_close() impelementations
We now have a nice common test_samr_close_handle() function to use
-rw-r--r--source4/torture/libnet/libnet_group.c29
-rw-r--r--source4/torture/libnet/libnet_user.c31
2 files changed, 15 insertions, 45 deletions
diff --git a/source4/torture/libnet/libnet_group.c b/source4/torture/libnet/libnet_group.c
index 10d1f1cf50..f26f988027 100644
--- a/source4/torture/libnet/libnet_group.c
+++ b/source4/torture/libnet/libnet_group.c
@@ -25,6 +25,7 @@
#include "librpc/gen_ndr/ndr_samr_c.h"
#include "librpc/gen_ndr/ndr_lsa_c.h"
#include "torture/rpc/torture_rpc.h"
+#include "torture/libnet/proto.h"
#include "param/param.h"
@@ -191,25 +192,6 @@ static bool test_opendomain(struct torture_context *tctx,
}
-static bool test_samr_close(struct torture_context *tctx,
- struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
- struct policy_handle *domain_handle)
-{
- struct samr_Close r;
-
- r.in.handle = domain_handle;
- r.out.handle = domain_handle;
-
- torture_assert_ntstatus_ok(tctx,
- dcerpc_samr_Close_r(b, mem_ctx, &r),
- "Close samr domain failed");
- torture_assert_ntstatus_ok(tctx, r.out.result,
- "Close samr domain failed");
-
- return true;
-}
-
-
static bool test_lsa_close(struct torture_context *tctx,
struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
struct policy_handle *domain_handle)
@@ -285,7 +267,8 @@ bool torture_groupinfo_api(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
@@ -341,7 +324,8 @@ bool torture_grouplist(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
@@ -389,7 +373,8 @@ bool torture_creategroup(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
diff --git a/source4/torture/libnet/libnet_user.c b/source4/torture/libnet/libnet_user.c
index 8fcf9818db..587676a767 100644
--- a/source4/torture/libnet/libnet_user.c
+++ b/source4/torture/libnet/libnet_user.c
@@ -157,25 +157,6 @@ static bool test_cleanup(struct torture_context *tctx,
}
-static bool test_samr_close(struct torture_context *tctx,
- struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
- struct policy_handle *domain_handle)
-{
- struct samr_Close r;
-
- r.in.handle = domain_handle;
- r.out.handle = domain_handle;
-
- torture_assert_ntstatus_ok(tctx,
- dcerpc_samr_Close_r(b, mem_ctx, &r),
- "Close samr domain failed");
- torture_assert_ntstatus_ok(tctx, r.out.result,
- "Close samr domain failed");
-
- return true;
-}
-
-
static bool test_lsa_close(struct torture_context *tctx,
struct dcerpc_binding_handle *b, TALLOC_CTX *mem_ctx,
struct policy_handle *domain_handle)
@@ -225,7 +206,8 @@ bool torture_createuser(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
@@ -563,7 +545,8 @@ cleanup:
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, torture, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, torture, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
@@ -633,7 +616,8 @@ bool torture_userinfo_api(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "domain close failed\n");
ret = false;
}
@@ -690,7 +674,8 @@ bool torture_userlist(struct torture_context *torture)
goto done;
}
- if (!test_samr_close(torture, ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
+ if (!test_samr_close_handle(torture,
+ ctx->samr.pipe->binding_handle, mem_ctx, &ctx->samr.handle)) {
torture_comment(torture, "samr domain close failed\n");
ret = false;
goto done;