]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture:smb2: use delete-on-close in test_rw_invalid()
authorStefan Metzmacher <metze@samba.org>
Tue, 2 Jun 2020 11:52:23 +0000 (13:52 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 5 Jun 2020 13:17:55 +0000 (13:17 +0000)
We test the limits here and leave a 16TB file with zeros.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun  5 13:17:55 UTC 2020 on sn-devel-184

source4/torture/smb2/read_write.c

index b0eea55d7f1f87e46cb6c934207dd378a7c5d016..707a49b6b1c4e2ae65d6de9040cc321251e28a3c 100644 (file)
@@ -169,6 +169,7 @@ static bool test_rw_invalid(struct torture_context *torture, struct smb2_tree *t
        uint8_t buf[64*1024];
        struct smb2_read rd;
        struct smb2_write w = {0};
+       union smb_setfileinfo sfinfo;
        TALLOC_CTX *tmp_ctx = talloc_new(tree);
 
        ZERO_STRUCT(buf);
@@ -178,6 +179,14 @@ static bool test_rw_invalid(struct torture_context *torture, struct smb2_tree *t
        status = torture_smb2_testfile(tree, FNAME, &h);
        CHECK_STATUS(status, NT_STATUS_OK);
 
+       /* set delete-on-close */
+       ZERO_STRUCT(sfinfo);
+       sfinfo.generic.level = RAW_SFILEINFO_DISPOSITION_INFORMATION;
+       sfinfo.disposition_info.in.delete_on_close = 1;
+       sfinfo.generic.in.file.handle = h;
+       status = smb2_setinfo_file(tree, &sfinfo);
+       CHECK_STATUS(status, NT_STATUS_OK);
+
        status = smb2_util_write(tree, h, buf, 0, ARRAY_SIZE(buf));
        CHECK_STATUS(status, NT_STATUS_OK);