s4:torture:vfs_fruit: update AFP_AfpInfo IO tests
authorRalph Boehme <slow@samba.org>
Sat, 19 Dec 2015 10:10:54 +0000 (11:10 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 21 Dec 2015 22:21:18 +0000 (23:21 +0100)
When reading from the AFP_AfpInfo stream, OS X ignores the offset from
the request and always reads from offset=0.

The offset bounds check has a off-by-1 bug in OS X, so a request
offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1
returns 1 byte from offset 0 insteaf of returning 0.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

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

index 0a034b70bdb40c9fc82a5458e39fda10de65d862..fe6b0702252d90f55ce82808d0dab57b260a0218 100644 (file)
@@ -1310,7 +1310,7 @@ static bool test_read_netatalk_metadata(struct torture_context *tctx,
        torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
 
        ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
-                          16, 8, 0, 8, "BARRFOOO");
+                          16, 8, 0, 3, "AFP");
        torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
 
        /* Check reading offset and read size > sizeof(AFPINFO_STREAM) */
@@ -1321,11 +1321,11 @@ static bool test_read_netatalk_metadata(struct torture_context *tctx,
 
        len = read_stream(tree, __location__, tctx, mem_ctx, fname,
                          AFPINFO_STREAM, 59, 2);
-       CHECK_VALUE(len, 1);
+       CHECK_VALUE(len, 2);
 
        len = read_stream(tree, __location__, tctx, mem_ctx, fname,
                          AFPINFO_STREAM, 60, 1);
-       CHECK_VALUE(len, 0);
+       CHECK_VALUE(len, 1);
 
        len = read_stream(tree, __location__, tctx, mem_ctx, fname,
                          AFPINFO_STREAM, 61, 1);