Also adjust some unit test files to avoid trivial failures.
Fixes missing commit after rgw_write(), as well as conditional
cleanup.
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
#!/bin/sh -e
-export AWS_ACCESS_KEY_ID=`openssl rand -base64 20`
-export AWS_SECRET_ACCESS_KEY=`openssl rand -base64 40`
-radosgw-admin user create --uid ceph-test-librgw-file \
+if [ -z ${AWS_ACCESS_KEY_ID} ]
+then
+ export AWS_ACCESS_KEY_ID=`openssl rand -base64 20`
+ export AWS_SECRET_ACCESS_KEY=`openssl rand -base64 40`
+
+ radosgw-admin user create --uid ceph-test-librgw-file \
--access-key $AWS_ACCESS_KEY_ID \
--secret $AWS_SECRET_ACCESS_KEY \
--display-name "librgw test user" \
--email librgw@example.com || echo "librgw user exists"
+fi
+
+# nfsns is the main suite
+
+# create herarchy, and then list it
+echo "phase 1.1"
+ceph_test_librgw_file_nfsns --hier1 --dirs1 --create --rename --verbose
+
+# the older librgw_file can consume the namespace
+echo "phase 1.2"
+ceph_test_librgw_file_nfsns --getattr --verbose
+
+# and delete the hierarchy
+echo "phase 1.3"
+ceph_test_librgw_file_nfsns --hier1 --dirs1 --delete --verbose
+
+# bulk create/delete buckets
+echo "phase 2.1"
+ceph_test_librgw_file_cd --create --multi --verbose
+echo "phase 2.2"
+ceph_test_librgw_file_cd --delete --multi --verbose
+
+# write continuation test
+echo "phase 3.1"
+ceph_test_librgw_file_aw --create --delete --large --verify
+
+# continued readdir
+echo "phase 4.1"
+ceph_test_librgw_file_marker --create --marker1 --marker2 --nobjs=100 --verbose
-ceph_test_librgw_file
-ceph_test_librgw_file_aw
-ceph_test_librgw_file_cd
-ceph_test_librgw_file_gp
-ceph_test_librgw_file_marker
-ceph_test_librgw_file_nfsns
+# advanced i/o--but skip readv/writev for now--split delete from
+# create and stat ops to avoid fault in sysobject cache
+echo "phase 5.1"
+ceph_test_librgw_file_gp --get --stat --put --create
+echo "phase 5.2"
+ceph_test_librgw_file_gp --delete
exit 0
bool do_verify = false;
bool do_hexdump = false;
- string bucket_name = "sorry_dave";
+ string bucket_name = "sorrydave";
string object_name = "jocaml";
struct rgw_file_handle *bucket_fh = nullptr;
bool do_multi = false;
int multi_cnt = 10;
- string bucket_name = "sorry_dave";
+ string bucket_name = "sorrydave";
struct {
int argc;
bool do_readv = false;
bool do_verify = false;
bool do_get = false;
+ bool do_create = false;
bool do_delete = false;
bool do_stat = false; // stat objects (not buckets)
bool do_hexdump = false;
bool object_open = false;
- string bucket_name = "sorry_dave";
+ uint32_t owner_uid = 867;
+ uint32_t owner_gid = 5309;
+ uint32_t create_mask = RGW_SETATTR_UID | RGW_SETATTR_GID | RGW_SETATTR_MODE;
+
+ string bucket_name = "blastoff";
string object_name = "jocaml";
struct rgw_file_handle *bucket_fh = nullptr;
ASSERT_NE(fs, nullptr);
}
+TEST(LibRGW, CREATE_BUCKET) {
+ if (do_create) {
+ struct stat st;
+ struct rgw_file_handle *fh;
+
+ 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);
+ }
+}
+
TEST(LibRGW, LOOKUP_BUCKET) {
int ret = rgw_lookup(fs, fs->root_fh, bucket_name.c_str(), &bucket_fh,
nullptr, 0, RGW_LOOKUP_FLAG_NONE);
} else if (ceph_argparse_flag(args, arg_iter, "--prelist",
(char*) nullptr)) {
do_pre_list = true;
+ } else if (ceph_argparse_flag(args, arg_iter, "--create",
+ (char*) nullptr)) {
+ do_create = true;
} else if (ceph_argparse_flag(args, arg_iter, "--hexdump",
(char*) nullptr)) {
do_hexdump = true;
st.st_mode = 755;
for (int b_ix : {0, 1}) {
- std::string bname{"brename_" + to_string(b_ix)};
+ std::string bname{"brename" + to_string(b_ix)};
obj_rec brec{bname, nullptr, nullptr, nullptr};
(void) rgw_lookup(fs, fs->root_fh, brec.name.c_str(), &brec.fh,
nullptr, 0, RGW_LOOKUP_FLAG_NONE);