]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: fix attributes for "special" test cases
authorMatt Benjamin <mbenjamin@redhat.com>
Sat, 2 Apr 2016 19:14:25 +0000 (15:14 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 5 Apr 2016 22:30:20 +0000 (18:30 -0400)
If a caller does an atomic create using rgw_lookup() and
RGW_LOOKUP_FLAG_CREATE, it needs to fix up the attributes using
create_stat().

For use outside of test cases, it probably needs an interlock also,
but for now, do just enough to satisfy existing attribute checks.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/test/librgw_file_nfsns.cc

index 1cc6a66532a89d686aee45cd13de80e32bc9e88d..c5f483a362b69d42c30bb19301f1c922861af0de 100644 (file)
@@ -331,6 +331,14 @@ TEST(LibRGW, SETUP_DIRS1) {
            ASSERT_EQ(rc, 0);
            sf.sync();
            ASSERT_TRUE(sf.rgw_fh->is_file());
+
+           /* because we made it the hard way, fixup attributes */
+           struct stat st;
+           st.st_uid = owner_uid;
+           st.st_gid = owner_gid;
+           st.st_mode = 644;
+           sf.rgw_fh->create_stat(&st, create_mask);
+
            /* open handle */
            rc = rgw_open(fs, sf.fh, 0 /* flags */);
            ASSERT_EQ(rc, 0);