torture: expand test "vfs.fruit.resource fork IO" to check size
authorRalph Boehme <slow@samba.org>
Fri, 25 Oct 2019 13:41:40 +0000 (15:41 +0200)
committerRalph Boehme <slow@samba.org>
Wed, 30 Oct 2019 13:23:42 +0000 (13:23 +0000)
Reveals a bug where the resource fork size is capped at 65454 bytes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14171

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
selftest/knownfail.d/samba3.vfs.fruit
source4/torture/vfs/fruit.c

index 6307e2b34043b5f960a67ad7861eeb004b5bed3e..6982e100861eefc398b6112a91b5bace2eb21c50 100644 (file)
@@ -1,2 +1,5 @@
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion without embedded xattr\(nt4_dc\)
+^samba3.vfs.fruit fruit_delete_empty_adfiles.resource fork IO\(nt4_dc\)
+^samba3.vfs.fruit metadata_stream.resource fork IO\(nt4_dc\)
+^samba3.vfs.fruit metadata_netatalk.resource fork IO\(nt4_dc\)
index 3a6a198a658d074671841c31475802e3e3840d70..94cbf27767793b3032ff6b6fa084ac172b397656 100644 (file)
@@ -2397,6 +2397,35 @@ static bool test_write_atalk_rfork_io(struct torture_context *tctx,
                            fname, AFPRESOURCE_STREAM_NAME,
                            (off_t)64*1024*1024, 10, rfork_content);
 
+       /* Check size after write */
+
+       ZERO_STRUCT(io);
+       io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
+       io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
+               SEC_FILE_WRITE_ATTRIBUTE;
+       io.smb2.in.fname = rfork;
+       status = smb2_create(tree, mem_ctx, &(io.smb2));
+       CHECK_STATUS(status, NT_STATUS_OK);
+       filehandle = io.smb2.out.file.handle;
+
+       torture_comment(tctx, "(%s) check resource fork size after write\n",
+           __location__);
+
+       ZERO_STRUCT(finfo);
+       finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
+       finfo.generic.in.file.handle = filehandle;
+       status = smb2_getinfo_file(tree, mem_ctx, &finfo);
+       CHECK_STATUS(status, NT_STATUS_OK);
+       if (finfo.all_info.out.size != 64*1024*1024 + 10) {
+               torture_result(tctx, TORTURE_FAIL,
+                              "(%s) Incorrect resource fork size\n",
+                              __location__);
+               ret = false;
+               smb2_util_close(tree, filehandle);
+               goto done;
+       }
+       smb2_util_close(tree, filehandle);
+
        ret &= check_stream(tree, __location__, tctx, mem_ctx,
                            fname, AFPRESOURCE_STREAM_NAME,
                            (off_t)64*1024*1024, 10, 0, 10, rfork_content);