summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-05 03:04:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:32 -0500
commit16d887b3c4058184c826d60a6e9ca823cb5a59ba (patch)
treef2fc115c5cf83118fc7f4f82559f121c9ad59545 /source4/torture
parente370e9140dadcb50e1e272d37f6d4d96b0a3759a (diff)
downloadsamba-16d887b3c4058184c826d60a6e9ca823cb5a59ba.tar.gz
samba-16d887b3c4058184c826d60a6e9ca823cb5a59ba.tar.bz2
samba-16d887b3c4058184c826d60a6e9ca823cb5a59ba.zip
r21139: make the RAW-MUX test fail if the locking subsystem doesn't trigger
early byte range lock retries (ie. PENDING locks in brlock) (This used to be commit 09237e3acf524f7e772acce2e652ef30b8ba4d65)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/mux.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index f7d8b430df..a5fd0ed3f0 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -206,6 +206,7 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
BOOL ret = True;
struct smbcli_request *req;
struct smb_lock_entry lock[1];
+ struct timeval t;
printf("TESTING MULTIPLEXED LOCK/LOCK/UNLOCK\n");
@@ -238,6 +239,7 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT);
printf("this will too, but we'll unlock while waiting\n");
+ t = timeval_current();
req = smb_raw_lock_send(cli->tree, &io);
printf("unlock the first range\n");
@@ -252,6 +254,12 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smbcli_request_simple_recv(req);
CHECK_STATUS(status, NT_STATUS_OK);
+ printf("async lock took %.2f msec\n", timeval_elapsed(&t) * 1000);
+ if (timeval_elapsed(&t) > 0.1) {
+ printf("failed to trigger early lock retry\n");
+ return False;
+ }
+
printf("reopening with an exit\n");
smb_raw_exit(cli->session);
fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE);