return clone_obj;
}
+ void rename(
+ SeaStoreShard &sharded_seastore,
+ object_state_t &other) {
+ CTransaction t;
+ t.collection_move_rename(cid, oid, cid, other.oid);
+ sharded_seastore.do_transaction(
+ coll,
+ std::move(t)).get0();
+ other.contents = contents;
+ other.omap = omap;
+ other.clone_contents = clone_contents;
+ }
+
void write(
SeaStoreShard &sharded_seastore,
uint64_t offset,
});
}
+TEST_P(seastore_test_t, rename)
+{
+ run_async([this] {
+ auto &test_obj = get_object(make_oid(0));
+ test_obj.write(*sharded_seastore, 0, 4096, 'a');
+ test_obj.set_omap(
+ *sharded_seastore,
+ "asdf",
+ make_bufferlist(128));
+ auto test_other = object_state_t{
+ test_obj.cid,
+ test_obj.coll,
+ ghobject_t(hobject_t(sobject_t(std::string("object_1"), CEPH_NOSNAP)))};
+ test_obj.rename(*sharded_seastore, test_other);
+ test_other.read(*sharded_seastore, 0, 4096);
+ test_other.check_omap(*sharded_seastore);
+ });
+}
+
TEST_P(seastore_test_t, clone_aligned_extents)
{
run_async([this] {