[PATCH 1/2] s4-torture: Relax time checking in CHECK_NTTIME.

Andreas Schneider asn at samba.org
Tue Nov 12 06:09:55 MST 2013


NTTIME has a nanosecond resolution. We should be tolerate if the system
is busy writing and reading the value. To reproduce this problem just
run the test under valgrind.

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 source4/torture/raw/open.c    | 2 +-
 source4/torture/smb2/create.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 0968cfe..0ec28c3 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -112,7 +112,7 @@ static const char *rdwr_string(enum rdwr_mode m)
 	status = smb_raw_pathinfo(cli->tree, tctx, &finfo); \
 	CHECK_STATUS(status, NT_STATUS_OK); \
 	t2 = finfo.all_info.out.field; \
-	if (t != t2) { \
+	if (abs(t-t2) > 20000) { \
 		torture_result(tctx, TORTURE_FAIL, \
 		       "(%s) wrong time for field %s  %s - %s\n", \
 		       __location__, #field, \
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index fcf40e1..f5b40b6 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -81,7 +81,7 @@
 	status = smb2_getinfo_file(tree, tctx, &finfo); \
 	CHECK_STATUS(status, NT_STATUS_OK); \
 	t2 = finfo.all_info.out.field; \
-	if (t != t2) { \
+	if (abs(t-t2) > 20000) { \
 		torture_result(tctx, TORTURE_FAIL, \
 			"(%s) wrong time for field %s  %s - %s\n", \
 		       __location__, #field, \
-- 
1.8.4




More information about the samba-technical mailing list