From: Sage Weil Date: Tue, 21 Jan 2020 16:58:09 +0000 (-0600) Subject: ceph_test_cls_hello: only do returndata test on octopus+ X-Git-Tag: v15.1.0~57^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f829ba4a6744abf4970b9279aecadb23f432969;p=ceph.git ceph_test_cls_hello: only do returndata test on octopus+ Signed-off-by: Sage Weil --- diff --git a/src/test/cls_hello/test_cls_hello.cc b/src/test/cls_hello/test_cls_hello.cc index 3b3ae9a7517..b5413c89ac7 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