From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/test/librados/cls.cc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/test/librados/cls.cc (limited to 'src/test/librados/cls.cc') diff --git a/src/test/librados/cls.cc b/src/test/librados/cls.cc new file mode 100644 index 000000000..c4f24954d --- /dev/null +++ b/src/test/librados/cls.cc @@ -0,0 +1,36 @@ +#include +#include +#include +#include + +#include "gtest/gtest.h" + +#include "include/rados/librados.hpp" +#include "test/librados/test_cxx.h" + +using namespace librados; +using std::map; +using std::ostringstream; +using std::string; + +TEST(LibRadosCls, DNE) { + 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); + + // create an object + string oid = "foo"; + bufferlist bl; + ASSERT_EQ(0, ioctx.write(oid, bl, bl.length(), 0)); + + // call a bogus class + ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, "doesnotexistasdfasdf", "method", bl, bl)); + + // call a bogus method on existent class + ASSERT_EQ(-EOPNOTSUPP, ioctx.exec(oid, "lock", "doesnotexistasdfasdfasdf", bl, bl)); + + ioctx.close(); + ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster)); +} -- cgit v1.2.3