diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/test/cls_sdk | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/cls_sdk')
-rw-r--r-- | src/test/cls_sdk/CMakeLists.txt | 15 | ||||
-rw-r--r-- | src/test/cls_sdk/test_cls_sdk.cc | 35 |
2 files changed, 50 insertions, 0 deletions
diff --git a/src/test/cls_sdk/CMakeLists.txt b/src/test/cls_sdk/CMakeLists.txt new file mode 100644 index 00000000..68085af2 --- /dev/null +++ b/src/test/cls_sdk/CMakeLists.txt @@ -0,0 +1,15 @@ +add_executable(ceph_test_cls_sdk + test_cls_sdk.cc + ) +target_link_libraries(ceph_test_cls_sdk + librados + global + ${EXTRALIBS} + ${BLKID_LIBRARIES} + ${CMAKE_DL_LIBS} + radostest-cxx + ${UNITTEST_LIBS} + ) +install(TARGETS + ceph_test_cls_sdk + DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/src/test/cls_sdk/test_cls_sdk.cc b/src/test/cls_sdk/test_cls_sdk.cc new file mode 100644 index 00000000..44b32196 --- /dev/null +++ b/src/test/cls_sdk/test_cls_sdk.cc @@ -0,0 +1,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)); +} + |