From 4cf8f105005b1f9839be3d9de6d41b5f90bdb158 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 12 Nov 2013 14:09:55 +0100 Subject: [PATCH] s4-torture: Relax time checking in CHECK_NTTIME. 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 Reviewed-by: David Disseldorp --- 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 0968cfec5bcf..0ec28c3650c9 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 fcf40e17d6fa..f5b40b6717a7 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, \ -- 2.34.1