From d7515b6a8886b282995a2ed433db92835783c393 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 7 Aug 2012 17:12:19 +0200 Subject: torture: Reproducer for 64c0367 Signed-off-by: Jeremy Allison --- source4/torture/raw/lock.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source4/torture/raw') 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; -- cgit