s4-torture: Relax time checking in CHECK_NTTIME.
authorAndreas Schneider <asn@samba.org>
Tue, 12 Nov 2013 13:09:55 +0000 (14:09 +0100)
committerDavid Disseldorp <ddiss@samba.org>
Tue, 12 Nov 2013 16:33:12 +0000 (17:33 +0100)
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@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source4/torture/raw/open.c
source4/torture/smb2/create.c

index 0968cfec5bcfc1e1b751e704c129dc038ee96e81..0ec28c3650c95e90adfddc70ea77fe87d3fe8bcc 100644 (file)
@@ -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, \
index fcf40e17d6fa0cd3a0af3de9e19bbafd52f110b0..f5b40b6717a726531687e28ee05ecac917070931 100644 (file)
@@ -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, \