From 73c077d37b69267646986ea3fc2ed99d7ef15d4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 9 Jun 2004 00:07:59 +0000 Subject: r1091: Added in timing tests for deferred opens. Added extra debug info to signing mistakes. Jeremy. (This used to be commit 5c3a2417cfe1bdbdfb35d933d49f77f6696790b3) --- source4/torture/torture.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/torture/torture.c') diff --git a/source4/torture/torture.c b/source4/torture/torture.c index 4da9592479..4d8fbd0a69 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -1777,13 +1777,26 @@ static BOOL run_deferopen(struct cli_state *cli, int dummy) while (i < 4) { int fnum = -1; + do { + struct timeval tv_start, tv_end; + GetTimeOfDay(&tv_start); fnum = cli_nt_create_full(cli->tree, fname, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_NONE, NTCREATEX_DISP_OPEN_IF, 0, 0); if (fnum != -1) { break; } + GetTimeOfDay(&tv_end); + if (NT_STATUS_EQUAL(cli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION)) { + /* Sharing violation errors need to be 1 second apart. */ + long long tdif = usec_time_diff(&tv_end, &tv_start); + if (tdif < 500000 || tdif > 1500000) { + fprintf(stderr,"Timing incorrect %lld.%lld for share violation\n", + tdif / (long long)1000000, + tdif % (long long)1000000); + } + } } while (NT_STATUS_EQUAL(cli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION)); if (fnum == -1) { -- cgit