summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-07 07:10:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:47 -0500
commitd9bd4dad5036f1460a74f49e5288ceca26ec1b66 (patch)
treec54e7a279803ef9e0b7e2c45b84b6cf7accc56fb /source4/torture
parent667cff3699a37510a69f682407bdda6316ba4402 (diff)
downloadsamba-d9bd4dad5036f1460a74f49e5288ceca26ec1b66.tar.gz
samba-d9bd4dad5036f1460a74f49e5288ceca26ec1b66.tar.bz2
samba-d9bd4dad5036f1460a74f49e5288ceca26ec1b66.zip
r21215: extend the RAW-MUX test to test cancelling a async lock request using
a SMBexit (This used to be commit 753a85eff6a19af2c7b0884f705e9f66b5f605fe)
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/raw/mux.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c
index a5fd0ed3f0..66fed156b3 100644
--- a/source4/torture/raw/mux.c
+++ b/source4/torture/raw/mux.c
@@ -290,10 +290,13 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
/* cancel the blocking lock */
smb_raw_ntcancel(req);
+ printf("sending 2nd cancel\n");
/* the 2nd cancel is totally harmless, but tests the server trying to
cancel an already cancelled request */
smb_raw_ntcancel(req);
+ printf("sent 2nd cancel\n");
+
lock[0].pid = 1;
io.lockx.in.ulock_cnt = 1;
io.lockx.in.lock_cnt = 0;
@@ -304,7 +307,32 @@ static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
status = smbcli_request_simple_recv(req);
CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT);
- smbcli_close(cli->tree, fnum);
+ printf("cancel a lock using exit to close file\n");
+ lock[0].pid = 1;
+ io.lockx.in.ulock_cnt = 0;
+ io.lockx.in.lock_cnt = 1;
+ io.lockx.in.timeout = 1000;
+
+ status = smb_raw_lock(cli->tree, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ t = timeval_current();
+ lock[0].pid = 2;
+ req = smb_raw_lock_send(cli->tree, &io);
+
+ smb_raw_exit(cli->session);
+ smb_raw_exit(cli->session);
+ smb_raw_exit(cli->session);
+ smb_raw_exit(cli->session);
+
+ printf("recv the async reply\n");
+ status = smbcli_request_simple_recv(req);
+ CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED);
+ printf("async lock exit took %.2f msec\n", timeval_elapsed(&t) * 1000);
+ if (timeval_elapsed(&t) > 0.1) {
+ printf("failed to trigger early lock failure\n");
+ return False;
+ }
done:
return ret;