From f22efd402adf61842dd0a97e462a097e80d878a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Tue, 11 Dec 2012 09:25:53 +0100 Subject: [PATCH] s4-torture: move samr_ValidatePassword test out of main samr test. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Makes it easier to call with ncacn_ip_tcp transport (Windows does not allow other transports). Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher --- source4/torture/rpc/rpc.c | 1 + source4/torture/rpc/samr.c | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c index 7efc90b33ce..ad1e5492d88 100644 --- a/source4/torture/rpc/rpc.c +++ b/source4/torture/rpc/rpc.c @@ -503,6 +503,7 @@ NTSTATUS torture_rpc_init(void) torture_suite_add_suite(suite, torture_rpc_samr_passwords_pwdlastset(suite)); torture_suite_add_suite(suite, torture_rpc_samr_passwords_badpwdcount(suite)); torture_suite_add_suite(suite, torture_rpc_samr_passwords_lockout(suite)); + torture_suite_add_suite(suite, torture_rpc_samr_passwords_validate(suite)); torture_suite_add_suite(suite, torture_rpc_samr_user_privileges(suite)); torture_suite_add_suite(suite, torture_rpc_samr_large_dc(suite)); torture_suite_add_suite(suite, torture_rpc_samr_priv(suite)); diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index f17f0d746c9..6a4f653f2c0 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -8047,8 +8047,8 @@ static bool test_Connect(struct dcerpc_binding_handle *b, } -static bool test_samr_ValidatePassword(struct dcerpc_pipe *p, - struct torture_context *tctx) +static bool test_samr_ValidatePassword(struct torture_context *tctx, + struct dcerpc_pipe *p) { struct samr_ValidatePassword r; union samr_ValidatePasswordReq req; @@ -8060,6 +8060,10 @@ static bool test_samr_ValidatePassword(struct dcerpc_pipe *p, torture_comment(tctx, "Testing samr_ValidatePassword\n"); + if (p->conn->transport.transport != NCACN_IP_TCP) { + torture_comment(tctx, "samr_ValidatePassword only should succeed over NCACN_IP_TCP!\n"); + } + ZERO_STRUCT(r); r.in.level = NetValidatePasswordReset; r.in.req = &req; @@ -8183,8 +8187,6 @@ bool torture_rpc_samr_passwords(struct torture_context *torture) ret &= test_samr_handle_Close(b, torture, &ctx->handle); - ret &= test_samr_ValidatePassword(p, torture); - return ret; } @@ -8479,4 +8481,15 @@ struct torture_suite *torture_rpc_samr_passwords_lockout(TALLOC_CTX *mem_ctx) return suite; } +struct torture_suite *torture_rpc_samr_passwords_validate(TALLOC_CTX *mem_ctx) +{ + struct torture_suite *suite = torture_suite_create(mem_ctx, "samr.passwords.validate"); + struct torture_rpc_tcase *tcase; + + tcase = torture_suite_add_rpc_iface_tcase(suite, "samr", + &ndr_table_samr); + torture_rpc_tcase_add_test(tcase, "validate", + test_samr_ValidatePassword); + return suite; +} -- 2.11.4.GIT