Allow systems with timestamp granularity of 1sec to work with
authorJeremy Allison <jra@samba.org>
Tue, 25 Aug 2009 01:21:23 +0000 (18:21 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 25 Aug 2009 01:21:23 +0000 (18:21 -0700)
this test.
Jeremy.

source4/torture/basic/delaywrite.c

index 698638d03e103961b7171fcb2386f196036e909a..eb553ed0af96a800bcb5fb91a348fcdd17266396 100644 (file)
@@ -240,6 +240,9 @@ static bool test_delayed_write_update1(struct torture_context *tctx, struct smbc
                ret = false;
        }
 
+       fflush(stdout);
+       msleep(2 * msec);
+
        /* Do a non-zero length SMBwrite and make sure it doesn't update the write time. */
        written = smbcli_smbwrite(cli->tree, fnum1, "x", 0, 1);
 
@@ -421,6 +424,9 @@ static bool test_delayed_write_update1a(struct torture_context *tctx, struct smb
                ret = false;
        }
 
+       fflush(stdout);
+       msleep(2 * msec);
+
        /* Do a non-zero length SMBwrite and make sure it doesn't update the write time. */
        written = smbcli_smbwrite(cli->tree, fnum1, "x", 0, 1);
 
@@ -596,6 +602,9 @@ static bool test_delayed_write_update1b(struct torture_context *tctx, struct smb
                ret = false;
        }
 
+       fflush(stdout);
+       msleep(2 * msec);
+
        /* Do a non-zero length SMBwrite and make sure it doesn't update the write time. */
        written = smbcli_smbwrite(cli->tree, fnum1, "x", 0, 1);
 
@@ -773,6 +782,9 @@ static bool test_delayed_write_update1c(struct torture_context *tctx, struct smb
                ret = false;
        }
 
+       fflush(stdout);
+       msleep(2 * msec);
+
        /* Do a non-zero length SMBwrite and make sure it doesn't update the write time. */
        written = smbcli_smbwrite(cli->tree, fnum1, "x", 0, 1);
        torture_assert_int_equal(tctx, written, 1, 
@@ -999,6 +1011,9 @@ static bool test_delayed_write_update2(struct torture_context *tctx, struct smbc
                torture_comment(tctx, "Server did not update write time (correct)\n");
        }
 
+       fflush(stdout);
+       msleep(2 * msec);
+
        fnum2 = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE);
        if (fnum2 == -1) {
                torture_comment(tctx, "Failed to open %s\n", fname);