r1091: Added in timing tests for deferred opens. Added extra debug info to signing
authorJeremy Allison <jra@samba.org>
Wed, 9 Jun 2004 00:07:59 +0000 (00:07 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:37 +0000 (12:56 -0500)
mistakes.
Jeremy.

source/libcli/raw/smb_signing.c
source/torture/torture.c

index c82946ac53d1a947b69e2fc6dec1c6e54039289c..a39f33c290ba899493f4a6980055af3e6f3b4de9 100644 (file)
@@ -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) {
index 4da9592479989b137fde381823b3a04dc1f5a39c..4d8fbd0a69a955f60ad79b983f182d67ab56b382 100644 (file)
@@ -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) {