From: Jon Date: Mon, 23 Jun 2025 12:57:20 +0000 (+0100) Subject: test/osd: Enable an application for pools created by ceph_test_rados_io_sequence X-Git-Tag: v21.0.0~256^2~47^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=932af7392ecf1dddd67bb4c7043b9e072687245d;p=ceph.git test/osd: Enable an application for pools created by ceph_test_rados_io_sequence Remove warnings about there not being an application enabled produced by ceph for pools that are created by ceph_test_rados_io_sequence by setting an application after creation of pools make by the test tool. Signed-off-by: Jon Bailey --- diff --git a/src/common/json/OSDStructures.cc b/src/common/json/OSDStructures.cc index ecf382a7549..874c314f5dd 100644 --- a/src/common/json/OSDStructures.cc +++ b/src/common/json/OSDStructures.cc @@ -183,4 +183,21 @@ void InjectECClearParityRead::dump(Formatter* f) const { void InjectECClearParityRead::decode_json(JSONObj* obj) { JSONDecoder::decode_json("pool", pool, obj); JSONDecoder::decode_json("objname", objname, obj); +} + +void OSDEnableApplicationRequest::dump(Formatter* f) const { + encode_json("prefix", "osd pool application enable", f); + encode_json("pool", pool, f); + encode_json("app", app, f); + encode_json("yes_i_really_mean_it", yes_i_really_mean_it, f); + encode_json("key", key, f); + encode_json("value", value, f); +} + +void OSDEnableApplicationRequest::decode_json(JSONObj* obj) { + JSONDecoder::decode_json("pool", pool, obj); + JSONDecoder::decode_json("app", app, obj); + JSONDecoder::decode_json("yes_i_really_mean_it", yes_i_really_mean_it, obj); + JSONDecoder::decode_json("key", key, obj); + JSONDecoder::decode_json("value", value, obj); } \ No newline at end of file diff --git a/src/common/json/OSDStructures.h b/src/common/json/OSDStructures.h index a521b7ab544..ea94a2bd641 100644 --- a/src/common/json/OSDStructures.h +++ b/src/common/json/OSDStructures.h @@ -113,6 +113,17 @@ struct OSDSetRequest { void decode_json(JSONObj* obj); }; + struct OSDEnableApplicationRequest { + std::string pool; + std::string app; + std::optional yes_i_really_mean_it; + std::optional key; + std::optional value; + + void dump(Formatter* f) const; + void decode_json(JSONObj* obj); + }; + // These structures are sent directly to the relevant OSD // rather than the monitor template diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc index 396ec815afa..3233c84ce2a 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.cc @@ -847,6 +847,8 @@ const std::string ceph::io_sequence::tester::SelectErasurePool::select() { configureServices(allow_pool_autoscaling, allow_pool_balancer, allow_pool_deep_scrubbing, allow_pool_scrubbing, test_recovery); + + setApplication(created_pool_name); } } @@ -872,6 +874,21 @@ std::string ceph::io_sequence::tester::SelectErasurePool::create() { return pool_name; } +void ceph::io_sequence::tester::SelectErasurePool::setApplication( + const std::string& pool_name) { + bufferlist inbl, outbl; + auto formatter = std::make_shared(false); + + ceph::messaging::osd::OSDEnableApplicationRequest + enableApplicationRequest{pool_name, "rados"}; + + int rc = send_mon_command(enableApplicationRequest, rados, + "OSDEnableApplicationRequest", inbl, &outbl, + formatter.get()); + + ceph_assert(rc == 0); +} + void ceph::io_sequence::tester::SelectErasurePool::configureServices( bool allow_pool_autoscaling, bool allow_pool_balancer, diff --git a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h index 16fe6d7b778..e9e11db368a 100644 --- a/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h +++ b/src/test/osd/ceph_test_rados_io_sequence/ceph_test_rados_io_sequence.h @@ -392,11 +392,6 @@ class SelectErasurePool : public ProgramOptionReader { bool disable_pool_ec_optimizations); const std::string select() override; std::string create(); - void configureServices(bool allow_pool_autoscaling, - bool allow_pool_balancer, - bool allow_pool_deep_scrubbing, - bool allow_pool_scrubbing, - bool test_recovery); inline bool get_allow_pool_autoscaling() { return allow_pool_autoscaling; } inline bool get_allow_pool_balancer() { return allow_pool_balancer; } @@ -425,6 +420,14 @@ class SelectErasurePool : public ProgramOptionReader { SelectErasureProfile sep; std::optional profile; + + void configureServices(bool allow_pool_autoscaling, + bool allow_pool_balancer, + bool allow_pool_deep_scrubbing, + bool allow_pool_scrubbing, + bool test_recovery); + + void setApplication(const std::string& pool_name); }; class TestObject {