s4-torture: move samr_ValidatePassword test out of main samr test.
authorGünther Deschner <gd@samba.org>
Tue, 11 Dec 2012 08:25:53 +0000 (09:25 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Dec 2012 10:29:33 +0000 (11:29 +0100)
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>
source4/torture/rpc/rpc.c
source4/torture/rpc/samr.c

index 7efc90b33cee931b765737509252586c11165f45..ad1e5492d8809e009ae7643c8b7b99cf753802fa 100644 (file)
@@ -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));
index f17f0d746c9678519fdfb50491c9c76477e95abe..6a4f653f2c031a1acfe1e41df21a36d9fa396920 100644 (file)
@@ -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;
+}