1 #include "test_rgw_common.h"
3 void test_rgw_add_placement(RGWZoneGroup *zonegroup, RGWZoneParams *zone_params, const std::string& name, bool is_default)
5 zonegroup->placement_targets[name] = { name };
7 RGWZonePlacementInfo& pinfo = zone_params->placement_pools[name];
8 pinfo.index_pool = rgw_pool(name + ".index").to_str();
9 pinfo.data_pool = rgw_pool(name + ".data").to_str();
10 pinfo.data_extra_pool = rgw_pool(name + ".extra").to_str();
13 zonegroup->default_placement = name;
17 void test_rgw_init_env(RGWZoneGroup *zonegroup, RGWZoneParams *zone_params)
19 test_rgw_add_placement(zonegroup, zone_params, "default-placement", true);
23 void test_rgw_populate_explicit_placement_bucket(rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id)
29 b->explicit_placement.data_pool = rgw_pool(dp);
30 b->explicit_placement.index_pool = rgw_pool(ip);
33 void test_rgw_populate_old_bucket(old_rgw_bucket *b, const char *t, const char *n, const char *dp, const char *ip, const char *m, const char *id)
43 std::string test_rgw_get_obj_oid(const rgw_obj& obj)
48 get_obj_bucket_and_oid_loc(obj, oid, loc);
52 void test_rgw_init_explicit_placement_bucket(rgw_bucket *bucket, const char *name)
54 test_rgw_populate_explicit_placement_bucket(bucket, "", name, ".data-pool", ".index-pool", "marker", "bucket-id");
57 void test_rgw_init_old_bucket(old_rgw_bucket *bucket, const char *name)
59 test_rgw_populate_old_bucket(bucket, "", name, ".data-pool", ".index-pool", "marker", "bucket-id");
62 void test_rgw_populate_bucket(rgw_bucket *b, const char *t, const char *n, const char *m, const char *id)
70 void test_rgw_init_bucket(rgw_bucket *bucket, const char *name)
72 test_rgw_populate_bucket(bucket, "", name, "marker", "bucket-id");
75 rgw_obj test_rgw_create_obj(const rgw_bucket& bucket, const std::string& name, const std::string& instance, const std::string& ns)
77 rgw_obj obj(bucket, name);
78 if (!instance.empty()) {
79 obj.key.set_instance(instance);