#include "test/librados/test.h"
#include "test/librados/TestCase.h"
#include "include/scope_guard.h"
-
+#include "crimson_utils.h"
std::string RadosTestNS::pool_name;
rados_t RadosTestNS::s_cluster = NULL;
void RadosTestECNS::SetUp()
{
+ SKIP_IF_CRIMSON();
cluster = RadosTestECNS::s_cluster;
ASSERT_EQ(0, rados_ioctx_create(cluster, pool_name.c_str(), &ioctx));
int req;
void RadosTestECNS::TearDown()
{
+ SKIP_IF_CRIMSON();
if (cleanup)
cleanup_all_objects(ioctx);
rados_ioctx_destroy(ioctx);
#include <cstdlib>
-bool is_crimson_cluster() {
- return (getenv("CRIMSON_COMPAT") != nullptr);
+static inline bool is_crimson_cluster() {
+ return getenv("CRIMSON_COMPAT") != nullptr;
}
#define SKIP_IF_CRIMSON() \
static std::string src_pool_name;
void SetUp() override {
+ SKIP_IF_CRIMSON();
RadosTestECPP::SetUp();
ASSERT_EQ(0, cluster.ioctx_create(src_pool_name.c_str(), src_ioctx));
src_ioctx.set_namespace(nspace);
}
void TearDown() override {
+ SKIP_IF_CRIMSON();
// wait for maps to settle before next test
cluster.wait_for_latest_osdmap();
static std::string cache_pool_name;
void SetUp() override {
+ SKIP_IF_CRIMSON();
cache_pool_name = get_temp_pool_name();
ASSERT_EQ(0, s_cluster.pool_create(cache_pool_name.c_str()));
RadosTestPP::SetUp();
cache_ioctx.set_namespace(nspace);
}
void TearDown() override {
+ SKIP_IF_CRIMSON();
// flush + evict cache
flush_evict_all(cluster, cache_ioctx);
static std::string cache_pool_name;
void SetUp() override {
+ SKIP_IF_CRIMSON();
cache_pool_name = get_temp_pool_name();
ASSERT_EQ(0, s_cluster.pool_create(cache_pool_name.c_str()));
RadosTestECPP::SetUp();
cache_ioctx.set_namespace(nspace);
}
void TearDown() override {
+ SKIP_IF_CRIMSON();
// flush + evict cache
flush_evict_all(cluster, cache_ioctx);