s4:torture/vfs/fruit: adjust test testing basefile rename to expect failure
authorRalph Boehme <slow@samba.org>
Sat, 26 May 2018 16:33:00 +0000 (18:33 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 30 May 2018 17:10:25 +0000 (19:10 +0200)
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>
selftest/knownfail.d/samba3.vfs.fruit
source4/torture/vfs/fruit.c

index 8df25bccb79b6474aac2a6faab4df7495336612f..bf97dbc5822f9bd25d52ba00548ba86b5416c8ef 100644 (file)
@@ -1 +1,4 @@
 ^samba3.vfs.fruit streams_depot.OS X AppleDouble file conversion\(nt4_dc\)
+^samba3.vfs.fruit metadata_netatalk.read open rsrc after rename\(nt4_dc\)
+^samba3.vfs.fruit metadata_stream.read open rsrc after rename\(nt4_dc\)
+^samba3.vfs.fruit streams_depot.read open rsrc after rename\(nt4_dc\)
index 14191fd02576356ee2d1385bcb00a7c836c02a71..4c49a6bf53286c9840db85f7a37bf673e88bddc2 100644 (file)
@@ -3902,7 +3902,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");
@@ -3954,28 +3953,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);