summaryrefslogtreecommitdiffstats
path: root/src/test/librbd/mock/MockImageState.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/test/librbd/mock/MockImageState.h
parentInitial commit. (diff)
downloadceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.tar.xz
ceph-6d07fdb6bb33b1af39833b850bb6cf8af79fe293.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/librbd/mock/MockImageState.h')
-rw-r--r--src/test/librbd/mock/MockImageState.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/librbd/mock/MockImageState.h b/src/test/librbd/mock/MockImageState.h
new file mode 100644
index 000000000..f510c4a0f
--- /dev/null
+++ b/src/test/librbd/mock/MockImageState.h
@@ -0,0 +1,39 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#ifndef CEPH_TEST_LIBRBD_MOCK_IMAGE_STATE_H
+#define CEPH_TEST_LIBRBD_MOCK_IMAGE_STATE_H
+
+#include <gmock/gmock.h>
+
+#include "cls/rbd/cls_rbd_types.h"
+
+class Context;
+
+namespace librbd {
+
+class UpdateWatchCtx;
+
+struct MockImageState {
+ MOCK_CONST_METHOD0(is_refresh_required, bool());
+ MOCK_METHOD1(refresh, void(Context*));
+
+ MOCK_METHOD2(open, void(bool, Context*));
+
+ MOCK_METHOD0(close, int());
+ MOCK_METHOD1(close, void(Context*));
+
+ MOCK_METHOD2(snap_set, void(uint64_t snap_id, Context*));
+
+ MOCK_METHOD1(prepare_lock, void(Context*));
+ MOCK_METHOD0(handle_prepare_lock_complete, void());
+
+ MOCK_METHOD2(register_update_watcher, int(UpdateWatchCtx *, uint64_t *));
+ MOCK_METHOD2(unregister_update_watcher, void(uint64_t, Context *));
+
+ MOCK_METHOD0(handle_update_notification, void());
+};
+
+} // namespace librbd
+
+#endif // CEPH_TEST_LIBRBD_MOCK_IMAGE_STATE_H