]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/vfs/fruit: expand existing vfs_test "null afpinfo"
authorRalph Boehme <slow@samba.org>
Wed, 10 Oct 2018 10:47:07 +0000 (12:47 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 6 Nov 2018 08:10:24 +0000 (09:10 +0100)
This adds a check that a read on a seperate handle also sees the
previously created AFP_AfpInfo stream.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6f428607e35055b9ce1a04a625d43740bf5c76b2)

source4/torture/vfs/fruit.c

index ac7b6682e6d7d5f427236d22934f3ccc0e661382..ff3ea274f6513770f92372e06f1507e01df10d5e 100644 (file)
@@ -4091,6 +4091,8 @@ static bool test_null_afpinfo(struct torture_context *tctx,
        AfpInfo *afpinfo = NULL;
        char *afpinfo_buf = NULL;
        const char *type_creator = "SMB,OLE!";
+       struct smb2_handle handle2;
+       struct smb2_read r;
 
        torture_comment(tctx, "Checking create of AfpInfo stream\n");
 
@@ -4129,6 +4131,20 @@ static bool test_null_afpinfo(struct torture_context *tctx,
        status = smb2_read_recv(req[1], tree, &read);
        torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_read_recv failed");
 
+       status = torture_smb2_testfile_access(tree, sname, &handle2,
+                                             SEC_FILE_READ_DATA);
+       torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+                                       "torture_smb2_testfile failed\n");
+       r = (struct smb2_read) {
+               .in.file.handle = handle2,
+               .in.length      = AFP_INFO_SIZE,
+       };
+
+       status = smb2_read(tree, tree, &r);
+       torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
+                                       "torture_smb2_testfile failed\n");
+       smb2_util_close(tree, handle2);
+
        afpinfo = torture_afpinfo_new(mem_ctx);
        torture_assert_goto(tctx, afpinfo != NULL, ret, done, "torture_afpinfo_new failed");