torture-samr: Do not issue a TORTURE_FAIL unless *this* test failed
authorAndrew Bartlett <abartlet@samba.org>
Sun, 16 Mar 2014 09:59:32 +0000 (22:59 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2014 15:12:46 +0000 (17:12 +0200)
Change-Id: I349d8ac77a98b934cd4b11b01a96a231097eeeed
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/samr.c

index c1c4dbdbb59d80c80b6c745dc38680a5ef65764d..45a74cbb58f80f962d597f992ace7c60564c4041 100644 (file)
@@ -4364,7 +4364,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
        /* run tests */
 
        for (i=0; i < ARRAY_SIZE(creds); i++) {
-
+               bool test_passed;
                /* skip trust tests for now */
                if (acct_flags & ACB_WSTRUST ||
                    acct_flags & ACB_SVRTRUST ||
@@ -4372,7 +4372,7 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
                        continue;
                }
 
-               ret &= test_Password_lockout(p, np, tctx, acct_flags, acct_name,
+               test_passed = test_Password_lockout(p, np, tctx, acct_flags, acct_name,
                                             domain_handle, user_handle, password,
                                             machine_credentials,
                                             creds[i].comment,
@@ -4380,8 +4380,10 @@ static bool test_Password_lockout_wrap(struct dcerpc_pipe *p,
                                             creds[i].interactive,
                                             creds[i].expected_success_status,
                                             &_info1, &_info12);
-               if (!ret) {
+               ret &= test_passed;
+               if (!test_passed) {
                        torture_result(tctx, TORTURE_FAIL, "TEST #%d (%s) failed\n", i, creds[i].comment);
+                       break;
                } else {
                        torture_comment(tctx, "TEST #%d (%s) succeeded\n", i, creds[i].comment);
                }