diff options
author | Matt Benjamin <mbenjamin@redhat.com> | 2016-03-23 22:29:30 +0100 |
---|---|---|
committer | Matt Benjamin <mbenjamin@redhat.com> | 2016-03-27 23:20:27 +0200 |
commit | 81792b36473fff3958a3c107a18dd12e0c52646b (patch) | |
tree | b19fc9a4c15bc86f3bf43337b509323b374a2001 /src/test/librgw_file_aw.cc | |
parent | Merge pull request #8299 from liewegas/wip-15230 (diff) | |
download | ceph-81792b36473fff3958a3c107a18dd12e0c52646b.tar.xz ceph-81792b36473fff3958a3c107a18dd12e0c52646b.zip |
rgw_file: set owner uid, gid, and Unix mode on new objects
Unix attributes aren't current materialized, but a future change
will serialize them in a new object attribute.
Also moves create and mkdir into operations on RGWLibFS, which
better encapsulates the behavior.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
Diffstat (limited to 'src/test/librgw_file_aw.cc')
-rw-r--r-- | src/test/librgw_file_aw.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/librgw_file_aw.cc b/src/test/librgw_file_aw.cc index 2ae73b88c93..cf6f536111a 100644 --- a/src/test/librgw_file_aw.cc +++ b/src/test/librgw_file_aw.cc @@ -37,6 +37,10 @@ namespace { string secret_key(""); struct rgw_fs *fs = nullptr; + uint32_t owner_uid = 867; + uint32_t owner_gid = 5309; + uint32_t create_mask = RGW_SETATTR_UID | RGW_SETATTR_GID | RGW_SETATTR_MODE; + bool do_create = false; bool do_delete = false; bool do_verify = false; @@ -179,8 +183,13 @@ TEST(LibRGW, CREATE_BUCKET) { if (do_create) { struct stat st; struct rgw_file_handle *fh; - int ret = rgw_mkdir(fs, fs->root_fh, bucket_name.c_str(), 755, &st, &fh, - RGW_MKDIR_FLAG_NONE); + + st.st_uid = owner_uid; + st.st_gid = owner_gid; + st.st_mode = 755; + + int ret = rgw_mkdir(fs, fs->root_fh, bucket_name.c_str(), &st, create_mask, + &fh, RGW_MKDIR_FLAG_NONE); ASSERT_EQ(ret, 0); } } |