diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-03-08 14:15:19 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-03-08 14:23:22 +0100 |
commit | fa62f9474bf390bc5f223c54868c6c525418f84c (patch) | |
tree | 55c5b78647bda3dbaaabf591f91ad62fdabb4718 /source4 | |
parent | 9a11f2ea092f046693ee3fbf076b4a3c4be3d8f0 (diff) | |
download | samba-fa62f9474bf390bc5f223c54868c6c525418f84c.tar.gz samba-fa62f9474bf390bc5f223c54868c6c525418f84c.tar.bz2 samba-fa62f9474bf390bc5f223c54868c6c525418f84c.zip |
s4:torture/smb2: avoid hanging in smb2.session.reconnect against samba
Now we fail the test directly instead of waiting for oplocks to timeout.
Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>
metze
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/smb2/session.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c index 3a0ef080aa..f565975834 100644 --- a/source4/torture/smb2/session.c +++ b/source4/torture/smb2/session.c @@ -96,6 +96,15 @@ bool test_session_reconnect(struct torture_context *tctx, struct smb2_tree *tree goto done; } + /* try to access the file via the old handle */ + + ZERO_STRUCT(qfinfo); + qfinfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; + qfinfo.generic.in.file.handle = _h1; + status = smb2_getinfo_file(tree, mem_ctx, &qfinfo); + CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); + h1 = NULL; + smb2_oplock_create_share(&io2, fname, smb2_util_share_access(""), smb2_util_oplock_level("b")); @@ -107,15 +116,10 @@ bool test_session_reconnect(struct torture_context *tctx, struct smb2_tree *tree _h2 = io2.out.file.handle; h2 = &_h2; - /* try to access the file via the old handle */ - - ZERO_STRUCT(qfinfo); - qfinfo.generic.level = RAW_FILEINFO_POSITION_INFORMATION; - qfinfo.generic.in.file.handle = _h1; - status = smb2_getinfo_file(tree, mem_ctx, &qfinfo); - CHECK_STATUS(status, NT_STATUS_USER_SESSION_DELETED); - done: + if (h1 != NULL) { + smb2_util_close(tree, *h1); + } if (h2 != NULL) { smb2_util_close(tree2, *h2); } |