1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

torture: Only error if the write time was updated is less than the expected delay

The previous test was far, far too tight, it was in seconds 1/4 of the
fraction of the normal delay we had configured Samba to use so (1/4) *
(500 000 / 2000 000) = 1/16 (sec).  This margin appears to just be too
tight for our loaded test server.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andrew Bartlett 2014-06-20 22:28:49 +12:00 committed by Jeremy Allison
parent 24a73bb526
commit f407f58fd3

View File

@ -212,11 +212,11 @@ static bool test_delayed_write_update1(struct torture_context *tctx, struct smbc
nt_time_string(tctx, finfo2.all_info.out.write_time));
if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
double diff = timeval_elapsed(&start);
if (diff > (0.25 * sec)) {
if (diff > (0.25 * (used_delay / (double)1000000))) {
torture_result(tctx, TORTURE_FAIL, "After SMBwrite truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(wrong!)\n",
diff, sec);
"(write time update dealy == %.2f)(wrong!)\n",
diff, used_delay / (double)1000000);
ret = false;
break;
}
@ -224,7 +224,7 @@ static bool test_delayed_write_update1(struct torture_context *tctx, struct smbc
torture_comment(tctx, "After SMBwrite truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(correct)\n",
diff, sec);
diff, used_delay / (double)1000000);
break;
}
fflush(stdout);
@ -397,19 +397,19 @@ static bool test_delayed_write_update1a(struct torture_context *tctx, struct smb
nt_time_string(tctx, finfo2.all_info.out.write_time));
if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
double diff = timeval_elapsed(&start);
if (diff > (0.25 * sec)) {
if (diff > (0.25 * (used_delay / (double)1000000))) {
torture_result(tctx, TORTURE_FAIL, "After SMBwrite truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(wrong!)\n",
diff, sec);
"(write time update delay == %.2f)(wrong!)\n",
diff, used_delay / (double)1000000);
ret = false;
break;
}
torture_comment(tctx, "After SMBwrite truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(correct)\n",
diff, sec);
"(write time update delay == %.2f)(correct)\n",
diff, used_delay / (double)1000000);
break;
}
fflush(stdout);
@ -572,20 +572,20 @@ static bool test_delayed_write_update1b(struct torture_context *tctx, struct smb
nt_time_string(tctx, finfo2.all_info.out.write_time));
if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
double diff = timeval_elapsed(&start);
if (diff > (0.25 * sec)) {
if (diff > (0.25 * (used_delay / (double)1000000))) {
torture_result(tctx, TORTURE_FAIL,
"After SET_END_OF_FILE truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(wrong!)",
diff, sec);
"(write time update delay == %.2f)(wrong!)",
diff, used_delay / (double)1000000);
ret = false;
break;
}
torture_comment(tctx, "After SET_END_OF_FILE truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(correct)\n",
diff, sec);
"(write time update delay == %.2f)(correct)\n",
diff, used_delay / (double)1000000);
break;
}
fflush(stdout);
@ -751,19 +751,19 @@ static bool test_delayed_write_update1c(struct torture_context *tctx, struct smb
nt_time_string(tctx, finfo2.all_info.out.write_time));
if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
double diff = timeval_elapsed(&start);
if (diff > (0.25 * sec)) {
if (diff > (0.25 * (used_delay / (double)1000000))) {
torture_result(tctx, TORTURE_FAIL, "After SET_ALLOCATION_INFO truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(wrong!)\n",
diff, sec);
"(write time update delay == %.2f)(wrong!)\n",
diff, used_delay / (double)1000000);
ret = false;
break;
}
torture_comment(tctx, "After SET_ALLOCATION_INFO truncate "
"server updated write_time after %.2f seconds"
"(1 sec == %.2f)(correct)\n",
diff, sec);
"(write time update delay == %.2f)(correct)\n",
diff, used_delay / (double)1000000);
break;
}
fflush(stdout);