torture-samr: Improve rpc.samr.passwords.badpwdcount test
authorAndrew Bartlett <abartlet@samba.org>
Mon, 9 Dec 2013 01:25:06 +0000 (14:25 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 2 Apr 2014 15:12:48 +0000 (17:12 +0200)
Change-Id: I89ac30d715e89f14aca049e0e5c5043a39ab93c7
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/torture/rpc/samr.c

index 45a74cbb58f80f962d597f992ace7c60564c4041..551cd4539fd335a1e217db7264fa88d1192fa182 100644 (file)
@@ -3903,7 +3903,9 @@ static bool test_Password_badpwdcount(struct dcerpc_pipe *p,
                        if (!test_SamLogon_with_creds(tctx, np, machine_credentials,
                                                      acct_name, passwords[i],
                                                      expected_success_status, interactive)) {
-                               torture_fail(tctx, talloc_asprintf(tctx, "succeeded to authenticate with old password (#%d of #%d in history)", i, password_history_length));
+                               torture_fail(tctx, talloc_asprintf(tctx, "did not successfully to obtain %s for %s login with old password (#%d of #%d in history)",
+                                                                  nt_errstr(expected_success_status),
+                                                                  interactive ? "interactive" : "network", i, password_history_length));
                        }
 
                        torture_assert(tctx,
@@ -4030,16 +4032,16 @@ static bool test_Password_badpwdcount_wrap(struct dcerpc_pipe *p,
                        continue;
                }
 
-               ret &= test_Password_badpwdcount(p, np, tctx, acct_flags, acct_name,
-                                                domain_handle, user_handle, password,
-                                                machine_credentials,
-                                                creds[i].comment,
-                                                creds[i].disabled,
-                                                creds[i].interactive,
-                                                creds[i].expected_success_status,
-                                                &_info1, &_info12);
-               if (!ret) {
+               if (!test_Password_badpwdcount(p, np, tctx, acct_flags, acct_name,
+                                              domain_handle, user_handle, password,
+                                              machine_credentials,
+                                              creds[i].comment,
+                                              creds[i].disabled,
+                                              creds[i].interactive,
+                                              creds[i].expected_success_status,
+                                              &_info1, &_info12)) {
                        torture_result(tctx, TORTURE_FAIL, "TEST #%d (%s) failed\n", i, creds[i].comment);
+                       ret = false;
                } else {
                        torture_comment(tctx, "TEST #%d (%s) succeeded\n", i, creds[i].comment);
                }