blob: 637ec11eefc74cdefbd8dce97900d97aceb090d5 (
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
|
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab
#pragma once
#include "gtest/gtest.h"
#include "include/rados/librados.hpp"
class RadosTestPPNS : public ::testing::Test {
public:
RadosTestPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestPPNS() override {}
protected:
static void SetUpTestCase();
static void TearDownTestCase();
static void cleanup_all_objects(librados::IoCtx ioctx);
static librados::Rados s_cluster;
static std::string pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
bool cleanup;
};
struct RadosTestPPNSCleanup : public RadosTestPPNS {
RadosTestPPNSCleanup() : RadosTestPPNS(true) {}
};
class RadosTestParamPPNS : public ::testing::TestWithParam<const char*> {
public:
RadosTestParamPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestParamPPNS() override {}
static void SetUpTestCase();
static void TearDownTestCase();
protected:
static void cleanup_all_objects(librados::IoCtx ioctx);
static librados::Rados s_cluster;
static std::string pool_name;
static std::string cache_pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
bool cleanup;
};
class RadosTestECPPNS : public RadosTestPPNS {
public:
RadosTestECPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestECPPNS() override {}
protected:
static void SetUpTestCase();
static void TearDownTestCase();
static librados::Rados s_cluster;
static std::string pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
uint64_t alignment = 0;
bool cleanup;
};
struct RadosTestECPPNSCleanup : public RadosTestECPPNS {
RadosTestECPPNSCleanup() : RadosTestECPPNS(true) {}
};
class RadosTestPP : public ::testing::Test {
public:
RadosTestPP(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestPP() override {}
protected:
static void SetUpTestCase();
static void TearDownTestCase();
static void cleanup_default_namespace(librados::IoCtx ioctx);
static void cleanup_namespace(librados::IoCtx ioctx, std::string ns);
static librados::Rados s_cluster;
static std::string pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
bool cleanup;
std::string nspace;
};
class RadosTestParamPP : public ::testing::TestWithParam<const char*> {
public:
RadosTestParamPP(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestParamPP() override {}
static void SetUpTestCase();
static void TearDownTestCase();
protected:
static void cleanup_default_namespace(librados::IoCtx ioctx);
static void cleanup_namespace(librados::IoCtx ioctx, std::string ns);
static librados::Rados s_cluster;
static std::string pool_name;
static std::string cache_pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
bool cleanup;
std::string nspace;
};
class RadosTestECPP : public RadosTestPP {
public:
RadosTestECPP(bool c=false) : cluster(s_cluster), cleanup(c) {}
~RadosTestECPP() override {}
protected:
static void SetUpTestCase();
static void TearDownTestCase();
static librados::Rados s_cluster;
static std::string pool_name;
void SetUp() override;
void TearDown() override;
librados::Rados &cluster;
librados::IoCtx ioctx;
bool cleanup;
std::string nspace;
uint64_t alignment = 0;
};
|