s4/test: fix AAPL size check
authorRalph Boehme <slow@samba.org>
Thu, 11 Jan 2018 11:25:49 +0000 (12:25 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 7 Apr 2018 00:11:20 +0000 (02:11 +0200)
A recent commit changed the ModelString from "Samba" to "MacSamba".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/vfs/fruit.c

index 65109cc193445115cfc5ab8343747f270e4f6c99..74628211c9ec1f38e1f1c4c4431d6bfe01cb7306 100644 (file)
@@ -2044,6 +2044,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);
 
@@ -2100,7 +2101,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;
@@ -2113,11 +2117,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);