1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

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>
This commit is contained in:
Günther Deschner 2016-01-15 18:07:31 +01:00 committed by Jeremy Allison
parent 07bb954d92
commit 9c23f43f9e

View File

@ -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;