From 0f829ba4a6744abf4970b9279aecadb23f432969 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 21 Jan 2020 10:58:09 -0600 Subject: [PATCH] ceph_test_cls_hello: only do returndata test on octopus+ Signed-off-by: Sage Weil --- src/test/cls_hello/test_cls_hello.cc | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/test/cls_hello/test_cls_hello.cc b/src/test/cls_hello/test_cls_hello.cc index 3b3ae9a7517a3..b5413c89ac79e 100644 --- a/src/test/cls_hello/test_cls_hello.cc +++ b/src/test/cls_hello/test_cls_hello.cc @@ -14,11 +14,13 @@ #include #include +#include #include "include/rados/librados.hpp" #include "include/encoding.h" #include "test/librados/test_cxx.h" #include "gtest/gtest.h" +#include "json_spirit/json_spirit.h" using namespace librados; @@ -77,6 +79,32 @@ TEST(ClsHello, RecordHello) { ASSERT_EQ(0, destroy_one_pool_pp(pool_name, cluster)); } +static std::string _get_required_osd_release(Rados& cluster) +{ + bufferlist inbl; + std::string cmd = std::string("{\"prefix\": \"osd dump\",\"format\":\"json\"}"); + bufferlist outbl; + int r = cluster.mon_command(cmd, inbl, &outbl, NULL); + ceph_assert(r >= 0); + std::string outstr(outbl.c_str(), outbl.length()); + json_spirit::Value v; + if (!json_spirit::read(outstr, v)) { + std::cerr <<" unable to parse json " << outstr << std::endl; + return ""; + } + + json_spirit::Object& o = v.get_obj(); + for (json_spirit::Object::size_type i=0; i