1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

s4:torture:smb2: use delete-on-close in test_rw_invalid()

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
This commit is contained in:
Stefan Metzmacher 2020-06-02 13:52:23 +02:00
parent 72d69eef13
commit 05e1417396

View 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);