summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorAdam C. Emerson <aemerson@redhat.com>2023-04-14 20:59:19 +0200
committerAdam Emerson <aemerson@redhat.com>2024-01-24 21:51:46 +0100
commit7c4eee61c4ab6e54f9298053eaecde682b19cc2b (patch)
treea97dcdff66328c0c0535824bd11235cea5d680e3 /src/test
parentceph/async: `io_context_pool` constructor/start takes init function (diff)
downloadceph-7c4eee61c4ab6e54f9298053eaecde682b19cc2b.tar.xz
ceph-7c4eee61c4ab6e54f9298053eaecde682b19cc2b.zip
rgw: SAL drivers take `boost::asio::io_context`
`RadosDriver` needs it, and since SAL generally uses `optional_yield`, other stores are going to need it to implement that sensibly. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rgw/rgw_cr_test.cc4
-rw-r--r--src/test/rgw/test_d4n_filter.cc4
-rw-r--r--src/test/rgw/test_rgw_iam_policy.cc4
-rw-r--r--src/test/rgw/test_rgw_lua.cc7
4 files changed, 15 insertions, 4 deletions
diff --git a/src/test/rgw/rgw_cr_test.cc b/src/test/rgw/rgw_cr_test.cc
index 2c250b390a9..db59dd1841b 100644
--- a/src/test/rgw/rgw_cr_test.cc
+++ b/src/test/rgw/rgw_cr_test.cc
@@ -10,7 +10,7 @@
#include "include/rados/librados.hpp"
-#include "rgw_tools.h"
+#include "common/async/context_pool.h"
#include "common/common_init.h"
#include "common/config.h"
@@ -321,12 +321,14 @@ int main(int argc, const char **argv)
common_init_finish(g_ceph_context);
+ ceph::async::io_context_pool context_pool{cct->_conf->rgw_thread_pool_size};
DriverManager::Config cfg = DriverManager::get_config(true, g_ceph_context);
store = static_cast<rgw::sal::RadosStore*>(
DriverManager::get_storage(dpp(),
g_ceph_context,
cfg,
+ context_pool,
false,
false,
false,
diff --git a/src/test/rgw/test_d4n_filter.cc b/src/test/rgw/test_d4n_filter.cc
index b1483f26e0d..00f7f24e00f 100644
--- a/src/test/rgw/test_d4n_filter.cc
+++ b/src/test/rgw/test_d4n_filter.cc
@@ -12,6 +12,8 @@
#include "rgw_auth.h"
#include "rgw_auth_registry.h"
+#include <boost/asio/io_context.hpp>
+
#define dout_subsys ceph_subsys_rgw
#define METADATA_LENGTH 22
@@ -33,6 +35,7 @@ class StoreObject : public rgw::sal::StoreObject {
};
class Environment : public ::testing::Environment {
+ boost::asio::io_context ioc;
public:
Environment() {}
@@ -61,6 +64,7 @@ class Environment : public ::testing::Environment {
driver = DriverManager::get_storage(dpp, dpp->get_cct(),
cfg,
+ ioc,
false,
false,
false,
diff --git a/src/test/rgw/test_rgw_iam_policy.cc b/src/test/rgw/test_rgw_iam_policy.cc
index 9c5f8d9caa3..b7cd66f6ea5 100644
--- a/src/test/rgw/test_rgw_iam_policy.cc
+++ b/src/test/rgw/test_rgw_iam_policy.cc
@@ -20,6 +20,7 @@
#include <gtest/gtest.h>
#include "include/stringify.h"
+#include "common/async/context_pool.h"
#include "common/code_environment.h"
#include "common/ceph_context.h"
#include "global/global_init.h"
@@ -912,7 +913,8 @@ TEST_F(IPPolicyTest, IPEnvironment) {
RGWProcessEnv penv;
// Unfortunately RGWCivetWeb is too tightly tied to civetweb to test RGWCivetWeb::init_env.
RGWEnv rgw_env;
- rgw::sal::RadosStore store;
+ ceph::async::io_context_pool context_pool(cct->_conf->rgw_thread_pool_size); \
+ rgw::sal::RadosStore store(context_pool);
std::unique_ptr<rgw::sal::User> user = store.get_user(rgw_user());
rgw_env.set("REMOTE_ADDR", "192.168.1.1");
rgw_env.set("HTTP_HOST", "1.2.3.4");
diff --git a/src/test/rgw/test_rgw_lua.cc b/src/test/rgw/test_rgw_lua.cc
index 0485e71ede3..1ae7976c794 100644
--- a/src/test/rgw/test_rgw_lua.cc
+++ b/src/test/rgw/test_rgw_lua.cc
@@ -1,4 +1,5 @@
#include <gtest/gtest.h>
+#include "common/async/context_pool.h"
#include "common/ceph_context.h"
#include "rgw_common.h"
#include "rgw_auth_registry.h"
@@ -159,8 +160,10 @@ CctCleaner cleaner(g_cct);
tracing::Tracer tracer;
-#define MAKE_STORE auto store = std::unique_ptr<sal::RadosStore>(new sal::RadosStore); \
- store->setRados(new RGWRados);
+#define MAKE_STORE \
+ ceph::async::io_context_pool context_pool(g_cct->_conf->rgw_thread_pool_size); \
+ auto store = std::unique_ptr<sal::RadosStore>(new sal::RadosStore(context_pool)); \
+ store->setRados(new RGWRados);
#define DEFINE_REQ_STATE RGWProcessEnv pe; \
MAKE_STORE; \