summaryrefslogtreecommitdiffstats
path: root/src/test/librbd/CMakeLists.txt
blob: 39c76678cc4fcba7f9c5f24c0034581bfac259dc (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
set(librbd_test_support_srcs
  test_support.cc
  )
add_library(rbd_test_support STATIC ${librbd_test_support_srcs})
target_link_libraries(rbd_test_support PRIVATE
  GTest::GTest)

set(librbd_test
  test_fixture.cc
  test_librbd.cc
  test_ImageWatcher.cc
  test_internal.cc
  test_mirroring.cc
  test_BlockGuard.cc
  test_DeepCopy.cc
  test_Groups.cc
  test_Migration.cc
  test_MirroringWatcher.cc
  test_ObjectMap.cc
  test_Operations.cc
  test_Trash.cc
  journal/test_Entries.cc
  journal/test_Replay.cc)
add_library(rbd_test STATIC ${librbd_test})
target_link_libraries(rbd_test PRIVATE
  rbd_test_support
  radostest
  radostest-cxx
  librados
  Boost::thread
  GMock::GMock
  GTest::GTest)

set(librbd_test_mock_srcs
  mock/MockImageCtx.cc
  mock/MockJournal.cc)
add_library(rbd_test_mock STATIC ${librbd_test_mock_srcs})
target_link_libraries(rbd_test_mock PUBLIC
  GMock::GMock)

# unittest_librbd
# doesn't use add_ceph_test because it is called by run-rbd-unit-tests.sh
set(unittest_librbd_srcs
  test_main.cc
  test_mock_fixture.cc
  test_mock_ConfigWatcher.cc
  test_mock_DeepCopyRequest.cc
  test_mock_ExclusiveLock.cc
  test_mock_Journal.cc
  test_mock_ManagedLock.cc
  test_mock_ObjectMap.cc
  test_mock_TrashWatcher.cc
  test_mock_Watcher.cc
  deep_copy/test_mock_ImageCopyRequest.cc
  deep_copy/test_mock_MetadataCopyRequest.cc
  deep_copy/test_mock_ObjectCopyRequest.cc
  deep_copy/test_mock_SetHeadRequest.cc
  deep_copy/test_mock_SnapshotCopyRequest.cc
  deep_copy/test_mock_SnapshotCreateRequest.cc
  exclusive_lock/test_mock_PreAcquireRequest.cc
  exclusive_lock/test_mock_PostAcquireRequest.cc
  exclusive_lock/test_mock_PreReleaseRequest.cc
  image/test_mock_AttachChildRequest.cc
  image/test_mock_AttachParentRequest.cc
  image/test_mock_CloneRequest.cc
  image/test_mock_DetachChildRequest.cc
  image/test_mock_DetachParentRequest.cc
  image/test_mock_ListWatchersRequest.cc
  image/test_mock_PreRemoveRequest.cc
  image/test_mock_RefreshRequest.cc
  image/test_mock_RemoveRequest.cc
  image/test_mock_ValidatePoolRequest.cc
  io/test_mock_CopyupRequest.cc
  io/test_mock_ImageRequest.cc
  io/test_mock_ImageRequestWQ.cc
  io/test_mock_ObjectRequest.cc
  journal/test_mock_OpenRequest.cc
  journal/test_mock_PromoteRequest.cc
  journal/test_mock_Replay.cc
  journal/test_mock_ResetRequest.cc
  managed_lock/test_mock_AcquireRequest.cc
  managed_lock/test_mock_BreakRequest.cc
  managed_lock/test_mock_GetLockerRequest.cc
  managed_lock/test_mock_ReacquireRequest.cc
  managed_lock/test_mock_ReleaseRequest.cc
  mirror/test_mock_DisableRequest.cc
  object_map/test_mock_InvalidateRequest.cc
  object_map/test_mock_LockRequest.cc
  object_map/test_mock_RefreshRequest.cc
  object_map/test_mock_ResizeRequest.cc
  object_map/test_mock_SnapshotCreateRequest.cc
  object_map/test_mock_SnapshotRemoveRequest.cc
  object_map/test_mock_SnapshotRollbackRequest.cc
  object_map/test_mock_UnlockRequest.cc
  object_map/test_mock_UpdateRequest.cc
  operation/test_mock_DisableFeaturesRequest.cc
  operation/test_mock_EnableFeaturesRequest.cc
  operation/test_mock_Request.cc
  operation/test_mock_ResizeRequest.cc
  operation/test_mock_SnapshotCreateRequest.cc
  operation/test_mock_SnapshotProtectRequest.cc
  operation/test_mock_SnapshotRemoveRequest.cc
  operation/test_mock_SnapshotRollbackRequest.cc
  operation/test_mock_SnapshotUnprotectRequest.cc
  operation/test_mock_TrimRequest.cc
  trash/test_mock_MoveRequest.cc
  trash/test_mock_RemoveRequest.cc
  watcher/test_mock_RewatchRequest.cc
  )
add_executable(unittest_librbd
  ${unittest_librbd_srcs}
  $<TARGET_OBJECTS:common_texttable_obj>)
target_compile_definitions(unittest_librbd PRIVATE "TEST_LIBRBD_INTERNALS")
target_link_libraries(unittest_librbd
  cls_rbd
  cls_rbd_client
  cls_lock
  cls_lock_client
  journal
  journal_test_mock
  cls_journal
  cls_journal_client
  rados_test_stub
  librados
  rbd_test
  rbd_test_mock
  rbd_api
  rbd_internal
  rbd_types
  osdc
  ceph-common
  global
  ${UNITTEST_LIBS})

add_executable(ceph_test_librbd
  test_main.cc
  $<TARGET_OBJECTS:common_texttable_obj>)
target_link_libraries(ceph_test_librbd
  rbd_test
  rbd_api
  rbd_internal
  rbd_types
  journal
  cls_journal_client
  cls_rbd_client
  librados
  ${UNITTEST_LIBS}
  radostest)
target_compile_definitions(ceph_test_librbd PRIVATE "TEST_LIBRBD_INTERNALS")

add_executable(ceph_test_librbd_fsx
  fsx.cc
  $<TARGET_OBJECTS:common_texttable_obj>
  )
target_link_libraries(ceph_test_librbd_fsx
  librbd
  librados
  journal
  global
  m
  ${CMAKE_DL_LIBS}
  ${CRYPTO_LIBS}
  ${EXTRALIBS}
  )
if(WITH_KRBD)
  target_link_libraries(ceph_test_librbd_fsx
    krbd)
endif()
install(TARGETS
  ceph_test_librbd_fsx
  DESTINATION ${CMAKE_INSTALL_BINDIR})

install(TARGETS
  ceph_test_librbd
  DESTINATION ${CMAKE_INSTALL_BINDIR})