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)
committerJeremy Allison <jra@samba.org>
Wed, 31 Oct 2018 20:27:19 +0000 (21:27 +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>
source4/torture/vfs/fruit.c

index 52ccd69379447edfe2421512dc00eb06cdb6c868..272a2a987829be4eadc7d411cba7cf455f45d748 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");