1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-25 06:04:04 +03:00

s4/test-libnet: Remove multiple test_samr_close() impelementations

We now have a nice common test_samr_close_handle() function to use
This commit is contained in:
Kamen Mazdrashki 2010-05-28 22:14:39 +03:00
parent c742f59bd2
commit c9c8de3dcb
2 changed files with 15 additions and 45 deletions

View File

@ -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;
}

View File

@ -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;