diff options
Diffstat (limited to 'source4/torture/basic/delaywrite.c')
-rw-r--r-- | source4/torture/basic/delaywrite.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/source4/torture/basic/delaywrite.c b/source4/torture/basic/delaywrite.c index 30cb5da070..8db37da536 100644 --- a/source4/torture/basic/delaywrite.c +++ b/source4/torture/basic/delaywrite.c @@ -31,10 +31,6 @@ #include "torture/util.h" #include "torture/basic/proto.h" -#define W2K8R2_TIMEDELAY_SECS 1 -#define W2K3_TIMEDELAY_SECS 2 -#define TIMEDELAY_SECS W2K3_TIMEDELAY_SECS - #define BASEDIR "\\delaywrite" static bool test_delayed_write_update(struct torture_context *tctx, struct smbcli_state *cli) @@ -96,17 +92,16 @@ static bool test_delayed_write_update(struct torture_context *tctx, struct smbcl nt_time_string(tctx, finfo2.basic_info.out.write_time)); if (finfo1.basic_info.out.write_time != finfo2.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { + if (diff < used_delay) { torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds" - "(1 sec == %.2f)(wrong!)\n", - diff, sec); + "(expected > %.2f) (wrong!)\n", + diff, used_delay / (double)1000000); ret = false; break; } - torture_comment(tctx, "Server updated write_time after %.2f seconds" - "(1 sec == %.2f)(correct)\n", - diff, sec); + torture_comment(tctx, "Server updated write_time after %.2f seconds (correct)\n", + diff); break; } fflush(stdout); @@ -1162,10 +1157,10 @@ static bool test_delayed_write_update2(struct torture_context *tctx, struct smbc nt_time_string(tctx, finfo2.basic_info.out.write_time)); if (finfo1.basic_info.out.write_time != finfo2.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { + if (diff < used_delay) { torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds" - "(1sec == %.2f) (wrong!)\n", - diff, sec); + "(expected > %.2f) (wrong!)\n", + diff, used_delay / (double)1000000); ret = false; break; } @@ -1543,10 +1538,10 @@ static bool test_delayed_write_update3(struct torture_context *tctx, if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { + if (diff < (used_delay)) { torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds " - "(1sec == %.2f) (wrong!)\n", - diff, sec); + "(write time update delay == %.2f) (wrong!)\n", + diff, used_delay / (double)1000000); ret = false; break; } @@ -1705,7 +1700,7 @@ static bool test_delayed_write_update3a(struct torture_context *tctx, if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { + if (diff < (used_delay)) { torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds " "(1sec == %.2f) (wrong!)\n", diff, sec); @@ -1916,17 +1911,17 @@ static bool test_delayed_write_update3b(struct torture_context *tctx, if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { - torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds " - "(1sec == %.2f) (wrong!)\n", - diff, sec); + if (diff < used_delay) { + torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds" + "(expected > %.2f) (wrong!)\n", + diff, used_delay / (double)1000000); ret = false; break; } torture_comment(tctx, "Server updated write_time after %.2f seconds " - "(1sec == %.2f) (correct)\n", - diff, sec); + "(write time update delay == %.2f) (correct)\n", + diff, used_delay / (double)1000000); break; } smb_msleep(0.5 * msec); @@ -2285,17 +2280,17 @@ static bool test_delayed_write_update4(struct torture_context *tctx, if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) { double diff = timeval_elapsed(&start); - if (diff < (TIMEDELAY_SECS * sec)) { - torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds " - "(1sec == %.2f) (wrong!)\n", - diff, sec); + if (diff < used_delay) { + torture_result(tctx, TORTURE_FAIL, "Server updated write_time after %.2f seconds" + "(expected > %.2f) (wrong!)\n", + diff, used_delay / (double)1000000); ret = false; break; } torture_comment(tctx, "Server updated write_time after %.2f seconds " - "(1sec == %.2f) (correct)\n", - diff, sec); + "(write time update delay == %.2f) (correct)\n", + diff, used_delay / (double)1000000); break; } smb_msleep(0.5 * msec); |