summaryrefslogtreecommitdiffstats
path: root/src/test/librbd/mock/MockOperations.h
blob: 99dc253d115748971e208ababe026b6260950733 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab

#ifndef CEPH_TEST_LIBRBD_MOCK_OPERATIONS_H
#define CEPH_TEST_LIBRBD_MOCK_OPERATIONS_H

#include "cls/rbd/cls_rbd_types.h"
#include "include/int_types.h"
#include "include/rbd/librbd.hpp"
#include "gmock/gmock.h"
#include <string>

class Context;

namespace librbd {

struct MockOperations {
  MOCK_METHOD2(execute_flatten, void(ProgressContext &prog_ctx,
                                     Context *on_finish));
  MOCK_METHOD2(execute_rebuild_object_map, void(ProgressContext &prog_ctx,
                                                Context *on_finish));
  MOCK_METHOD2(execute_rename, void(const std::string &dstname,
                                    Context *on_finish));
  MOCK_METHOD5(execute_resize, void(uint64_t size, bool allow_shrink,
                                    ProgressContext &prog_ctx,
                                    Context *on_finish,
                                    uint64_t journal_op_tid));
  MOCK_METHOD5(snap_create, void(const cls::rbd::SnapshotNamespace &snapshot_namespace,
				 const std::string &snap_name,
                                 uint64_t flags,
                                 ProgressContext &prog_ctx,
                                 Context *on_finish));
  MOCK_METHOD6(execute_snap_create, void(const cls::rbd::SnapshotNamespace &snapshot_namespace,
					 const std::string &snap_name,
                                         Context *on_finish,
                                         uint64_t journal_op_tid,
                                         uint64_t flags,
                                         ProgressContext &prog_ctx));
  MOCK_METHOD3(snap_remove, void(const cls::rbd::SnapshotNamespace &snap_namespace,
				 const std::string &snap_name,
                                 Context *on_finish));
  MOCK_METHOD3(execute_snap_remove, void(const cls::rbd::SnapshotNamespace &snap_namespace,
					 const std::string &snap_name,
                                         Context *on_finish));
  MOCK_METHOD3(execute_snap_rename, void(uint64_t src_snap_id,
                                         const std::string &snap_name,
                                         Context *on_finish));
  MOCK_METHOD4(execute_snap_rollback, void(const cls::rbd::SnapshotNamespace &snap_namespace,
					   const std::string &snap_name,
                                           ProgressContext &prog_ctx,
                                           Context *on_finish));
  MOCK_METHOD3(execute_snap_protect, void(const cls::rbd::SnapshotNamespace &snap_namespace,
					  const std::string &snap_name,
                                          Context *on_finish));
  MOCK_METHOD3(execute_snap_unprotect, void(const cls::rbd::SnapshotNamespace &snap_namespace,
					    const std::string &snap_name,
                                            Context *on_finish));
  MOCK_METHOD2(execute_snap_set_limit, void(uint64_t limit,
					    Context *on_finish));
  MOCK_METHOD4(execute_update_features, void(uint64_t features, bool enabled,
                                             Context *on_finish,
                                             uint64_t journal_op_tid));
  MOCK_METHOD3(execute_metadata_set, void(const std::string &key,
                                          const std::string &value,
                                          Context *on_finish));
  MOCK_METHOD2(execute_metadata_remove, void(const std::string &key,
                                             Context *on_finish));
};

} // namespace librbd

#endif // CEPH_TEST_LIBRBD_MOCK_OPERATIONS_H