]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #pragma once | |
5 | ||
6 | #include "gtest/gtest.h" | |
7 | #include "include/rados/librados.hpp" | |
8 | ||
9 | class RadosTestPPNS : public ::testing::Test { | |
10 | public: | |
11 | RadosTestPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
12 | ~RadosTestPPNS() override {} | |
13 | protected: | |
14 | static void SetUpTestCase(); | |
15 | static void TearDownTestCase(); | |
16 | static void cleanup_all_objects(librados::IoCtx ioctx); | |
17 | static librados::Rados s_cluster; | |
18 | static std::string pool_name; | |
19 | ||
20 | void SetUp() override; | |
21 | void TearDown() override; | |
22 | librados::Rados &cluster; | |
23 | librados::IoCtx ioctx; | |
24 | bool cleanup; | |
25 | }; | |
26 | ||
27 | struct RadosTestPPNSCleanup : public RadosTestPPNS { | |
28 | RadosTestPPNSCleanup() : RadosTestPPNS(true) {} | |
29 | }; | |
30 | ||
31 | class RadosTestParamPPNS : public ::testing::TestWithParam<const char*> { | |
32 | public: | |
33 | RadosTestParamPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
34 | ~RadosTestParamPPNS() override {} | |
35 | static void SetUpTestCase(); | |
36 | static void TearDownTestCase(); | |
37 | protected: | |
38 | static void cleanup_all_objects(librados::IoCtx ioctx); | |
39 | static librados::Rados s_cluster; | |
40 | static std::string pool_name; | |
41 | static std::string cache_pool_name; | |
42 | ||
43 | void SetUp() override; | |
44 | void TearDown() override; | |
45 | librados::Rados &cluster; | |
46 | librados::IoCtx ioctx; | |
47 | bool cleanup; | |
48 | }; | |
49 | ||
50 | class RadosTestECPPNS : public RadosTestPPNS { | |
51 | public: | |
52 | RadosTestECPPNS(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
53 | ~RadosTestECPPNS() override {} | |
54 | protected: | |
55 | static void SetUpTestCase(); | |
56 | static void TearDownTestCase(); | |
57 | static librados::Rados s_cluster; | |
58 | static std::string pool_name; | |
59 | ||
60 | void SetUp() override; | |
61 | void TearDown() override; | |
62 | librados::Rados &cluster; | |
63 | librados::IoCtx ioctx; | |
64 | uint64_t alignment = 0; | |
65 | bool cleanup; | |
66 | }; | |
67 | ||
68 | struct RadosTestECPPNSCleanup : public RadosTestECPPNS { | |
69 | RadosTestECPPNSCleanup() : RadosTestECPPNS(true) {} | |
70 | }; | |
71 | ||
72 | class RadosTestPP : public ::testing::Test { | |
73 | public: | |
74 | RadosTestPP(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
75 | ~RadosTestPP() override {} | |
76 | protected: | |
77 | static void SetUpTestCase(); | |
78 | static void TearDownTestCase(); | |
79 | static void cleanup_default_namespace(librados::IoCtx ioctx); | |
80 | static void cleanup_namespace(librados::IoCtx ioctx, std::string ns); | |
81 | static librados::Rados s_cluster; | |
82 | static std::string pool_name; | |
83 | ||
84 | void SetUp() override; | |
85 | void TearDown() override; | |
86 | librados::Rados &cluster; | |
87 | librados::IoCtx ioctx; | |
88 | bool cleanup; | |
89 | std::string nspace; | |
90 | }; | |
91 | ||
92 | class RadosTestParamPP : public ::testing::TestWithParam<const char*> { | |
93 | public: | |
94 | RadosTestParamPP(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
95 | ~RadosTestParamPP() override {} | |
96 | static void SetUpTestCase(); | |
97 | static void TearDownTestCase(); | |
98 | protected: | |
99 | static void cleanup_default_namespace(librados::IoCtx ioctx); | |
100 | static void cleanup_namespace(librados::IoCtx ioctx, std::string ns); | |
101 | static librados::Rados s_cluster; | |
102 | static std::string pool_name; | |
103 | static std::string cache_pool_name; | |
104 | ||
105 | void SetUp() override; | |
106 | void TearDown() override; | |
107 | librados::Rados &cluster; | |
108 | librados::IoCtx ioctx; | |
109 | bool cleanup; | |
110 | std::string nspace; | |
111 | }; | |
112 | ||
113 | class RadosTestECPP : public RadosTestPP { | |
114 | public: | |
115 | RadosTestECPP(bool c=false) : cluster(s_cluster), cleanup(c) {} | |
116 | ~RadosTestECPP() override {} | |
117 | protected: | |
118 | static void SetUpTestCase(); | |
119 | static void TearDownTestCase(); | |
120 | static librados::Rados s_cluster; | |
121 | static std::string pool_name; | |
122 | ||
123 | void SetUp() override; | |
124 | void TearDown() override; | |
125 | librados::Rados &cluster; | |
126 | librados::IoCtx ioctx; | |
127 | bool cleanup; | |
128 | std::string nspace; | |
129 | uint64_t alignment = 0; | |
130 | }; |