summaryrefslogtreecommitdiffstats
path: root/src/test/neorados/test_neorados.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/neorados/test_neorados.cc
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/neorados/test_neorados.cc')
-rw-r--r--src/test/neorados/test_neorados.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/test/neorados/test_neorados.cc b/src/test/neorados/test_neorados.cc
new file mode 100644
index 000000000..953e772e1
--- /dev/null
+++ b/src/test/neorados/test_neorados.cc
@@ -0,0 +1,47 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+#include "include/rados/librados.hpp"
+#include "include/neorados/RADOS.hpp"
+#include "common/async/blocked_completion.h"
+#include "test/librados/test_cxx.h"
+#include "gtest/gtest.h"
+#include <iostream>
+
+namespace neorados {
+
+class TestNeoRADOS : public ::testing::Test {
+public:
+ TestNeoRADOS() {
+ }
+};
+
+TEST_F(TestNeoRADOS, MakeWithLibRADOS) {
+ librados::Rados paleo_rados;
+ auto result = connect_cluster_pp(paleo_rados);
+ ASSERT_EQ("", result);
+
+ auto rados = RADOS::make_with_librados(paleo_rados);
+
+ ReadOp op;
+ bufferlist bl;
+ op.read(0, 0, &bl);
+
+ // provide pool that doesn't exists -- just testing round-trip
+ ASSERT_THROW(
+ rados.execute({"dummy-obj"}, std::numeric_limits<int64_t>::max(),
+ std::move(op), nullptr, ceph::async::use_blocked),
+ boost::system::system_error);
+}
+
+} // namespace neorados
+
+int main(int argc, char **argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+
+ int seed = getpid();
+ std::cout << "seed " << seed << std::endl;
+ srand(seed);
+
+ return RUN_ALL_TESTS();
+}