diff options
author | Volker Lendecke <vl@samba.org> | 2012-08-07 17:12:19 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-08-10 14:38:47 -0700 |
commit | d7515b6a8886b282995a2ed433db92835783c393 (patch) | |
tree | e28f038d01e9456291c4dabf84e94d25d69cf94d /source4/torture/raw | |
parent | 1f50b6c3aefe9a7ac64641b1e9c23e014459647f (diff) | |
download | samba-d7515b6a8886b282995a2ed433db92835783c393.tar.gz samba-d7515b6a8886b282995a2ed433db92835783c393.tar.bz2 samba-d7515b6a8886b282995a2ed433db92835783c393.zip |
torture: Reproducer for 64c0367
Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/lock.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c index c2e555147b..a31a4d0cfb 100644 --- a/source4/torture/raw/lock.c +++ b/source4/torture/raw/lock.c @@ -773,8 +773,19 @@ static bool test_async(struct torture_context *tctx, status = smb_raw_lock(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_LOCK_NOT_GRANTED); + { + /* + * Make the test block on the second lock + * request. This is to regression-test 64c0367. + */ + uint64_t tmp = lock[1].offset; + lock[1].offset = lock[0].offset; + lock[0].offset = tmp; + } + t = time_mono(NULL); io.lockx.in.timeout = 10000; + io.lockx.in.lock_cnt = 2; req = smb_raw_lock_send(cli->tree, &io); torture_assert(tctx,(req != NULL), talloc_asprintf(tctx, "Failed to setup timed lock (%s)\n", __location__)); @@ -791,6 +802,15 @@ static bool test_async(struct torture_context *tctx, torture_assert(tctx,!(time_mono(NULL) > t+2), talloc_asprintf(tctx, "lock cancel by close was not immediate (%s)\n", __location__)); + { + /* + * Undo the change for 64c0367 + */ + uint64_t tmp = lock[1].offset; + lock[1].offset = lock[0].offset; + lock[0].offset = tmp; + } + torture_comment(tctx, "create a new sessions\n"); session = smbcli_session_init(cli->transport, tctx, false, options); setup.in.sesskey = cli->transport->negotiate.sesskey; |