]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/libradosstriper/TestCase.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_TEST_RADOS_TESTCASE_H
5 #define CEPH_TEST_RADOS_TESTCASE_H
7 #include "include/rados/librados.h"
8 #include "include/rados/librados.hpp"
9 #include "include/radosstriper/libradosstriper.h"
10 #include "include/radosstriper/libradosstriper.hpp"
11 #include "gtest/gtest.h"
16 * These test cases create a temporary pool that lives as long as the
17 * test case. Each test within a test case gets a new ioctx and striper
18 * set to a unique namespace within the pool.
20 * Since pool creation and deletion is slow, this allows many tests to
23 class StriperTest
: public ::testing::Test
{
26 ~StriperTest() override
{}
28 static void SetUpTestCase();
29 static void TearDownTestCase();
30 static rados_t s_cluster
;
31 static std::string pool_name
;
33 void SetUp() override
;
34 void TearDown() override
;
37 rados_striper_t striper
;
40 class StriperTestPP
: public ::testing::Test
{
42 StriperTestPP() : cluster(s_cluster
) {}
43 ~StriperTestPP() override
{}
44 static void SetUpTestCase();
45 static void TearDownTestCase();
47 static librados::Rados s_cluster
;
48 static std::string pool_name
;
50 void SetUp() override
;
51 librados::Rados
&cluster
;
52 librados::IoCtx ioctx
;
53 libradosstriper::RadosStriper striper
;
58 uint32_t stripe_count
;
62 // this is pure copy and paste from previous class
63 // but for the inheritance from TestWithParam
64 // with gtest >= 1.6, we couldd avoid this by using
65 // inheritance from WithParamInterface
66 class StriperTestParam
: public ::testing::TestWithParam
<TestData
> {
68 StriperTestParam() : cluster(s_cluster
) {}
69 ~StriperTestParam() override
{}
70 static void SetUpTestCase();
71 static void TearDownTestCase();
73 static librados::Rados s_cluster
;
74 static std::string pool_name
;
76 void SetUp() override
;
77 librados::Rados
&cluster
;
78 librados::IoCtx ioctx
;
79 libradosstriper::RadosStriper striper
;