@@ -262,6 +262,19 @@ struct seastore_test_t :
262262 return clone_obj;
263263 }
264264
265+ void rename (
266+ SeaStoreShard &sharded_seastore,
267+ object_state_t &other) {
268+ CTransaction t;
269+ t.collection_move_rename (cid, oid, cid, other.oid );
270+ sharded_seastore.do_transaction (
271+ coll,
272+ std::move (t)).get0 ();
273+ other.contents = contents;
274+ other.omap = omap;
275+ other.clone_contents = clone_contents;
276+ }
277+
265278 void write (
266279 SeaStoreShard &sharded_seastore,
267280 uint64_t offset,
@@ -787,6 +800,25 @@ TEST_P(seastore_test_t, omap_test_simple)
787800 });
788801}
789802
803+ TEST_P (seastore_test_t , rename)
804+ {
805+ run_async ([this ] {
806+ auto &test_obj = get_object (make_oid (0 ));
807+ test_obj.write (*sharded_seastore, 0 , 4096 , ' a' );
808+ test_obj.set_omap (
809+ *sharded_seastore,
810+ " asdf" ,
811+ make_bufferlist (128 ));
812+ auto test_other = object_state_t {
813+ test_obj.cid ,
814+ test_obj.coll ,
815+ ghobject_t (hobject_t (sobject_t (std::string (" object_1" ), CEPH_NOSNAP)))};
816+ test_obj.rename (*sharded_seastore, test_other);
817+ test_other.read (*sharded_seastore, 0 , 4096 );
818+ test_other.check_omap (*sharded_seastore);
819+ });
820+ }
821+
790822TEST_P (seastore_test_t , clone_aligned_extents)
791823{
792824 run_async ([this ] {
0 commit comments