s4-torture: let smb2.replay.replay4 test deal with scale out shares.
authorGünther Deschner <gd@samba.org>
Fri, 15 Jan 2016 17:30:15 +0000 (18:30 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 26 Jan 2016 20:01:18 +0000 (21:01 +0100)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/smb2/replay.c

index f045e17b5ab229948e50a77393fbdf14d7299eab..4b3f5697fe2dcf5fcebfcaa79547581c0fbdf569 100644 (file)
@@ -640,12 +640,17 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
        struct smb2_session *session1_1 = tree1->session;
        struct smb2_session *session1_2 = NULL;
        uint16_t curr_cs;
+       uint32_t share_capabilities;
+       bool share_is_so;
 
        if (smbXcli_conn_protocol(transport1->conn) < PROTOCOL_SMB3_00) {
                torture_skip(tctx, "SMB 3.X Dialect family required for "
                                   "Replay tests\n");
        }
 
+       share_capabilities = smb2cli_tcon_capabilities(tree1->smbXcli);
+       share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT;
+
        ZERO_STRUCT(break_info);
        break_info.tctx = tctx;
        transport1->oplock.handler = torture_oplock_ack_handler;
@@ -677,10 +682,16 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
        _h1 = io.out.file.handle;
        h1 = &_h1;
        CHECK_CREATED(&io, CREATED, FILE_ATTRIBUTE_ARCHIVE);
-       CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level("b"));
+       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);
+       }
        CHECK_VAL(io.out.durable_open, false);
-       CHECK_VAL(io.out.durable_open_v2, true);
-       CHECK_VAL(io.out.timeout, io.in.timeout);
        CHECK_VAL(break_info.count, 0);
 
        status = smb2_util_write(tree1, *h1, buf, 0, ARRAY_SIZE(buf));
@@ -821,7 +832,11 @@ static bool test_replay4(struct torture_context *tctx, struct smb2_tree *tree1)
        smb2_util_close(tree1, *h1);
        h1 = NULL;
 
-       CHECK_VAL(break_info.count, 0);
+       if (share_is_so) {
+               CHECK_VAL(break_info.count, 1);
+       } else {
+               CHECK_VAL(break_info.count, 0);
+       }
 done:
        talloc_free(tree2);
        tree1->session = session1_1;