diff options
author | Günther Deschner <gd@samba.org> | 2016-01-15 18:07:31 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-01-26 21:01:18 +0100 |
commit | 9c23f43f9edd8cfbfdd56e397748e2f74b1ef29b (patch) | |
tree | 446533818e622dfeae09e79287d18213017b7d94 /source4 | |
parent | 07bb954d929cf2aa61afe469c14ecba449cd5d43 (diff) | |
download | samba-9c23f43f9edd8cfbfdd56e397748e2f74b1ef29b.tar.gz |
s4-torture: let smb2.replay.replay2 test deal with scale out shares.
Guenther
Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/smb2/replay.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c index 57b14f1c39c..83d36a3c0c2 100644 --- a/source4/torture/smb2/replay.c +++ b/source4/torture/smb2/replay.c @@ -302,12 +302,17 @@ static bool test_replay2(struct torture_context *tctx, struct smb2_tree *tree) bool ret = true; const char *fname = BASEDIR "\\replay2.dat"; struct smb2_transport *transport = tree->session->transport; + uint32_t share_capabilities; + bool share_is_so; if (smbXcli_conn_protocol(transport->conn) < PROTOCOL_SMB3_00) { torture_skip(tctx, "SMB 3.X Dialect family required for " "replay tests\n"); } + share_capabilities = smb2cli_tcon_capabilities(tree->smbXcli); + share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT; + ZERO_STRUCT(break_info); break_info.tctx = tctx; tree->session->transport->oplock.handler = torture_oplock_ack_handler; @@ -336,10 +341,16 @@ static bool test_replay2(struct torture_context *tctx, struct smb2_tree *tree) _h = io.out.file.handle; h = &_h; CHECK_CREATED(&io, CREATED, FILE_ATTRIBUTE_ARCHIVE); - CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("b")); CHECK_VAL(io.out.durable_open, false); - CHECK_VAL(io.out.durable_open_v2, true); - CHECK_VAL(io.out.timeout, io.in.timeout); + if (share_is_so) { + CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("s")); + CHECK_VAL(io.out.durable_open_v2, false); + CHECK_VAL(io.out.timeout, 0); + } else { + CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("b")); + CHECK_VAL(io.out.durable_open_v2, true); + CHECK_VAL(io.out.timeout, io.in.timeout); + } /* * Replay Durable V2 Create on single channel @@ -392,10 +403,13 @@ static bool test_replay2(struct torture_context *tctx, struct smb2_tree *tree) io.in.durable_open_v2 = false; status = smb2_create(tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION); - CHECK_VAL(break_info.count, 1); - CHECK_HANDLE(&break_info.handle, &ref1.out.file.handle); - CHECK_VAL(break_info.level, smb2_util_oplock_level("s")); - ZERO_STRUCT(break_info); + + if (!share_is_so) { + CHECK_VAL(break_info.count, 1); + CHECK_HANDLE(&break_info.handle, &ref1.out.file.handle); + CHECK_VAL(break_info.level, smb2_util_oplock_level("s")); + ZERO_STRUCT(break_info); + } smb2_util_close(tree, *h); h = NULL; |