From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/test/neorados/test_neorados.cc | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/test/neorados/test_neorados.cc (limited to 'src/test/neorados/test_neorados.cc') 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 + +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::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(); +} -- cgit v1.2.3