diff options
author | Ralph Boehme <slow@samba.org> | 2018-05-26 18:33:00 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2018-07-12 13:10:25 +0200 |
commit | 93ec87ec2ae750071f139728c44c951f86c9a728 (patch) | |
tree | 990b478c8382ac1e2679f82ce8e040ac080fb969 /source4/torture | |
parent | 36972fd61d4bf3e1b24575f8ec54610d32d815e1 (diff) | |
download | samba-93ec87ec2ae750071f139728c44c951f86c9a728.tar.gz |
s4:torture/vfs/fruit: adjust test testing basefile rename to expect failure
Renaming a basefile that has open streams must fail with
NT_STATUS_ACCESS_DENIED.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13451
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit f166207fc0344b51879d863857055ab7ff36a09b)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/vfs/fruit.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index d1126020a5a..1202adb2cbf 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -3897,7 +3897,6 @@ static bool test_rename_and_read_rsrc(struct torture_context *tctx, const char *fname_renamed = "test_rename_openfile_renamed"; const char *data = "1234567890"; union smb_setfileinfo sinfo; - struct smb2_read r; ret = enable_aapl(tctx, tree); torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed"); @@ -3949,28 +3948,12 @@ static bool test_rename_and_read_rsrc(struct torture_context *tctx, sinfo.rename_information.in.new_name = fname_renamed; status = smb2_setinfo_file(tree, &sinfo); - torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_setinfo_file failed"); - - smb2_util_close(tree, h2); - - ZERO_STRUCT(r); - r.in.file.handle = h1; - r.in.length = 10; - r.in.offset = 0; - - torture_comment(tctx, "Read resource fork of renamed file\n"); - - status = smb2_read(tree, tree, &r); - torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_read failed"); + torture_assert_ntstatus_equal_goto( + tctx, status, NT_STATUS_ACCESS_DENIED, ret, done, + "smb2_setinfo_file failed"); smb2_util_close(tree, h1); - - torture_assert_goto(tctx, r.out.data.length == 10, ret, done, - talloc_asprintf(tctx, "smb2_read returned %jd bytes, expected 10\n", - (intmax_t)r.out.data.length)); - - torture_assert_goto(tctx, memcmp(r.out.data.data, data, 10) == 0, ret, done, - talloc_asprintf(tctx, "Bad data in stream\n")); + smb2_util_close(tree, h2); done: smb2_util_unlink(tree, fname); |