summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-06-09 00:07:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:37 -0500
commit73c077d37b69267646986ea3fc2ed99d7ef15d4c (patch)
treed4aee29b98cbb3d6068c6234a78fbc3206ab9d94
parenta125e49d6740c44a36e6d5a1af33700163a11e95 (diff)
downloadsamba-73c077d37b69267646986ea3fc2ed99d7ef15d4c.tar.gz
samba-73c077d37b69267646986ea3fc2ed99d7ef15d4c.tar.bz2
samba-73c077d37b69267646986ea3fc2ed99d7ef15d4c.zip
r1091: Added in timing tests for deferred opens. Added extra debug info to signing
mistakes. Jeremy. (This used to be commit 5c3a2417cfe1bdbdfb35d933d49f77f6696790b3)
-rw-r--r--source4/libcli/raw/smb_signing.c2
-rw-r--r--source4/torture/torture.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/source4/libcli/raw/smb_signing.c b/source4/libcli/raw/smb_signing.c
index c82946ac53..a39f33c290 100644
--- a/source4/libcli/raw/smb_signing.c
+++ b/source4/libcli/raw/smb_signing.c
@@ -188,7 +188,7 @@ static BOOL cli_request_simple_check_incoming_message(struct cli_request *req)
}
if (good && i != 1) {
- DEBUG(0,("SIGNING OFFSET %d\n", i));
+ DEBUG(0,("SIGNING OFFSET %d (should be %d)\n", i, req->seq_num+1));
}
if (!good) {
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) {