summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2012-12-11 09:25:53 +0100
committerStefan Metzmacher <metze@samba.org>2012-12-12 11:29:33 +0100
commitf22efd402adf61842dd0a97e462a097e80d878a4 (patch)
treeef3d3147f1f56d6359195456426c5c380601d930
parent014512f56478152972c7cae75e872a48ea18c91d (diff)
downloadsamba-f22efd402adf61842dd0a97e462a097e80d878a4.tar.gz
samba-f22efd402adf61842dd0a97e462a097e80d878a4.tar.bz2
samba-f22efd402adf61842dd0a97e462a097e80d878a4.zip
s4-torture: move samr_ValidatePassword test out of main samr test.
Makes it easier to call with ncacn_ip_tcp transport (Windows does not allow other transports). Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/torture/rpc/rpc.c1
-rw-r--r--source4/torture/rpc/samr.c21
2 files changed, 18 insertions, 4 deletions
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index 7efc90b33c..ad1e5492d8 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 f17f0d746c..6a4f653f2c 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;
+}