[PATCH] Fix a warning in a vfs_fruit torture test

Ralph Böhme slow at samba.org
Fri Jan 12 11:36:55 UTC 2018


On Thu, Jan 11, 2018 at 02:07:55PM -0800, Jeremy Allison wrote:
> On Thu, Jan 11, 2018 at 03:34:46PM +0100, Ralph Böhme via samba-technical wrote:
> > Hi!
> > 
> > Attached is a patch that fixes a warning in a vfs_fruit torture test.
> > 
> > Please review&push if happy. Thanks!
> 
> RB+ if you change the spelling of "exptected_aapl_ctx_size"
> to "expected_aapl_ctx_size" :-).

oh, copy&paste error. :) Attached patch fixes the copy, the source and another
spelling mistake I spotted.

-slow

-- 
Ralph Boehme, Samba Team       https://samba.org/
Samba Developer, SerNet GmbH   https://sernet.de/en/samba/
-------------- next part --------------
From 41add4f5f01030a3eaec14c7f9cb491b549fd9ad Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Thu, 11 Jan 2018 12:25:49 +0100
Subject: [PATCH 1/3] s4/test: fix AAPL size check

A recent commit changed the ModelString from "Samba" to "MacSamba".

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source4/torture/vfs/fruit.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index d071cf6f9af..f0ced3d63a5 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -2040,6 +2040,7 @@ static bool test_aapl(struct torture_context *tctx,
 	unsigned int count;
 	union smb_search_data *d;
 	uint64_t rfork_len;
+	bool is_osx_server = torture_setting_bool(tctx, "osx", false);
 
 	smb2_deltree(tree, BASEDIR);
 
@@ -2096,7 +2097,10 @@ static bool test_aapl(struct torture_context *tctx,
 		goto done;
 	}
 
-	if (aapl->data.length != 50) {
+	if (!is_osx_server) {
+		size_t expected_aapl_ctx_size;
+		bool size_ok;
+
 		/*
 		 * uint32_t CommandCode = kAAPL_SERVER_QUERY
 		 * uint32_t Reserved = 0;
@@ -2109,11 +2113,12 @@ static bool test_aapl(struct torture_context *tctx,
 		 *                       kAAPL_CASE_SENSITIVE;
 		 * uint32_t Pad2 = 0;
 		 * uint32_t ModelStringLen = 10;
-		 * ucs2_t ModelString[5] = "Samba";
+		 * ucs2_t ModelString[5] = "MacSamba";
 		 */
-		torture_warning(tctx,
-				"(%s) unexpected AAPL context length: %zd, expected 50",
-				__location__, aapl->data.length);
+		expected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
+
+		size_ok = aapl->data.length == expected_aapl_ctx_size;
+		torture_assert_goto(tctx, size_ok, ret, done, "bad AAPL size");
 	}
 
 	aapl_cmd = IVAL(aapl->data.data, 0);
-- 
2.13.6


From 30a9617bffafff44b6c70af22af7826d866dd778 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 12 Jan 2018 12:28:18 +0100
Subject: [PATCH 2/3] s4/torture: spelling fix in vfs_fruit test

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source4/torture/vfs/fruit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index f0ced3d63a5..292dce3cd39 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -1309,12 +1309,12 @@ static bool enable_aapl(struct torture_context *tctx,
 	torture_assert_goto(tctx, aapl != NULL, ret, done, "missing AAPL context");
 
 	if (!is_osx_server) {
-		size_t exptected_aapl_ctx_size;
+		size_t expected_aapl_ctx_size;
 
-		exptected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
+		expected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
 
 		torture_assert_goto(
-			tctx, aapl->data.length == exptected_aapl_ctx_size,
+			tctx, aapl->data.length == expected_aapl_ctx_size,
 			ret, done, "bad AAPL size");
 	}
 
-- 
2.13.6


From 9b941f35fb8c030b5cf6f3752126585ea3d4e7cd Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Fri, 12 Jan 2018 12:29:17 +0100
Subject: [PATCH 3/3] s4/torture: spelling fix in vfs_fruit test

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source4/torture/vfs/fruit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index 292dce3cd39..16ec5329667 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -1260,7 +1260,7 @@ static bool enable_aapl(struct torture_context *tctx,
 	DATA_BLOB data;
 	struct smb2_create_blob *aapl = NULL;
 	uint32_t aapl_server_caps;
-	uint32_t expexted_scaps = (SMB2_CRTCTX_AAPL_UNIX_BASED |
+	uint32_t expected_scaps = (SMB2_CRTCTX_AAPL_UNIX_BASED |
 				   SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR |
 				   SMB2_CRTCTX_AAPL_SUPPORTS_NFS_ACE |
 				   SMB2_CRTCTX_AAPL_SUPPORTS_OSX_COPYFILE);
@@ -1319,7 +1319,7 @@ static bool enable_aapl(struct torture_context *tctx,
 	}
 
 	aapl_server_caps = BVAL(aapl->data.data, 16);
-	torture_assert_goto(tctx, aapl_server_caps == expexted_scaps,
+	torture_assert_goto(tctx, aapl_server_caps == expected_scaps,
 			    ret, done, "bad AAPL caps");
 
 done:
-- 
2.13.6



More information about the samba-technical mailing list