summaryrefslogtreecommitdiffstats
path: root/src/test/cls_sdk/test_cls_sdk.cc
blob: 44b32196b3aacb4243c8eb57660d60f11b7bbf40 (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
#include <iostream>
#include <errno.h>

#include "test/librados/test_cxx.h"
#include "gtest/gtest.h"

using namespace librados;

TEST(ClsSDK, TestSDKCoverageWrite) {
  Rados cluster;
  std::string pool_name = get_temp_pool_name();
  ASSERT_EQ("", create_one_pool_pp(pool_name, cluster));
  IoCtx ioctx;
  cluster.ioctx_create(pool_name.c_str(), ioctx);

  bufferlist in, out;
  ASSERT_EQ(0, ioctx.exec("myobject", "sdk", "test_coverage_write", in, out));

  ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
}

TEST(ClsSDK, TestSDKCoverageReplay) {
  Rados cluster;
  std::string pool_name = get_temp_pool_name();
  ASSERT_EQ("", create_one_pool_pp(pool_name, cluster));
  IoCtx ioctx;
  cluster.ioctx_create(pool_name.c_str(), ioctx);

  bufferlist in, out;
  ASSERT_EQ(0, ioctx.exec("myobject", "sdk", "test_coverage_write", in, out));
  ASSERT_EQ(0, ioctx.exec("myobject", "sdk", "test_coverage_replay", in, out));

  ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster));
}