]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
test: Fix up librados/neorados tests
authorAlex Ainscow <aainscow@uk.ibm.com>
Mon, 24 Nov 2025 16:49:36 +0000 (16:49 +0000)
committerAlex Ainscow <aainscow@uk.ibm.com>
Wed, 18 Mar 2026 13:28:45 +0000 (13:28 +0000)
There much mocking of exec going on in these tests. An extensive
search and replace was required to find them all.

Note that the failure looks like memory corruption when manipulating
the ops array - but the actually issue is the mocking not intercepting
the exec_impl call (and similar) correctly.

Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
69 files changed:
src/test/cls_hello/test_cls_hello.cc
src/test/cls_numops/test_cls_numops.cc
src/test/cls_rbd/test_cls_rbd.cc
src/test/librados/aio_cxx.cc
src/test/librados/cls.cc
src/test/librados/misc_cxx.cc
src/test/librados_test_stub/LibradosTestStub.cc
src/test/librados_test_stub/MockTestMemIoCtxImpl.h
src/test/librados_test_stub/NeoradosTestStub.cc
src/test/librados_test_stub/TestIoCtxImpl.cc
src/test/librados_test_stub/TestIoCtxImpl.h
src/test/librbd/deep_copy/test_mock_MetadataCopyRequest.cc
src/test/librbd/deep_copy/test_mock_SetHeadRequest.cc
src/test/librbd/deep_copy/test_mock_SnapshotCreateRequest.cc
src/test/librbd/image/test_mock_AttachChildRequest.cc
src/test/librbd/image/test_mock_AttachParentRequest.cc
src/test/librbd/image/test_mock_CloneRequest.cc
src/test/librbd/image/test_mock_DetachChildRequest.cc
src/test/librbd/image/test_mock_DetachParentRequest.cc
src/test/librbd/image/test_mock_PreRemoveRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc
src/test/librbd/image/test_mock_RemoveRequest.cc
src/test/librbd/io/test_mock_CopyupRequest.cc
src/test/librbd/managed_lock/test_mock_AcquireRequest.cc
src/test/librbd/managed_lock/test_mock_BreakRequest.cc
src/test/librbd/managed_lock/test_mock_GetLockerRequest.cc
src/test/librbd/managed_lock/test_mock_ReacquireRequest.cc
src/test/librbd/managed_lock/test_mock_ReleaseRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreateNonPrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_ImageMeta.cc
src/test/librbd/mirror/snapshot/test_mock_UnlinkPeerRequest.cc
src/test/librbd/mirror/test_mock_DisableRequest.cc
src/test/librbd/object_map/test_mock_DiffRequest.cc
src/test/librbd/object_map/test_mock_InvalidateRequest.cc
src/test/librbd/object_map/test_mock_LockRequest.cc
src/test/librbd/object_map/test_mock_RefreshRequest.cc
src/test/librbd/object_map/test_mock_ResizeRequest.cc
src/test/librbd/object_map/test_mock_SnapshotCreateRequest.cc
src/test/librbd/object_map/test_mock_SnapshotRemoveRequest.cc
src/test/librbd/object_map/test_mock_SnapshotRollbackRequest.cc
src/test/librbd/object_map/test_mock_UnlockRequest.cc
src/test/librbd/object_map/test_mock_UpdateRequest.cc
src/test/librbd/operation/test_mock_ResizeRequest.cc
src/test/librbd/operation/test_mock_SnapshotCreateRequest.cc
src/test/librbd/operation/test_mock_SnapshotProtectRequest.cc
src/test/librbd/operation/test_mock_SnapshotRemoveRequest.cc
src/test/librbd/operation/test_mock_SnapshotUnprotectRequest.cc
src/test/librbd/test_mock_fixture.cc
src/test/librbd/trash/test_mock_MoveRequest.cc
src/test/librbd/trash/test_mock_RemoveRequest.cc
src/test/neorados/cls.cc
src/test/neorados/handler_error.cc
src/test/neorados/misc.cc
src/test/neorados/read_operations.cc
src/test/neorados/write_operations.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashMoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashRemoveRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_ApplyImageStateRequest.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_CreateLocalImageRequest.cc
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/test/rbd_mirror/image_replayer/test_mock_CreateImageRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_GetMirrorImageIdRequest.cc
src/test/rbd_mirror/image_replayer/test_mock_PrepareLocalImageRequest.cc
src/test/rbd_mirror/pool_watcher/test_mock_RefreshImagesRequest.cc
src/test/rbd_mirror/test_mock_InstanceWatcher.cc
src/test/rbd_mirror/test_mock_MirrorStatusUpdater.cc
src/test/rbd_mirror/test_mock_PoolReplayer.cc

index 667b67ee8f9f7e9498a3050cc32d2cc3abf53ed5..7e94ead180f1b348abd33843bca7df9b9b7bc946 100644 (file)
@@ -63,13 +63,38 @@ TEST(ClsHello, RecordHello) {
   cluster.ioctx_create(pool_name.c_str(), ioctx);
 
   bufferlist in, out;
-  ASSERT_EQ(0, ioctx.exec("myobject", method::record_hello, in, out));
-  ASSERT_EQ(-EEXIST, ioctx.exec("myobject", method::record_hello, in, out));
+  {
+    ObjectWriteOperation write_operation;
+    int rval;
+    write_operation.exec(method::record_hello, in, &out, &rval);
+    ASSERT_EQ(0, ioctx.operate("myobject", &write_operation));
+    ASSERT_EQ(0, rval);
+  }
+  {
+    ObjectWriteOperation write_operation;
+    int rval;
+    write_operation.exec(method::record_hello, in, &out, &rval);
+    ASSERT_EQ(-EEXIST, ioctx.operate("myobject", &write_operation));
+    ASSERT_EQ(-EEXIST, rval);
+  }
 
   in.append("Tester");
-  ASSERT_EQ(0, ioctx.exec("myobject2", method::record_hello, in, out));
-  ASSERT_EQ(-EEXIST, ioctx.exec("myobject2", method::record_hello, in, out));
-  ASSERT_EQ(0u, out.length());
+  {
+    ObjectWriteOperation write_operation;
+    int rval;
+    write_operation.exec(method::record_hello, in, &out, &rval);
+    ASSERT_EQ(0, ioctx.operate("myobject2", &write_operation));
+    ASSERT_EQ(0, rval);
+  }
+
+  {
+    ObjectWriteOperation write_operation;
+    int rval;
+    write_operation.exec(method::record_hello, in, &out, &rval);
+    ASSERT_EQ(-EEXIST, ioctx.operate("myobject2", &write_operation));
+    ASSERT_EQ(-EEXIST, rval);
+    ASSERT_EQ(0u, out.length());
+  }
 
   in.clear();
   out.clear();
@@ -122,7 +147,11 @@ TEST(ClsHello, WriteReturnData) {
 
   // this will return nothing -- no flag is set
   bufferlist in, out;
-  ASSERT_EQ(0, ioctx.exec("myobject", method::write_return_data, in, out));
+  ObjectWriteOperation write_operation;
+  int rval;
+  write_operation.exec(method::write_return_data, in, &out, &rval);
+  ASSERT_EQ(0, ioctx.operate("myobject", &write_operation));
+  ASSERT_EQ(42, rval); // Returned by method.
   ASSERT_EQ(std::string(), std::string(out.c_str(), out.length()));
 
   // this will return an error due to unexpected input.
@@ -206,11 +235,20 @@ TEST(ClsHello, Loud) {
   cluster.ioctx_create(pool_name.c_str(), ioctx);
 
   bufferlist in, out;
-  ASSERT_EQ(0, ioctx.exec("myobject", method::record_hello, in, out));
+  int rval;
+  {
+    ObjectWriteOperation write_operation;
+    write_operation.exec(method::record_hello, in, &out, &rval);
+    ASSERT_EQ(0, ioctx.operate("myobject", &write_operation));
+  }
   ASSERT_EQ(0, ioctx.exec("myobject", method::replay, in, out));
   ASSERT_EQ(std::string("Hello, world!"), std::string(out.c_str(), out.length()));
 
-  ASSERT_EQ(0, ioctx.exec("myobject", method::turn_it_to_11, in, out));
+  {
+    ObjectWriteOperation write_operation;
+    write_operation.exec(method::turn_it_to_11, in, &out, &rval);
+    ASSERT_EQ(0, ioctx.operate("myobject", &write_operation));
+  }
   ASSERT_EQ(0, ioctx.exec("myobject", method::replay, in, out));
   ASSERT_EQ(std::string("HELLO, WORLD!"), std::string(out.c_str(), out.length()));
 
@@ -227,7 +265,10 @@ TEST(ClsHello, BadMethods) {
   bufferlist in, out;
 
   ASSERT_EQ(0, ioctx.write_full("myobject", in));
-  ASSERT_EQ(-EIO, ioctx.exec("myobject", method::bad_reader, in, out));
+  ObjectWriteOperation write_operation;
+  int rval;
+  write_operation.exec(method::bad_reader, in, &out, &rval);
+  ASSERT_EQ(-EIO, ioctx.operate("myobject", &write_operation));
   ASSERT_EQ(-EIO, ioctx.exec("myobject", method::bad_writer, in, out));
 
   ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
index 09848ecd40a5c8e6c966e9bd2c1302ecd9f08fe6..241d4cd1e50efc7244f567d7ab4354fe5b2d11d2 100644 (file)
@@ -37,7 +37,10 @@ TEST(ClsNumOps, Add) {
 
   bufferlist in, out;
 
-  ASSERT_EQ(-EINVAL, ioctx.exec("myobject", method::add, in, out));
+  int rval;
+  ObjectWriteOperation write_operation;
+  write_operation.exec(method::add, in, &out, &rval);
+  ASSERT_EQ(-EINVAL, ioctx.operate("myobject", &write_operation));
 
   // add a number to a non-existing key
 
@@ -221,7 +224,10 @@ TEST(ClsNumOps, Mul) {
 
   bufferlist in, out;
 
-  ASSERT_EQ(-EINVAL, ioctx.exec("myobject", method::mul, in, out));
+  int rval;
+  ObjectWriteOperation write_operation;
+  write_operation.exec(method::mul, in, &out, &rval);
+  ASSERT_EQ(-EINVAL, ioctx.operate("myobject", &write_operation));
 
   // multiply a number to a non-existing key
 
index b77c5dde3ea627360a2d132f10d842058ce6f6d6..c478b2d3674c3c2316813da92203c59c0e025172 100644 (file)
@@ -478,7 +478,10 @@ TEST_F(TestClsRbd, create)
                                   123));
 
   bufferlist inbl, outbl;
-  ASSERT_EQ(-EINVAL, ioctx.exec(oid, cls::rbd::method::create, inbl, outbl));
+  int rval;
+  librados::ObjectWriteOperation write_operation;
+  write_operation.exec(cls::rbd::method::create, inbl, &outbl, &rval);
+  ASSERT_EQ(-EINVAL, ioctx.operate("myobject", &write_operation));
 
   ioctx.close();
 }
index 79b01e7d54b5cc6c044a6cddd44d183e5e39d6a8..179098c509e044597089eede0fcb269ac1edf5ce 100644 (file)
@@ -25,6 +25,8 @@
 #include "test_cxx.h"
 #include "crimson_utils.h"
 
+#include "cls/hello/cls_hello_ops.h"
+
 using namespace std;
 using namespace librados;
 
@@ -1061,7 +1063,7 @@ TEST(LibRadosAio, ExecuteClassPP) {
   ASSERT_TRUE(my_completion2);
   bufferlist in, out;
   ASSERT_EQ(0, test_data.m_ioctx.aio_exec(test_data.m_oid, my_completion2.get(),
-                                         "hello", "say_hello", in, &out));
+                                         cls::hello::method::say_hello, in, &out));
   {
     TestAlarm alarm;
     ASSERT_EQ(0, my_completion2->wait_for_complete());
@@ -2080,7 +2082,7 @@ TEST(LibRadosAioEC, ExecuteClassPP) {
   ASSERT_TRUE(my_completion2);
   bufferlist in, out;
   ASSERT_EQ(0, test_data.m_ioctx.aio_exec(test_data.m_oid, my_completion2.get(),
-                                         "hello", "say_hello", in, &out));
+                                         cls::hello::method::say_hello, in, &out));
   {
     TestAlarm alarm;
     ASSERT_EQ(0, my_completion2->wait_for_complete());
index c4f24954dbe1196a5d98c16fa60324f63271dffc..e24ff46f3145d08c6a9ff823d49638b6bfeda1dc 100644 (file)
@@ -13,6 +13,23 @@ using std::map;
 using std::ostringstream;
 using std::string;
 
+namespace cls::bogus_classes {
+struct ClassId {
+  static constexpr auto name = "doesnotexistasdfasdf";
+};
+struct ClassIdLock { // This is a real class. We are adding a bogus method.
+  static constexpr auto name = "doesnotexistasdfasdf";
+};
+namespace method {
+constexpr auto bogus_class = ClsMethod<RdTag, ClassId>("method");
+constexpr auto bogus_method = ClsMethod<RdTag, ClassIdLock>("doesnotexistasdfasdfasdf");
+}
+}
+
+using namespace cls::bogus_classes;
+
+// Ignore use of legacy interface, which allows specifying cls methods which do
+// not exist.
 TEST(LibRadosCls, DNE) {
   Rados cluster;
   std::string pool_name = get_temp_pool_name();
@@ -26,11 +43,11 @@ TEST(LibRadosCls, DNE) {
   ASSERT_EQ(0, ioctx.write(oid, bl, bl.length(), 0));
 
   // call a bogus class
-  ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, "doesnotexistasdfasdf", "method", bl, bl));
+  ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, method::bogus_class, bl, bl));
 
   // call a bogus method on existent class
-  ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, "lock", "doesnotexistasdfasdfasdf", bl, bl));
+  ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, method::bogus_method, bl, bl));
 
   ioctx.close();
   ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
-}
+}
\ No newline at end of file
index aa0db24a5dceefae95d30f05bcecfdd14c3cb0e9..753e6762f6ddbfd3796e47250e5171e69c407ee8 100644 (file)
@@ -22,6 +22,8 @@
 #include "global/global_context.h"
 #include "test/librados/testcase_cxx.h"
 #include "test/librados/test_cxx.h"
+#include "cls/version/cls_version_ops.h"
+#include "cls/rbd/cls_rbd_types.h"
 
 #include "crimson_utils.h"
 
@@ -149,7 +151,7 @@ TEST_F(LibRadosMiscPP, ExecPP) {
   bufferlist bl;
   ASSERT_EQ(0, ioctx.write("foo", bl, 0, 0));
   bufferlist bl2, out;
-  int r = ioctx.exec("foo", "rbd", "get_all_features", bl2, out);
+  int r = ioctx.exec("foo", cls::rbd::method::get_all_features, bl2, out);
   ASSERT_EQ(0, r);
   auto iter = out.cbegin();
   uint64_t all_features;
index 18c2a61989628f5754dd14e360eb5b342d108d2a..af0c407cce97c11de31493af128f39410b9417d7 100644 (file)
@@ -525,11 +525,11 @@ void IoCtx::dup(const IoCtx& rhs) {
   io_ctx_impl = reinterpret_cast<IoCtxImpl*>(ctx->clone());
 }
 
-int IoCtx::exec(const std::string& oid, const char *cls, const char *method,
+int IoCtx::exec_impl(const std::string& oid, const char *cls, const char *method,
                 bufferlist& inbl, bufferlist& outbl) {
   TestIoCtxImpl *ctx = reinterpret_cast<TestIoCtxImpl*>(io_ctx_impl);
   return ctx->execute_operation(
-    oid, std::bind(&TestIoCtxImpl::exec, _1, _2,
+    oid, std::bind(&TestIoCtxImpl::exec_internal, _1, _2,
                      librados_test_stub::get_class_handler(), cls,
                      method, inbl, &outbl, ctx->get_snap_read(),
                      ctx->get_snap_context()));
@@ -836,10 +836,10 @@ void ObjectOperation::assert_version(uint64_t ver) {
   o->ops.push_back(std::bind(&TestIoCtxImpl::assert_version, _1, _2, ver));
 }
 
-void ObjectOperation::exec(const char *cls, const char *method,
+void ObjectOperation::exec_impl(const char *cls, const char *method,
                            bufferlist& inbl) {
   TestObjectOperationImpl *o = reinterpret_cast<TestObjectOperationImpl*>(impl);
-  o->ops.push_back(std::bind(&TestIoCtxImpl::exec, _1, _2,
+  o->ops.push_back(std::bind(&TestIoCtxImpl::exec_internal, _1, _2,
                               librados_test_stub::get_class_handler(), cls,
                               method, inbl, _3, _4, _5));
 }
@@ -1521,7 +1521,7 @@ int cls_register(const char *name, cls_handle_t *handle) {
   return cls->create(name, handle);
 }
 
-int cls_register_cxx_method(cls_handle_t hclass, const char *method,
+int detail::cls_register_cxx_method_impl(cls_handle_t hclass, const char *method,
     int flags,
     cls_method_cxx_call_t class_call,
     cls_method_handle_t *handle) {
index 2f90297e40aa0dfe0873477a32373e012172e8dc..20fcfe8e8ab9cc98bd3469e95265fb888e4ddad2 100644 (file)
@@ -88,7 +88,7 @@ public:
     return TestMemIoCtxImpl::cmpext(oid, off, cmp_bl, snap_id);
   }
 
-  MOCK_METHOD8(exec, int(const std::string& oid,
+  MOCK_METHOD8(exec_internal, int(const std::string& oid,
                          TestClassHandler *handler,
                          const char *cls,
                          const char *method,
@@ -99,7 +99,7 @@ public:
   int do_exec(const std::string& oid, TestClassHandler *handler,
               const char *cls, const char *method, bufferlist& inbl,
               bufferlist* outbl, uint64_t snap_id, const SnapContext &snapc) {
-    return TestMemIoCtxImpl::exec(oid, handler, cls, method, inbl, outbl,
+    return TestMemIoCtxImpl::exec_internal(oid, handler, cls, method, inbl, outbl,
                                   snap_id, snapc);
   }
 
@@ -223,7 +223,7 @@ public:
     ON_CALL(*this, assert_version(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_assert_version));
     ON_CALL(*this, create(_, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_create));
     ON_CALL(*this, cmpext(_, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_cmpext));
-    ON_CALL(*this, exec(_, _, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec));
+    ON_CALL(*this, exec_internal(_, _, _, _, _, _, _, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_exec));
     ON_CALL(*this, get_instance_id()).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_get_instance_id));
     ON_CALL(*this, list_snaps(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_snaps));
     ON_CALL(*this, list_watchers(_, _)).WillByDefault(Invoke(this, &MockTestMemIoCtxImpl::do_list_watchers));
index 3b7f65b25ed1639c629f5ac5cea83c2026989065..bc8e711a2789e9152bff91e20fad5063b62c51fa 100644 (file)
@@ -375,7 +375,7 @@ void Op::localize_reads() {
   // no-op
 }
 
-void Op::exec(std::string_view cls, std::string_view method,
+void Op::exec_impl(std::string_view cls, std::string_view method,
               const ceph::buffer::list& inbl,
               ceph::buffer::list* out,
               boost::system::error_code* ec) {
@@ -386,7 +386,7 @@ void Op::exec(std::string_view cls, std::string_view method,
     [cls_handler, cls, method, inbl = const_cast<bufferlist&>(inbl), out]
     (librados::TestIoCtxImpl* io_ctx, const std::string& oid, bufferlist* outbl,
      uint64_t snap_id, const SnapContext& snapc, uint64_t*) mutable -> int {
-      return io_ctx->exec(
+      return io_ctx->exec_internal(
         oid, cls_handler, std::string(cls).c_str(),
         std::string(method).c_str(), inbl,
         (out != nullptr ? out : outbl), snap_id, snapc);
@@ -398,7 +398,7 @@ void Op::exec(std::string_view cls, std::string_view method,
   o->ops.push_back(op);
 }
 
-void Op::exec(std::string_view cls, std::string_view method,
+void Op::exec_impl(std::string_view cls, std::string_view method,
               const ceph::buffer::list& inbl,
               boost::system::error_code* ec) {
   auto o = *reinterpret_cast<librados::TestObjectOperationImpl**>(&impl);
@@ -408,7 +408,7 @@ void Op::exec(std::string_view cls, std::string_view method,
     [cls_handler, cls, method, inbl = const_cast<bufferlist&>(inbl)]
     (librados::TestIoCtxImpl* io_ctx, const std::string& oid, bufferlist* outbl,
      uint64_t snap_id, const SnapContext& snapc, uint64_t*) mutable -> int {
-      return io_ctx->exec(
+      return io_ctx->exec_internal(
         oid, cls_handler, std::string(cls).c_str(),
         std::string(method).c_str(), inbl, outbl, snap_id, snapc);
     };
index 55694ec946290f6dd82c8c01e09aad03551a569a..94a3db8b3265d43b334f1516c17c9df8531f62c7 100644 (file)
@@ -160,7 +160,7 @@ int TestIoCtxImpl::aio_unwatch(uint64_t handle, AioCompletionImpl *c) {
   return 0;
 }
 
-int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler,
+int TestIoCtxImpl::exec_internal(const std::string& oid, TestClassHandler *handler,
                         const char *cls, const char *method,
                         bufferlist& inbl, bufferlist* outbl,
                         uint64_t snap_id, const SnapContext &snapc) {
index d15289b8185fb2eebf2fabbade9d2dfe403b5426..70d60e21847ee86f1df0dd87a53aba4d3e7c52e9 100644 (file)
@@ -105,7 +105,7 @@ public:
 
   virtual int create(const std::string& oid, bool exclusive,
                      const SnapContext &snapc) = 0;
-  virtual int exec(const std::string& oid, TestClassHandler *handler,
+  virtual int exec_internal(const std::string& oid, TestClassHandler *handler,
                    const char *cls, const char *method,
                    bufferlist& inbl, bufferlist* outbl,
                    uint64_t snap_id, const SnapContext &snapc);
index 6e475f07f19f75e2d3da99cd1010663248cbb194..991c41f8c99b053bdd23438594840332bd1991df 100644 (file)
@@ -114,7 +114,7 @@ public:
     encode(metadata, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("metadata_set"), ContentsEqual(in_bl), _, _, _))
                   .WillOnce(Return(r));
   }
index 6852cbb2e5ef2f08f6971750cc5c7d53e9efbd36..2afce43e82b5341e8c063e4406136e941bea15a0 100644 (file)
@@ -124,7 +124,7 @@ public:
 
   void expect_set_size(librbd::MockTestImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("set_size"), _, _, _, _))
                   .WillOnce(Return(r));
   }
index 08ef52b905a14590e8108dfb776329a305cc6922..dc51c5d7385ca952d43b84cdad551ffa10a79839 100644 (file)
@@ -127,7 +127,7 @@ public:
     std::string oid(librbd::ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                          snap_id));
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _,
+                exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _, _,
                      _))
                   .WillOnce(Return(r));
   }
index fc80a02755c5b7bfcf565ac10c53af570ea46f65..91a727d255bdd7e5d694532505b5195fad2addfa 100644 (file)
@@ -92,7 +92,7 @@ public:
 
   void expect_add_child(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("add_child"), _, _, _,
+                exec_internal(RBD_CHILDREN, _, StrEq("rbd"), StrEq("add_child"), _, _, _,
                      _))
       .WillOnce(Return(r));
   }
@@ -119,7 +119,7 @@ public:
     encode(static_cast<uint64_t>(RBD_OPERATION_FEATURE_CLONE_CHILD), bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(util::header_name(mock_image_ctx.id), _, StrEq("rbd"),
+                exec_internal(util::header_name(mock_image_ctx.id), _, StrEq("rbd"),
                      StrEq("op_features_set"), ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
   }
@@ -131,7 +131,7 @@ public:
            bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("child_attach"), ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
   }
index b6dc7d35826536a2c218031e997cd3621f691d02..9633bae97047c1e1fe2f4037385fc7f7c70d6826 100644 (file)
@@ -44,14 +44,14 @@ public:
 
   void expect_parent_attach(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("parent_attach"), _, _, _, _))
       .WillOnce(Return(r));
   }
 
   void expect_set_parent(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("set_parent"), _, _, _, _))
       .WillOnce(Return(r));
   }
index 968b9f7e1430487de90bab356aae59e3c5eea568..44446f6f83f0a0f274f4575a2d777b35bee70c4d 100644 (file)
@@ -328,7 +328,7 @@ public:
     encode(static_cast<uint32_t>(mirror_mode), out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"),
                      _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([out_bl, r](bufferlist* out) {
                              *out = out_bl;
index 70448176b54281400a8692c8b868026c262fee04..790f3016c5eec7743f7e9a95ad3fbbe3c767b5af 100644 (file)
@@ -128,7 +128,7 @@ public:
                                     mock_image_ctx.id}, bl);
 
     EXPECT_CALL(mock_io_ctx_impl,
-                exec(util::header_name(parent_spec.image_id),
+                exec_internal(util::header_name(parent_spec.image_id),
                      _, StrEq("rbd"), StrEq("child_detach"), ContentsEqual(bl),
                      _, _, _))
       .WillOnce(Return(r));
@@ -136,7 +136,7 @@ public:
 
   void expect_remove_child(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_CHILDREN, _, StrEq("rbd"), StrEq("remove_child"), _,
+                exec_internal(RBD_CHILDREN, _, StrEq("rbd"), StrEq("remove_child"), _,
                      _, _, _))
       .WillOnce(Return(r));
   }
@@ -148,7 +148,7 @@ public:
 
     using ceph::encode;
     EXPECT_CALL(mock_io_ctx_impl,
-                exec(parent_header_name, _, StrEq("rbd"),
+                exec_internal(parent_header_name, _, StrEq("rbd"),
                      StrEq("snapshot_get"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([snap_info, r](bufferlist* bl) {
                              encode(snap_info, *bl);
@@ -192,7 +192,7 @@ public:
                         int r) {
     using ceph::encode;
     EXPECT_CALL(mock_io_ctx_impl,
-                exec(RBD_TRASH, _, StrEq("rbd"),
+                exec_internal(RBD_TRASH, _, StrEq("rbd"),
                      StrEq("trash_get"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([trash_spec, r](bufferlist* bl) {
                              encode(trash_spec, *bl);
index 792327f11f9e447d517924786cdc8c393e5b8304..cd35fd943c6a5fe9be06f93cb92f2dd924d5364a 100644 (file)
@@ -44,14 +44,14 @@ public:
 
   void expect_parent_detach(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("parent_detach"), _, _, _, _))
       .WillOnce(Return(r));
   }
 
   void expect_remove_parent(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("remove_parent"), _, _, _, _))
       .WillOnce(Return(r));
   }
index b297ed1d932a494ceeac6cca84b0da4da6e46a8a..626799c452050a6af7f6c38d2af161b2ab1a6e45 100644 (file)
@@ -193,7 +193,7 @@ public:
     }
 
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("image_group_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
index 01d21edc083053af2dee0722c2efd7a9e5366a0a..1c187ca8b65a24fe46dcc5f858ef4e0a842ba0d9 100644 (file)
@@ -184,7 +184,7 @@ public:
 
   void expect_v1_get_snapshots(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("snap_list"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -195,7 +195,7 @@ public:
 
   void expect_v1_get_locks(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                                     StrEq("get_info"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -207,7 +207,7 @@ public:
   void expect_get_mutable_metadata(MockRefreshImageCtx &mock_image_ctx,
                                    uint64_t features, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("get_size"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -218,7 +218,7 @@ public:
 
       expect.WillOnce(DoDefault());
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_features"), _, _, _, _))
                     .WillOnce(WithArg<5>(Invoke([features, incompatible](bufferlist* out_bl) {
                                            encode(features, *out_bl);
@@ -227,11 +227,11 @@ public:
                                          })));
       expect_get_flags(mock_image_ctx, 0);
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_snapcontext"), _, _, _, _))
                     .WillOnce(DoDefault());
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                        StrEq("get_info"), _, _, _, _))
                     .WillOnce(DoDefault());
     }
@@ -239,7 +239,7 @@ public:
 
   void expect_parent_overlap_get(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("parent_overlap_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -250,7 +250,7 @@ public:
 
   void expect_get_parent(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("parent_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -262,7 +262,7 @@ public:
 
   void expect_get_parent_legacy(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto& expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("get_parent"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -273,7 +273,7 @@ public:
 
   void expect_get_migration_header(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("migration_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -297,7 +297,7 @@ public:
 
   void expect_get_flags(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("get_flags"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -309,7 +309,7 @@ public:
   void expect_get_op_features(MockRefreshImageCtx &mock_image_ctx,
                               uint64_t op_features, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("op_features_get"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([op_features, r](bufferlist* out_bl) {
                              encode(op_features, *out_bl);
@@ -319,7 +319,7 @@ public:
 
   void expect_get_group(MockRefreshImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("image_group_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -331,7 +331,7 @@ public:
   void expect_get_snapshots(MockRefreshImageCtx &mock_image_ctx,
                             bool legacy_parent, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("snapshot_get"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -339,7 +339,7 @@ public:
       expect.WillOnce(DoDefault());
       if (legacy_parent) {
         EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                    exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                    exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                          StrEq("get_parent"), _, _, _, _))
                       .WillOnce(DoDefault());
       } else {
@@ -347,7 +347,7 @@ public:
       }
       expect_get_flags(mock_image_ctx, 0);
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_protection_status"), _, _, _, _))
                     .WillOnce(DoDefault());
     }
@@ -356,29 +356,29 @@ public:
   void expect_get_snapshots_legacy(MockRefreshImageCtx &mock_image_ctx,
                                    bool include_timestamp, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("get_snapshot_name"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
     } else {
       expect.WillOnce(DoDefault());
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_size"), _, _, _, _))
                     .WillOnce(DoDefault());
       if (include_timestamp) {
         EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                    exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                    exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                          StrEq("get_snapshot_timestamp"), _, _, _, _))
                       .WillOnce(DoDefault());
       }
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_parent"), _, _, _, _))
                     .WillOnce(DoDefault());
       expect_get_flags(mock_image_ctx, 0);
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("get_protection_status"), _, _, _, _))
                     .WillOnce(DoDefault());
     }
index d006a029a3444400b0402fb685ed11c67c21df5b..3fa65bacab8fccb3211e09c19186363161e16ba3 100644 (file)
@@ -287,14 +287,14 @@ public:
 
   void expect_remove_mirror_image(librados::IoCtx &ioctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(ioctx),
-                exec(StrEq("rbd_mirroring"), _, StrEq("rbd"),
+                exec_internal(StrEq("rbd_mirroring"), _, StrEq("rbd"),
                      StrEq("mirror_image_remove"), _, _, _, _))
       .WillOnce(Return(r));
   }
 
   void expect_dir_remove_image(librados::IoCtx &ioctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(ioctx),
-                exec(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_remove_image"),
+                exec_internal(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_remove_image"),
                      _, _, _, _))
       .WillOnce(Return(r));
   }
index 96f3c3e72a39509780bc292cd4bfd6ba4bdcc739..e312d1a6b7e4bf9fbd87ad72f4415244d7e5c83d 100644 (file)
@@ -245,7 +245,7 @@ struct TestMockIoCopyupRequest : public TestMockFixture {
     auto& mock_io_ctx = librados::get_mock_io_ctx(
       mock_image_ctx.rados_api, *mock_image_ctx.get_data_io_context());
     EXPECT_CALL(mock_io_ctx,
-                exec(oid, _, StrEq("rbd"), StrEq("copyup"),
+                exec_internal(oid, _, StrEq("rbd"), StrEq("copyup"),
                      ContentsEqual(in_bl), _, _, snapc))
       .WillOnce(Return(r));
   }
@@ -269,7 +269,7 @@ struct TestMockIoCopyupRequest : public TestMockFixture {
     auto& mock_io_ctx = librados::get_mock_io_ctx(
       mock_image_ctx.rados_api, *mock_image_ctx.get_data_io_context());
     EXPECT_CALL(mock_io_ctx,
-                exec(oid, _, StrEq("rbd"), StrEq("sparse_copyup"),
+                exec_internal(oid, _, StrEq("rbd"), StrEq("sparse_copyup"),
                      ContentsEqual(in_bl), _, _, snapc))
       .WillOnce(Return(r));
   }
index 4f7bb5602034b76dcd203f08d5f27ff788a2e448..80433cec077931d956a87a220d814f76c4fe8d81 100644 (file)
@@ -119,7 +119,7 @@ public:
   void expect_lock(MockImageCtx &mock_image_ctx, int r,
                              bool exclusive = true) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                      StrEq("lock"), IsLockType(exclusive), _, _, _))
                   .WillOnce(Return(r));
   }
index 0a95fa030c1c43ae95b0e98937c8cdc9d27f657d..2b727f0d90fbe80fda981642b685c96b25e2a7a1 100644 (file)
@@ -120,7 +120,7 @@ public:
 
   void expect_break_lock(MockTestImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                      StrEq("break_lock"), _, _, _, _))
                   .WillOnce(Return(r));
   }
index ad2c576319cd732aaed6ec1acef38aff5abb4a36..cb22f55f236c65634ae2125e2e79cb5f3e89fd9c 100644 (file)
@@ -51,7 +51,7 @@ public:
                             const std::string &lock_tag,
                             ClsLockType lock_type) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                                StrEq("get_info"), _, _, _, _));
     if (r < 0 && r != -ENOENT) {
       expect.WillOnce(Return(r));
index 9202bdcdf7c360414b8c51259e7183dcede928d6..138ffe0ed273c20ac373ae597da9aa5e005db205 100644 (file)
@@ -45,7 +45,7 @@ public:
   void expect_set_cookie(MockImageCtx &mock_image_ctx, int r,
                          bool exclusive = true) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                      StrEq("set_cookie"), IsLockType(exclusive), _, _, _))
                   .WillOnce(Return(r));
   }
index 73eeea06c4270fb48d746a63aa52834eb57c2292..e8511ab7b8016114aa400d8ca2cb56b7289ebe55 100644 (file)
@@ -40,7 +40,7 @@ public:
 
   void expect_unlock(MockImageCtx &mock_image_ctx, int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("lock"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("lock"),
                      StrEq("unlock"), _, _, _, _))
                         .WillOnce(Return(r));
   }
index 59b1e9e6fd33ebe55e577469e38beb4464772476..66fcce6824f227d1b28e31940d1872e3b0d754aa 100644 (file)
@@ -128,7 +128,7 @@ public:
     encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)),
                       Return(r)));
@@ -148,7 +148,7 @@ public:
     encode(peers, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)),
                       Return(r)));
index 20a6679276d1e88881ba0d713dc3fd3ad9078476..41f034dbfd0a9a68fdfb83a8f52eabe8be00f136 100644 (file)
@@ -142,7 +142,7 @@ public:
     encode(peers, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_peer_list"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)),
                       Return(r)));
index 71288106d2eadc437ced486e5e45be5df584ced7..b125065d09aac9fe4147fc0f33d926ca012ba49e 100644 (file)
@@ -48,7 +48,7 @@ public:
     ceph::encode(value, out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("metadata_get"), ContentsEqual(in_bl), _, _, _))
       .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(out_bl)),
                       Return(r)));
@@ -67,7 +67,7 @@ public:
       in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("metadata_set"), ContentsEqual(in_bl), _, _, _))
       .WillOnce(Return(r));
   }
index 4626580c4635fed88dd255dfbd8bed44c28050ba..9402400c5b333834808bbcdf8d80f7e8dc0559bd 100644 (file)
@@ -83,7 +83,7 @@ public:
     encode(peer_uuid, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("mirror_image_snapshot_unlink_peer"),
                      ContentsEqual(bl), _, _, _))
       .WillOnce(Invoke([&mock_image_ctx, snap_id, peer_uuid, r](auto&&... args) -> int {
index a3f2cf453361fa9624aff80f0ecbf565cb360a22..d0891e29526a445c2192a53f75d3ee61d6d6dd93 100644 (file)
@@ -227,7 +227,7 @@ public:
     encode(clients, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(::journal::Journaler::header_oid(mock_image_ctx.id),
+                exec_internal(::journal::Journaler::header_oid(mock_image_ctx.id),
                      _, StrEq("journal"), StrEq("client_list"), _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(CopyInBufferlist(bl)),
                       Return(r)));
@@ -241,7 +241,7 @@ public:
     encode(client_id, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(::journal::Journaler::header_oid(mock_image_ctx.id),
+                exec_internal(::journal::Journaler::header_oid(mock_image_ctx.id),
                      _, StrEq("journal"), StrEq("client_unregister"),
                      ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
index d73eff19a361c5abc4efd5358b90eb77b8fb6225..0f478ffbc8ae7f6cb8eb8cfd86c3e0df1b02022b 100644 (file)
@@ -190,7 +190,7 @@ public:
     std::string snap_oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                       snap_id));
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
+                exec_internal(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
                      _, _, _))
       .WillOnce(WithArg<5>(Invoke([object_map, r, lambda=std::move(lambda)]
                                   (bufferlist* out_bl) {
index f973604a62d89f1c36d54344eecc253bee98b7bc..98961cd319fa5171bc8036c98550b3311bbd7c14 100644 (file)
@@ -38,7 +38,7 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesInMemoryFlag) {
   AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, true, &cond_ctx);
 
   EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-              exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
+              exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
                    _, _))
                 .WillOnce(DoDefault());
 
@@ -65,7 +65,7 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesHeadOnDiskFlag) {
   AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx);
 
   EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-              exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
+              exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
                    _, _))
                 .WillOnce(DoDefault());
 
@@ -95,7 +95,7 @@ TEST_F(TestMockObjectMapInvalidateRequest, UpdatesSnapOnDiskFlag) {
                                                 &cond_ctx);
 
   EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-              exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
+              exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
                    _, _))
                 .WillOnce(DoDefault());
 
@@ -117,7 +117,7 @@ TEST_F(TestMockObjectMapInvalidateRequest, ErrorOnDiskUpdateWithoutLock) {
   AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx);
 
   EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-              exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
+              exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
                    _, _))
                 .Times(0);
 
@@ -142,7 +142,7 @@ TEST_F(TestMockObjectMapInvalidateRequest, ErrorOnDiskUpdateFailure) {
   AsyncRequest<> *request = new InvalidateRequest<>(*ictx, CEPH_NOSNAP, false, &cond_ctx);
 
   EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-              exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
+              exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _, _,
                    _, _))
                 .WillOnce(Return(-EINVAL));
 
index bc1a1071c7a5306db5c70fe26135aea440d16c7a..ee413de350b264373e499aab3291c66c4ea61e68 100644 (file)
@@ -30,7 +30,7 @@ public:
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                  CEPH_NOSNAP));
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(oid, _, StrEq("lock"), StrEq("lock"), _, _, _, _))
+                exec_internal(oid, _, StrEq("lock"), StrEq("lock"), _, _, _, _))
                   .WillOnce(Return(r));
   }
 
@@ -38,7 +38,7 @@ public:
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                  CEPH_NOSNAP));
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(oid, _, StrEq("lock"), StrEq("get_info"), _,
+                               exec_internal(oid, _, StrEq("lock"), StrEq("get_info"), _,
                                     _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -65,7 +65,7 @@ public:
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                  CEPH_NOSNAP));
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(oid, _, StrEq("lock"), StrEq("break_lock"),
+                               exec_internal(oid, _, StrEq("lock"), StrEq("break_lock"),
                                     _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
index 7be2c8ca6b118d582743bd16de44fc1c7b8674b0..d266ca58f25aabbf87385332c207acfc5cd7b25a 100644 (file)
@@ -88,7 +88,7 @@ public:
                               int r) {
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id, snap_id));
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(oid, _, StrEq("rbd"),
+                               exec_internal(oid, _, StrEq("rbd"),
                                     StrEq("object_map_load"), _, _, _, _));
     if (r < 0) {
       expect.WillOnce(Return(r));
@@ -130,7 +130,7 @@ public:
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                  TEST_SNAP_ID));
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(oid, _, StrEq("rbd"),
+                               exec_internal(oid, _, StrEq("rbd"),
                                     StrEq("object_map_resize"), _, _, _, _));
     expect.WillOnce(Return(r));
   }
index 732b00aadc02b9b3f360410161e993228e72d47f..bbb02b7b4a60d790758142dbfc69226938e94511 100644 (file)
@@ -26,19 +26,19 @@ public:
     std::string oid(ObjectMap<>::object_map_name(ictx->id, snap_id));
     if (snap_id == CEPH_NOSNAP) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(DoDefault());
     }
 
     if (r < 0) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _,
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _,
                        _, _))
                     .WillOnce(Return(r));
     } else {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _,
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_resize"), _, _,
                        _, _))
                     .WillOnce(DoDefault());
     }
@@ -46,7 +46,7 @@ public:
 
   void expect_invalidate(librbd::ImageCtx *ictx) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
+                exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
                      _, _, _))
                   .WillOnce(DoDefault());
   }
index 2748977391c30e15a950e1587cec3422d5835968..3335a83641582d91832d906ab16dd36f877d67e5 100644 (file)
@@ -61,16 +61,16 @@ public:
     std::string oid(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP));
     if (r < 0) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(Return(r));
     } else {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(DoDefault());
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_add"), _, _,
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_snap_add"), _, _,
                        _, _))
                     .WillOnce(DoDefault());
     }
@@ -78,7 +78,7 @@ public:
 
   void expect_invalidate(librbd::ImageCtx *ictx) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
+                exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
                      _, _, _))
                   .WillOnce(DoDefault());
   }
index 2f879aa269a935c51993939caaf688076f118c82..43a49162c4a89ac244598357d81de31cc96a6848 100644 (file)
@@ -28,12 +28,12 @@ public:
     std::string snap_oid(ObjectMap<>::object_map_name(ictx->id, snap_id));
     if (r < 0) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
+                  exec_internal(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
                        _, _, _))
                     .WillOnce(Return(r));
     } else {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
+                  exec_internal(snap_oid, _, StrEq("rbd"), StrEq("object_map_load"), _,
                        _, _, _))
                     .WillOnce(DoDefault());
     }
@@ -43,16 +43,16 @@ public:
     std::string oid(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP));
     if (r < 0) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(Return(r));
     } else {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(DoDefault());
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_snap_remove"), _,
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_snap_remove"), _,
                        _, _, _))
                     .WillOnce(DoDefault());
     }
@@ -71,7 +71,7 @@ public:
 
   void expect_invalidate(librbd::ImageCtx *ictx) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
+                exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
                      _, _, _))
                   .WillOnce(DoDefault());
   }
index 726a63cf2ae6d857d070f6dc2e4ed40f2d6f77df..92f37e1a0f79abfb10c065b3cc21a65e5addbce3 100644 (file)
@@ -37,7 +37,7 @@ public:
 
   void expect_write_map(librbd::ImageCtx *ictx, int r) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP), _,
+                exec_internal(ObjectMap<>::object_map_name(ictx->id, CEPH_NOSNAP), _,
                     StrEq("lock"), StrEq("assert_locked"), _, _, _, _))
                   .WillOnce(DoDefault());
     if (r < 0) {
@@ -55,7 +55,7 @@ public:
 
   void expect_invalidate(librbd::ImageCtx *ictx, uint32_t times) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
+                exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
                      _, _, _))
                   .Times(times)
                   .WillRepeatedly(DoDefault());
index 5ec222c0c8b751ed8283535a930d970ef9f4e723..b205a2afffa7fda5b41a9d191b6b49361a38bfa1 100644 (file)
@@ -28,7 +28,7 @@ public:
     std::string oid(ObjectMap<>::object_map_name(mock_image_ctx.id,
                                                  CEPH_NOSNAP));
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(oid, _, StrEq("lock"), StrEq("unlock"), _, _, _, _))
+                exec_internal(oid, _, StrEq("lock"), StrEq("unlock"), _, _, _, _))
                   .WillOnce(Return(r));
   }
 };
index bf7c0234342c98d4c3c3ba51aff7d6d749e09b31..6a3cd4adee9e2c8b75780dd183aa1fe4ebfa97af 100644 (file)
@@ -40,19 +40,19 @@ public:
     std::string oid(ObjectMap<>::object_map_name(ictx->id, snap_id));
     if (snap_id == CEPH_NOSNAP) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
+                  exec_internal(oid, _, StrEq("lock"), StrEq("assert_locked"), _, _, _,
                        _))
                     .WillOnce(DoDefault());
     }
 
     if (r < 0) {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_update"),
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_update"),
                        ContentsEqual(bl), _, _, _))
                     .WillOnce(Return(r));
     } else {
       EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                  exec(oid, _, StrEq("rbd"), StrEq("object_map_update"),
+                  exec_internal(oid, _, StrEq("rbd"), StrEq("object_map_update"),
                        ContentsEqual(bl), _, _, _))
                     .WillOnce(DoDefault());
     }
@@ -60,7 +60,7 @@ public:
 
   void expect_invalidate(librbd::ImageCtx *ictx) {
     EXPECT_CALL(get_mock_io_ctx(ictx->md_ctx),
-                exec(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
+                exec_internal(ictx->header_oid, _, StrEq("rbd"), StrEq("set_flags"), _,
                      _, _, _))
                   .WillOnce(DoDefault());
   }
index ada978b27341bbbcd51a2d324b4374a6eeebff96..30713dd1e3a7cd051d5a76f3ee767cc0497f3f0f 100644 (file)
@@ -114,7 +114,7 @@ public:
     } else {
       expect_is_lock_owner(mock_image_ctx);
       EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                  exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                  exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                        StrEq("set_size"), _, _, _, _))
                     .WillOnce(Return(r));
     }
index 1810d12773f16ca9a5248e78570aca7aedbda9ff..34c6b60c45e2ac43d56878891a511e9a5729fee3 100644 (file)
@@ -104,7 +104,7 @@ public:
 
   void expect_snap_create(MockImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                StrEq(mock_image_ctx.old_format ? "snap_add" :
                                                                  "snapshot_add"),
                                _, _, _, _));
index 3828e7abacbe2d8bfa1708577e6cf25b769d421a..b1bab47516269a975ba249af1d8f134c8d545b2f 100644 (file)
@@ -49,7 +49,7 @@ public:
 
   void expect_set_protection_status(MockImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("set_protection_status"), _, _, _,
                                     _));
     if (r < 0) {
index 06d34e7e706ab4884e827224586df40ffe46b182..ef192860a9b28e6a0ee9a75f3b95f1144cf3bd07 100644 (file)
@@ -121,7 +121,7 @@ public:
     }
 
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                StrEq("snapshot_trash_add"),
                                _, _, _, _));
     if (r < 0) {
@@ -139,7 +139,7 @@ public:
 
     using ceph::encode;
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("snapshot_get"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([snap_info, r](bufferlist* bl) {
                              encode(snap_info, *bl);
@@ -155,7 +155,7 @@ public:
 
     using ceph::encode;
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("children_list"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([child_images, r](bufferlist* bl) {
                              encode(child_images, *bl);
@@ -171,7 +171,7 @@ public:
     encode(cls::rbd::ChildImageSpec{mock_image_ctx.md_ctx.get_id(), "",
                                     mock_image_ctx.id}, bl);
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(util::header_name(parent_spec.image_id),
+                exec_internal(util::header_name(parent_spec.image_id),
                      _, StrEq("rbd"), StrEq("child_detach"), ContentsEqual(bl),
                      _, _, _))
       .WillOnce(Return(r));
@@ -216,7 +216,7 @@ public:
 
   void expect_snap_remove(MockImageCtx &mock_image_ctx, int r) {
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                StrEq(mock_image_ctx.old_format ? "snap_remove" :
                                                                   "snapshot_remove"),
                                 _, _, _, _));
index 09f63805039e5dfd141f1fbfd1a52b8bcd6d542d..7e6cc260eda2441f03d3cc387f4e8fe1eadda9a8 100644 (file)
@@ -57,7 +57,7 @@ public:
     encode(status, bl);
 
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(mock_image_ctx.header_oid, _, StrEq("rbd"),
+                               exec_internal(mock_image_ctx.header_oid, _, StrEq("rbd"),
                                     StrEq("set_protection_status"),
                                     ContentsEqual(bl), _, _, _));
     if (r < 0) {
@@ -92,7 +92,7 @@ public:
     encode(children, bl);
 
     auto &expect = EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                               exec(RBD_CHILDREN, _, StrEq("rbd"),
+                               exec_internal(RBD_CHILDREN, _, StrEq("rbd"),
                                StrEq("get_children"), _, _, _, _));
     if (r < 0) {
       expect.WillRepeatedly(Return(r));
index 664d90dd9abcbe2eb7f5076efaaffb05319d125a..ae3dc4a9086395ab3405827f1d73138d6559893f 100644 (file)
@@ -53,17 +53,17 @@ void TestMockFixture::TearDown() {
 
 void TestMockFixture::expect_unlock_exclusive_lock(librbd::ImageCtx &ictx) {
   EXPECT_CALL(get_mock_io_ctx(ictx.md_ctx),
-              exec(_, _, StrEq("lock"), StrEq("unlock"), _, _, _, _))
+              exec_internal(_, _, StrEq("lock"), StrEq("unlock"), _, _, _, _))
                 .WillRepeatedly(DoDefault());
   if (ictx.test_features(RBD_FEATURE_DIRTY_CACHE)) {
     EXPECT_CALL(get_mock_io_ctx(ictx.md_ctx),
-                exec(ictx.header_oid, _, StrEq("rbd"), StrEq("set_features"), _, _, _, _))
+                exec_internal(ictx.header_oid, _, StrEq("rbd"), StrEq("set_features"), _, _, _, _))
                   .WillOnce(DoDefault());
     EXPECT_CALL(get_mock_io_ctx(ictx.md_ctx),
-                exec(ictx.header_oid, _, StrEq("rbd"), StrEq("metadata_set"), _, _, _, _))
+                exec_internal(ictx.header_oid, _, StrEq("rbd"), StrEq("metadata_set"), _, _, _, _))
                   .WillOnce(DoDefault());
     EXPECT_CALL(get_mock_io_ctx(ictx.md_ctx),
-                exec(ictx.header_oid, _, StrEq("rbd"), StrEq("metadata_remove"), _, _, _, _))
+                exec_internal(ictx.header_oid, _, StrEq("rbd"), StrEq("metadata_remove"), _, _, _, _))
                   .WillOnce(DoDefault());
   }
 }
index 9b873d01259c3d33d6d0d37709799c0dfde3df36..8a1d5edb1ad517ddfb916426f5fa966367d73962 100644 (file)
@@ -62,7 +62,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture {
                         const utime_t& end_time,
                         int r) {
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_add"),
+                exec_internal(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_add"),
                      _, _, _, _))
       .WillOnce(WithArg<4>(Invoke([=](bufferlist& in_bl) {
                              std::string id;
@@ -96,7 +96,7 @@ struct TestMockTrashMoveRequest : public TestMockFixture {
     encode(id, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(StrEq("rbd_directory"), _, StrEq("rbd"), StrEq("dir_remove_image"),
+                exec_internal(StrEq("rbd_directory"), _, StrEq("rbd"), StrEq("dir_remove_image"),
                      ContentsEqual(in_bl), _, _, _))
       .WillOnce(Return(r));
   }
index ea212d22714cbe197f348ab9091cbb91404a1ac8..d54301318536dd535122b03ddf404521e5543308 100644 (file)
@@ -102,7 +102,7 @@ struct TestMockTrashRemoveRequest : public TestMockFixture {
     encode(trash_expect_state, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_state_set"),
+                exec_internal(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_state_set"),
                      ContentsEqual(in_bl), _, _, _))
       .WillOnce(Return(r));
   }
@@ -138,7 +138,7 @@ struct TestMockTrashRemoveRequest : public TestMockFixture {
     encode(mock_image_ctx.id, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_image_ctx.md_ctx),
-                exec(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_remove"),
+                exec_internal(StrEq("rbd_trash"), _, StrEq("rbd"), StrEq("trash_remove"),
                      ContentsEqual(in_bl), _, _, _))
       .WillOnce(Return(r));
   }
index af77b909b0abb3b968e7c6ed6f076764ac7a1db8..6820eeb2315acb79c0728c781fbc4ea810db3827 100644 (file)
@@ -36,18 +36,34 @@ using namespace std::literals;
 using neorados::ReadOp;
 using neorados::WriteOp;
 
+namespace cls::bogus_classes {
+struct ClassId {
+  static constexpr auto name = "doesnotexistasdfasdf";
+};
+struct ClassIdLock { // This is a real class. We are adding a bogus method.
+  static constexpr auto name = "doesnotexistasdfasdf";
+};
+namespace method {
+constexpr auto bogus_class = ClsMethod<RdWrTag, ClassId>("method");
+constexpr auto bogus_method = ClsMethod<RdWrTag, ClassIdLock>("doesnotexistasdfasdfasdf");
+}
+}
+
+using namespace ::cls::bogus_classes;
+
 CORO_TEST_F(NeoRadosCls, DNE, NeoRadosTest)
 {
   std::string_view oid = "obj";
   co_await execute(oid, WriteOp{}.create(true));
+  bufferlist bl1, bl2;
   // Call a bogus class
   co_await expect_error_code(
-    execute(oid, ReadOp{}.exec("doesnotexistasdfasdf", "method", {})),
+    execute(oid, WriteOp{}.exec(method::bogus_class, std::move(bl1))),
     sys::errc::operation_not_supported);
 
   // Call a bogus method on an existent class
   co_await expect_error_code(
-    execute(oid, ReadOp{}.exec("lock", "doesnotexistasdfasdfasdf", {})),
+    execute(oid, WriteOp{}.exec(method::bogus_method, std::move(bl2))),
     sys::errc::operation_not_supported);
   co_return;
 }
index 37215ee9d6cd5ce025da97225bef16a12d685035..2cad26abd0e5a6df017f0572573a2aa6577e2fbb 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "include/neorados/RADOS.hpp"
 
-#include "cls/version/cls_version_types.h"
+#include "cls/version/cls_version_ops.h"
 
 #include "test/neorados/common_tests.h"
 
@@ -40,7 +40,8 @@ CORO_TEST_F(neocls_handler_error, test_handler_error, NeoRadosTest)
 
   {
     neorados::ReadOp op;
-    op.exec("version", "read", {},
+    bufferlist bl;
+    op.exec(::cls::version::method::read, std::move(bl),
            [](sys::error_code ec, const buffer::list& bl) {
              throw buffer::end_of_buffer{};
            });
@@ -51,7 +52,8 @@ CORO_TEST_F(neocls_handler_error, test_handler_error, NeoRadosTest)
 
   {
     neorados::ReadOp op;
-    op.exec("version", "read", {},
+    bufferlist bl;
+    op.exec(::cls::version::method::read, std::move(bl),
            [](sys::error_code ec, const buffer::list& bl) {
              throw std::exception();
            });
index a372ff2afdb2fb3510d11f8ecc1c2e1503033759..88920790054b372634f897303e91402c1f4bcaec 100644 (file)
@@ -17,6 +17,7 @@
 #include <boost/asio/use_awaitable.hpp>
 
 #include <boost/system/errc.hpp>
+#include <cls/rbd/cls_rbd_ops.h>
 
 #include "include/neorados/RADOS.hpp"
 
@@ -165,10 +166,10 @@ CORO_TEST_F(NeoRadosMisc, LongAttrName, NeoRadosTest) {
 }
 
 CORO_TEST_F(NeoRadosMisc, Exec, NeoRadosTest) {
-  buffer::list out;
+  buffer::list in, out;
   co_await execute(oid, WriteOp{}.create(true));
   co_await execute(oid,
-                  ReadOp{}.exec("rbd"sv, "get_all_features"sv, {}, &out));
+                  ReadOp{}.exec(::cls::rbd::method::get_all_features, std::move(in), &out));
   auto features = from_buffer_list<std::uint64_t>(out);
   // make sure *some* features are specified; don't care which ones
   EXPECT_NE(0, features);
index bbae362aa575ff01e111d58c857a6c7fed3dcf05..683c07f71db01ee68230b19c69c545d520bcba17 100644 (file)
@@ -38,6 +38,8 @@
 
 #include "gtest/gtest.h"
 
+#include "cls/rbd/cls_rbd_ops.h"
+
 namespace asio = boost::asio;
 namespace ctnr = boost::container;
 namespace hash_alg = neorados::hash_alg;
@@ -88,8 +90,9 @@ protected:
 
 CORO_TEST_F(NeoRadosReadOps, SetOpFlags, ReadOpTest) {
   sys::error_code ec;
+  bufferlist bl;
   co_await execute(oid, ReadOp{}
-                  .exec("rbd"sv, "get_id"sv, {}, nullptr, &ec)
+                  .exec(::cls::rbd::method::get_id, std::move(bl), nullptr, &ec)
                    .set_failok());
   EXPECT_EQ(sys::errc::io_error, ec);
   co_return;
@@ -307,10 +310,10 @@ CORO_TEST_F(NeoRadosReadOps, ShortRead, ReadOpTest) {
 }
 
 CORO_TEST_F(NeoRadosReadOps, Exec, ReadOpTest) {
-  buffer::list bl;
+  buffer::list bl, inbl;
   sys::error_code ec;
   co_await execute(oid,
-                  ReadOp{}.exec("rbd"sv, "get_all_features"sv, {}, &bl, &ec));
+                  ReadOp{}.exec(::cls::rbd::method::get_all_features, std::move(inbl), &bl, &ec));
   EXPECT_FALSE(ec);
   std::uint64_t features;
   EXPECT_EQ(sizeof(features), bl.length());
index cad2f2cee64f4d99da8aa81b96c21ac47ec61ef6..fe9a6b12ad7f72177914516c2451508596fcb33f 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "gtest/gtest.h"
 
+#include "cls/hello/cls_hello_ops.h"
+
 namespace sys = boost::system;
 
 using namespace std::literals;
@@ -129,8 +131,7 @@ CORO_TEST_F(NeoRadosWriteOps, Write, NeoRadosTest) {
 
 CORO_TEST_F(NeoRadosWriteOps, Exec, NeoRadosTest) {
   co_await execute(oid, WriteOp{}
-                  .exec("hello"sv, "record_hello"sv,
-                        to_buffer_list("test")));
+                  .exec(::cls::hello::method::record_hello, to_buffer_list("test")));
   const auto bl = co_await read(oid);
   EXPECT_EQ(to_buffer_list("Hello, test!"), bl);
   co_return;
index ba2004fe1e0df5d973dde46b3e416b30eb93fd03..22d2543b36419f8c952005bf5ca51088665d7a1c 100644 (file)
@@ -234,7 +234,7 @@ public:
     encode(image_id, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_get_image_id"), _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
@@ -301,7 +301,7 @@ public:
     encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_set"), ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
   }
index c8d229563065ddedd4d8ffbfd402d458f6a1e3dc..ce16fe4cca66f86c5e974a43fbcee7259f21e751 100644 (file)
@@ -133,7 +133,7 @@ public:
   void expect_trash_get(const cls::rbd::TrashImageSpec& trash_spec, int r) {
     using ceph::encode;
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(StrEq(RBD_TRASH), _, StrEq("rbd"),
+                exec_internal(StrEq(RBD_TRASH), _, StrEq("rbd"),
                      StrEq("trash_get"), _, _, _, _))
       .WillOnce(WithArg<5>(Invoke([trash_spec, r](bufferlist* bl) {
                              encode(trash_spec, *bl);
@@ -148,7 +148,7 @@ public:
     encode(cls::rbd::TRASH_IMAGE_STATE_NORMAL, in_bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(StrEq(RBD_TRASH), _, StrEq("rbd"),
+                exec_internal(StrEq(RBD_TRASH), _, StrEq("rbd"),
                      StrEq("trash_state_set"),
                      ContentsEqual(in_bl), _, _, _))
       .WillOnce(Return(r));
@@ -160,7 +160,7 @@ public:
     encode(snapc, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(librbd::util::header_name(image_id), _, StrEq("rbd"),
+                exec_internal(librbd::util::header_name(image_id), _, StrEq("rbd"),
                      StrEq("get_snapcontext"), _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
index 5d37cd13a3566a5ba33a2e779489e24846a0139f..aaa9e01bdc21267d40516adcfbb0863e530c54c5 100644 (file)
@@ -168,7 +168,7 @@ public:
     encode(images, out_bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_TRASH, _, StrEq("rbd"), StrEq("trash_list"),
+                exec_internal(RBD_TRASH, _, StrEq("rbd"), StrEq("trash_list"),
                      ContentsEqual(bl), _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([out_bl](bufferlist *bl) {
                           *bl = out_bl;
index 1516d7962c2cc5563d868917d6a3b18d99c9565d..8f180c63cd1e8f3222682a3e34e6076bc9168ebf 100644 (file)
@@ -127,7 +127,7 @@ public:
       bufferlist bl;
       ceph::encode(key, bl);
       EXPECT_CALL(get_mock_io_ctx(m_mock_local_image_ctx->md_ctx),
-                  exec(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"),
+                  exec_internal(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"),
                   StrEq("metadata_remove"), ContentsEqual(bl), _, _, _))
         .WillOnce(Return(r));
       if (r < 0) {
@@ -139,7 +139,7 @@ public:
       bufferlist bl;
       ceph::encode(pairs, bl);
       EXPECT_CALL(get_mock_io_ctx(m_mock_local_image_ctx->md_ctx),
-                  exec(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"),
+                  exec_internal(m_mock_local_image_ctx->header_oid, _, StrEq("rbd"),
                   StrEq("metadata_set"), ContentsEqual(bl), _, _, _))
         .WillOnce(Return(r));
     }
index 89091a05f3d50451f8619fff50f2f9658da69e2e..dc2ead296cfd04bf1c56759f9f595ec5cf9d048d 100644 (file)
@@ -169,7 +169,7 @@ public:
     encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_set"), ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
   }
@@ -179,7 +179,7 @@ public:
     encode(image_id, bl);
 
     EXPECT_CALL(get_mock_io_ctx(m_local_io_ctx),
-                exec(StrEq("rbd_mirroring"), _, StrEq("rbd"),
+                exec_internal(StrEq("rbd_mirroring"), _, StrEq("rbd"),
                      StrEq("mirror_image_remove"),
                      ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
index 9eac17eace610b9b1d8870a93fee6cb2b8b24571..db85304f06b2f514baeb38e88571896cc13427c3 100644 (file)
@@ -630,7 +630,7 @@ public:
     encode(last_copied_object, bl);
 
     EXPECT_CALL(get_mock_io_ctx(mock_test_image_ctx.md_ctx),
-                exec(mock_test_image_ctx.header_oid, _, StrEq("rbd"),
+                exec_internal(mock_test_image_ctx.header_oid, _, StrEq("rbd"),
                      StrEq("mirror_image_snapshot_set_copy_progress"),
                      ContentsEqual(bl), _, _, _))
       .WillOnce(Return(r));
index 3080a93fe35068b94d5e38018e49f1aff5207d25..0e2f66d4e6eb84a47adb49c0ec71652c9c9692a4 100644 (file)
@@ -274,7 +274,7 @@ public:
     encode(mirror_image, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_get"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
@@ -288,7 +288,7 @@ public:
     encode(image_id, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_get_image_id"), _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
index 6877e44dff24f2bcbcbc055d11b31c56ceae08fb..509278b719316e50febe85c44cddd395115947e2 100644 (file)
@@ -49,7 +49,7 @@ public:
     encode(image_id, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_get_image_id"), _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
index 29522173b4248a73e9ab36e9ec3a816928c7b3ec..3dc0363eedb7df5789925fda1ede96e8de1f7d22 100644 (file)
@@ -222,7 +222,7 @@ public:
     encode(image_name, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_get_name"), _,
+                exec_internal(RBD_DIRECTORY, _, StrEq("rbd"), StrEq("dir_get_name"), _,
                      _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
index c0f3a6b4d14cfef8261fb61e249858de14452c85..2c18665985edc3ba4d82c54c76ecbb211a07a4c4 100644 (file)
@@ -47,7 +47,7 @@ public:
     encode(ids, bl);
 
     EXPECT_CALL(get_mock_io_ctx(io_ctx),
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_list"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_image_list"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([bl](bufferlist *out_bl) {
                                           *out_bl = bl;
index 4a1514e14c9b25f176265a851cad1d52b495a148..463399a4bd2fb27493d90db5439720912b62e905 100644 (file)
@@ -165,14 +165,14 @@ public:
 
   void expect_register_instance(librados::MockTestMemIoCtxImpl &mock_io_ctx,
                                 int r) {
-    EXPECT_CALL(mock_io_ctx, exec(RBD_MIRROR_LEADER, _, StrEq("rbd"),
+    EXPECT_CALL(mock_io_ctx, exec_internal(RBD_MIRROR_LEADER, _, StrEq("rbd"),
                                   StrEq("mirror_instances_add"), _, _, _, _))
       .WillOnce(Return(r));
   }
 
   void expect_unregister_instance(librados::MockTestMemIoCtxImpl &mock_io_ctx,
                                   int r) {
-    EXPECT_CALL(mock_io_ctx, exec(RBD_MIRROR_LEADER, _, StrEq("rbd"),
+    EXPECT_CALL(mock_io_ctx, exec_internal(RBD_MIRROR_LEADER, _, StrEq("rbd"),
                                   StrEq("mirror_instances_remove"), _, _, _, _))
       .WillOnce(Return(r));
   }
index 0625932bc6839fe517bc012f2e7fc2d63f63439b..f7172777d19e3de4a9be5e5c5b54ed8420544869 100644 (file)
@@ -150,7 +150,7 @@ public:
       const std::string& global_image_id,
       const cls::rbd::MirrorImageSiteStatus& mirror_image_status, int r) {
     EXPECT_CALL(*m_mock_local_io_ctx,
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_status_set"), _, _, _, _))
       .WillOnce(WithArg<4>(Invoke(
         [r, global_image_id, mirror_image_status](bufferlist& in_bl) {
@@ -188,7 +188,7 @@ public:
 
   void expect_mirror_status_remove(const std::string& global_image_id, int r) {
     EXPECT_CALL(*m_mock_local_io_ctx,
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_image_status_remove"), _, _, _, _))
       .WillOnce(WithArg<4>(Invoke(
         [r, global_image_id](bufferlist& in_bl) {
index 273bd147e46d113eb9ffe7427b07d3c7678edff6..49b7f7c91adcf95fce2a85651df0a8bc75761edb 100644 (file)
@@ -341,7 +341,7 @@ public:
     encode(uuid, out_bl);
 
     EXPECT_CALL(*io_ctx_impl,
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_uuid_get"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_uuid_get"),
                      _, _, _, _))
       .WillOnce(DoAll(WithArg<5>(Invoke([out_bl](bufferlist *bl) {
                           *bl = out_bl;
@@ -353,7 +353,7 @@ public:
                               std::atomic<bool>* default_namespace_enabled,
                               int r) {
     EXPECT_CALL(*io_ctx_impl,
-                exec(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"), StrEq("mirror_mode_get"),
                      _, _, _, _))
       .WillRepeatedly(DoAll(WithArg<5>(Invoke(
              [io_ctx_impl, default_namespace_enabled](bufferlist* bl) {
@@ -371,7 +371,7 @@ public:
       librados::MockTestMemIoCtxImpl *io_ctx_impl,
       const std::string &remote_namespace, int r) {
     EXPECT_CALL(*io_ctx_impl,
-                exec(RBD_MIRRORING, _, StrEq("rbd"),
+                exec_internal(RBD_MIRRORING, _, StrEq("rbd"),
                      StrEq("mirror_remote_namespace_get"), _, _, _, _))
       .WillRepeatedly(DoAll(WithArg<5>(Invoke([remote_namespace](bufferlist *bl) {
                 encode(remote_namespace, *bl);