s4:torture:basic: use assert in the second loop in delayed_write_update1a
authorMichael Adam <obnox@samba.org>
Thu, 2 Oct 2014 11:46:29 +0000 (13:46 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 3 Oct 2014 06:34:05 +0000 (08:34 +0200)
We can hence replace the assert after the loop by a success torture_comment.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/torture/basic/delaywrite.c

index 16223f8b5c7abc1d429964ea1934fb6fb5652f5b..a15abe0657bedeed4e1daf6dc436a4883f14284d 100644 (file)
@@ -396,22 +396,21 @@ static bool test_delayed_write_update1a(struct torture_context *tctx, struct smb
 
                torture_comment(tctx, "write time %s\n",
                        nt_time_string(tctx, finfo3.all_info.out.write_time));
-               if (finfo2.all_info.out.write_time != finfo3.all_info.out.write_time) {
-                       double diff = timeval_elapsed(&start);
 
-                       torture_result(tctx, TORTURE_FAIL, "server updated write_time after %.2f seconds"
-                                       "(write time update delay == %.2f)(correct)\n",
-                                       diff, used_delay / (double)1000000);
-                       break;
-               }
+               torture_assert_u64_equal(tctx,
+                                        finfo3.all_info.out.write_time,
+                                        finfo2.all_info.out.write_time,
+                                        talloc_asprintf(tctx,
+                                               "Server updated write time "
+                                               "after %.2f seconds (wrong!)",
+                                               timeval_elapsed(&start)));
+
                fflush(stdout);
                smb_msleep(1 * msec);
        }
 
-       torture_assert_int_equal(tctx,
-                                finfo3.all_info.out.write_time,
-                                finfo2.all_info.out.write_time,
-                                "Server updated write time (wrong!)");
+       torture_comment(tctx, "Server did not update write time within 10 "
+                       "seconds. Good!\n");
 
        /* the close should trigger an write time update */
        smbcli_close(cli->tree, fnum1);