[PATCHES] some improvements to replay tests

Michael Adam obnox at samba.org
Mon Feb 29 01:01:12 UTC 2016


Attached find some small improvements to the
s4-torture-smb2-replay tests.

Review appreciated!

Thanks - Michael
-------------- next part --------------
From 6f71c4742f0f726f83c8b0a90d0bf2124f194f19 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 29 Feb 2016 01:51:23 +0100
Subject: [PATCH 1/3] torture:smb2: skip replay3 if server does not support
 Multi-Channel

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source4/torture/smb2/replay.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 4b3f569..71062c0 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -487,12 +487,20 @@ static bool test_replay3(struct torture_context *tctx, struct smb2_tree *tree1)
 	struct smb2_session *session1_2 = NULL;
 	uint32_t share_capabilities;
 	bool share_is_so;
+	uint32_t server_capabilities;
 
 	if (smbXcli_conn_protocol(transport1->conn) < PROTOCOL_SMB3_00) {
 		torture_skip(tctx, "SMB 3.X Dialect family required for "
 				   "Replay tests\n");
 	}
 
+	server_capabilities = smb2cli_conn_server_capabilities(
+					tree1->session->transport->conn);
+	if (!(server_capabilities & SMB2_CAP_MULTI_CHANNEL)) {
+		torture_skip(tctx,
+			     "Server does not support multi-channel.");
+	}
+
 	share_capabilities = smb2cli_tcon_capabilities(tree1->smbXcli);
 	share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT;
 
-- 
2.5.0


From ca1e018d430b1b03ed6035395b7a9dca270b89a7 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 29 Feb 2016 01:52:07 +0100
Subject: [PATCH 2/3] torture:smb2: skip replay5 test if server does not
 support persistent handles

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source4/torture/smb2/replay.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 71062c0..2b60cbf 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -877,6 +877,7 @@ static bool test_replay5(struct torture_context *tctx, struct smb2_tree *tree)
 	uint32_t share_capabilities;
 	bool share_is_ca;
 	bool share_is_so;
+	uint32_t server_capabilities;
 	const char *fname = BASEDIR "\\replay5.dat";
 	struct smb2_transport *transport = tree->session->transport;
 	struct smbcli_options options = tree->session->transport->options;
@@ -888,6 +889,13 @@ static bool test_replay5(struct torture_context *tctx, struct smb2_tree *tree)
 				"Replay tests\n");
 	}
 
+	server_capabilities = smb2cli_conn_server_capabilities(
+					tree->session->transport->conn);
+	if (!(server_capabilities & SMB2_CAP_PERSISTENT_HANDLES)) {
+		torture_skip(tctx,
+			     "Server does not support persistent handles.");
+	}
+
 	share_capabilities = smb2cli_tcon_capabilities(tree->smbXcli);
 
 	share_is_ca = share_capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY;
-- 
2.5.0


From d24b54ad82ddb7fe365ae17d70de50fe10b06b44 Mon Sep 17 00:00:00 2001
From: Michael Adam <obnox at samba.org>
Date: Mon, 29 Feb 2016 01:52:42 +0100
Subject: [PATCH 3/3] torture:smb2: fix skip message if share is not CA

Signed-off-by: Michael Adam <obnox at samba.org>
---
 source4/torture/smb2/replay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 2b60cbf..26c32d1 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -900,7 +900,7 @@ static bool test_replay5(struct torture_context *tctx, struct smb2_tree *tree)
 
 	share_is_ca = share_capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY;
 	if (!share_is_ca) {
-		torture_skip(tctx, "Persistent File Handles not supported");
+		torture_skip(tctx, "Share is not continuously available.");
 	}
 
 	share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT;
-- 
2.5.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160229/1b6cec66/signature.sig>


More information about the samba-technical mailing list