summaryrefslogtreecommitdiffstats
path: root/src/test/rgw/CMakeLists.txt
blob: 57d6696c776ae9966734a207bcdd1b7ef5a40a1f (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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
if(WITH_RADOSGW_AMQP_ENDPOINT)
  # amqp mock library
  set(amqp_mock_src
    amqp_mock.cc amqp_url.c)
  add_library(amqp_mock STATIC ${amqp_mock_src})
endif()

if(WITH_RADOSGW_KAFKA_ENDPOINT)
  # kafka stub library
  set(kafka_stub_src
    kafka_stub.cc)
  add_library(kafka_stub STATIC ${kafka_stub_src})
endif()

if(WITH_RADOSGW_LUA_PACKAGES)
  list(APPEND rgw_libs Boost::filesystem)
endif()

if(WITH_JAEGER)
  list(APPEND rgw_libs ${jaeger_base})
endif()

#unittest_rgw_bencode
add_executable(unittest_rgw_bencode test_rgw_bencode.cc)
add_ceph_unittest(unittest_rgw_bencode)
target_link_libraries(unittest_rgw_bencode ${rgw_libs})

# unittest_rgw_bucket_sync_cache
add_executable(unittest_rgw_bucket_sync_cache test_rgw_bucket_sync_cache.cc)
add_ceph_unittest(unittest_rgw_bucket_sync_cache)
target_link_libraries(unittest_rgw_bucket_sync_cache ${rgw_libs})

#unitttest_rgw_period_history
add_executable(unittest_rgw_period_history test_rgw_period_history.cc)
add_ceph_unittest(unittest_rgw_period_history)
target_link_libraries(unittest_rgw_period_history ${rgw_libs})

# unitttest_rgw_compression
add_executable(unittest_rgw_compression
  test_rgw_compression.cc
  $<TARGET_OBJECTS:unit-main>)
add_ceph_unittest(unittest_rgw_compression)
target_link_libraries(unittest_rgw_compression ${rgw_libs})

# unitttest_http_manager
add_executable(unittest_http_manager test_http_manager.cc)
add_ceph_unittest(unittest_http_manager)
target_link_libraries(unittest_http_manager ${rgw_libs})

# unitttest_rgw_reshard_wait
add_executable(unittest_rgw_reshard_wait test_rgw_reshard_wait.cc)
add_ceph_unittest(unittest_rgw_reshard_wait)
target_link_libraries(unittest_rgw_reshard_wait ${rgw_libs})

set(test_rgw_a_src test_rgw_common.cc)
add_library(test_rgw_a STATIC ${test_rgw_a_src})
target_link_libraries(test_rgw_a ${rgw_libs})

add_executable(bench_rgw_ratelimit bench_rgw_ratelimit.cc)
target_link_libraries(bench_rgw_ratelimit ${rgw_libs})

add_executable(bench_rgw_ratelimit_gc bench_rgw_ratelimit_gc.cc )
target_link_libraries(bench_rgw_ratelimit_gc ${rgw_libs})

add_executable(unittest_rgw_ratelimit test_rgw_ratelimit.cc $<TARGET_OBJECTS:unit-main>)
target_link_libraries(unittest_rgw_ratelimit ${rgw_libs})
add_ceph_unittest(unittest_rgw_ratelimit)

# ceph_test_rgw_manifest
set(test_rgw_manifest_srcs test_rgw_manifest.cc)
add_executable(ceph_test_rgw_manifest
  ${test_rgw_manifest_srcs}
  )
target_link_libraries(ceph_test_rgw_manifest
  test_rgw_a
  cls_rgw_client
  cls_lock_client
  cls_refcount_client
  cls_log_client
  cls_timeindex_client
  cls_version_client
  cls_user_client
  librados
  global
  ${BLKID_LIBRARIES}
  ${CURL_LIBRARIES}
  ${EXPAT_LIBRARIES}
  ${CMAKE_DL_LIBS}
  ${UNITTEST_LIBS}
  ${CRYPTO_LIBS})

set(test_rgw_obj_srcs test_rgw_obj.cc)
add_executable(ceph_test_rgw_obj
  ${test_rgw_obj_srcs}
  )
target_link_libraries(ceph_test_rgw_obj
  test_rgw_a
  cls_rgw_client
  cls_lock_client
  cls_refcount_client
  cls_log_client
  cls_version_client
  cls_user_client
  librados
  global
  ceph-common
  ${CURL_LIBRARIES}
  ${EXPAT_LIBRARIES}
  ${CMAKE_DL_LIBS}
  ${UNITTEST_LIBS}
  ${CRYPTO_LIBS}
  )
install(TARGETS ceph_test_rgw_obj DESTINATION ${CMAKE_INSTALL_BINDIR})

set(test_rgw_crypto_srcs test_rgw_crypto.cc)
add_executable(unittest_rgw_crypto
  ${test_rgw_crypto_srcs}
  )
add_ceph_unittest(unittest_rgw_crypto)
target_link_libraries(unittest_rgw_crypto
  ${rgw_libs}
  cls_rgw_client
  cls_lock_client
  cls_refcount_client
  cls_log_client
  cls_version_client
  cls_user_client
  librados
  global
  ${CURL_LIBRARIES}
  ${EXPAT_LIBRARIES}
  ${CMAKE_DL_LIBS}
  ${UNITTEST_LIBS}
  ${CRYPTO_LIBS}
  )

set(test_rgw_reshard_srcs test_rgw_reshard.cc)
add_executable(unittest_rgw_reshard
  ${test_rgw_reshard_srcs}
  )
add_ceph_unittest(unittest_rgw_reshard)
target_link_libraries(unittest_rgw_reshard
  ${rgw_libs}
  )

add_executable(unittest_rgw_putobj test_rgw_putobj.cc)
add_ceph_unittest(unittest_rgw_putobj)
target_link_libraries(unittest_rgw_putobj ${rgw_libs} ${UNITTEST_LIBS})

add_executable(ceph_test_rgw_throttle
  test_rgw_throttle.cc
  $<TARGET_OBJECTS:unit-main>)
target_link_libraries(ceph_test_rgw_throttle ${rgw_libs}
  librados global ${UNITTEST_LIBS})
install(TARGETS ceph_test_rgw_throttle DESTINATION ${CMAKE_INSTALL_BINDIR})

add_executable(unittest_rgw_iam_policy test_rgw_iam_policy.cc)
add_ceph_unittest(unittest_rgw_iam_policy)
target_link_libraries(unittest_rgw_iam_policy
  ${rgw_libs}
  cls_rgw_client
  cls_lock_client
  cls_refcount_client
  cls_log_client
  cls_version_client
  cls_user_client
  librados
  global
  ${CURL_LIBRARIES}
  ${EXPAT_LIBRARIES}
  ${CMAKE_DL_LIBS}
  ${UNITTEST_LIBS}
  ${CRYPTO_LIBS}
  )

add_executable(unittest_rgw_string test_rgw_string.cc)
add_ceph_unittest(unittest_rgw_string)
target_include_directories(unittest_rgw_string
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")

# unitttest_rgw_dmclock_queue
add_executable(unittest_rgw_dmclock_scheduler test_rgw_dmclock_scheduler.cc $<TARGET_OBJECTS:unit-main>)
add_ceph_unittest(unittest_rgw_dmclock_scheduler)
target_include_directories(unittest_rgw_dmclock_scheduler
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")

target_link_libraries(unittest_rgw_dmclock_scheduler rgw_schedulers global ${UNITTEST_LIBS})

if(WITH_RADOSGW_AMQP_ENDPOINT)
  add_executable(unittest_rgw_amqp test_rgw_amqp.cc)
  add_ceph_unittest(unittest_rgw_amqp)
  target_include_directories(unittest_rgw_amqp
    SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
    SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
  target_link_libraries(unittest_rgw_amqp ${rgw_libs})
endif()

# unittest_rgw_xml
add_executable(unittest_rgw_xml test_rgw_xml.cc)
add_ceph_unittest(unittest_rgw_xml)
target_include_directories(unittest_rgw_xml
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_xml ${rgw_libs} ${EXPAT_LIBRARIES})

# unittest_rgw_lc
add_executable(unittest_rgw_lc test_rgw_lc.cc)
add_ceph_unittest(unittest_rgw_lc)
target_include_directories(unittest_rgw_lc
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_lc
  rgw_common ${rgw_libs} ${EXPAT_LIBRARIES})

# unittest_rgw_arn
add_executable(unittest_rgw_arn test_rgw_arn.cc)
add_ceph_unittest(unittest_rgw_arn)
target_include_directories(unittest_rgw_arn
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_arn ${rgw_libs})

# unittest_rgw_kms
add_executable(unittest_rgw_kms test_rgw_kms.cc)
add_ceph_unittest(unittest_rgw_kms)
target_include_directories(unittest_rgw_kms
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_kms ${rgw_libs})

# unittest_rgw_url
add_executable(unittest_rgw_url test_rgw_url.cc)
add_ceph_unittest(unittest_rgw_url)
target_include_directories(unittest_rgw_url
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_url ${rgw_libs})

add_executable(ceph_test_rgw_gc_log test_rgw_gc_log.cc $<TARGET_OBJECTS:unit-main>)
target_include_directories(ceph_test_rgw_gc_log
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(ceph_test_rgw_gc_log ${rgw_libs} radostest-cxx)
install(TARGETS ceph_test_rgw_gc_log DESTINATION ${CMAKE_INSTALL_BINDIR})

add_ceph_test(test-ceph-diff-sorted.sh
  ${CMAKE_CURRENT_SOURCE_DIR}/test-ceph-diff-sorted.sh)

# unittest_cls_fifo_legacy
add_executable(unittest_cls_fifo_legacy test_cls_fifo_legacy.cc)
target_include_directories(unittest_cls_fifo_legacy
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_cls_fifo_legacy radostest-cxx ${UNITTEST_LIBS}
  ${rgw_libs})

# unittest_log_backing
add_executable(unittest_log_backing test_log_backing.cc)
target_include_directories(unittest_log_backing
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_log_backing radostest-cxx ${UNITTEST_LIBS}
  ${rgw_libs})

add_executable(unittest_rgw_lua test_rgw_lua.cc)
add_ceph_unittest(unittest_rgw_lua)
target_include_directories(unittest_rgw_lua
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw"
  SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/rgw/store/rados")
target_link_libraries(unittest_rgw_lua ${rgw_libs})

add_executable(radosgw-cr-test rgw_cr_test.cc)
target_link_libraries(radosgw-cr-test ${rgw_libs} librados
  cls_rgw_client cls_otp_client cls_lock_client cls_refcount_client
  cls_log_client cls_timeindex_client
  cls_version_client cls_user_client
  global ${LIB_RESOLV}
  OATH::OATH
  ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${BLKID_LIBRARIES}
  GTest::GTest)