diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:17 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-23 16:45:44 +0000 |
commit | 17d6a993fc17d533460c5f40f3908c708e057c18 (patch) | |
tree | 1a3bd93e0ecd74fa02f93a528fe2f87e5314c4b5 /src/test/client | |
parent | Releasing progress-linux version 18.2.2-0progress7.99u1. (diff) | |
download | ceph-17d6a993fc17d533460c5f40f3908c708e057c18.tar.xz ceph-17d6a993fc17d533460c5f40f3908c708e057c18.zip |
Merging upstream version 18.2.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/client')
-rw-r--r-- | src/test/client/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/test/client/commands.cc | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/test/client/CMakeLists.txt b/src/test/client/CMakeLists.txt index 1937bdd0b..3d3e327f3 100644 --- a/src/test/client/CMakeLists.txt +++ b/src/test/client/CMakeLists.txt @@ -3,6 +3,7 @@ if(${WITH_CEPHFS}) main.cc alternate_name.cc ops.cc + commands.cc ) target_link_libraries(ceph_test_client client diff --git a/src/test/client/commands.cc b/src/test/client/commands.cc new file mode 100644 index 000000000..c1fe76331 --- /dev/null +++ b/src/test/client/commands.cc @@ -0,0 +1,48 @@ +#include <errno.h> + +#include <iostream> +#include <string> +#include <vector> +#include <unordered_map> + +#include <fmt/format.h> + +#include "test/client/TestClient.h" + + +TEST_F(TestClient, SingleTargetMdsCommand) { + auto mds_spec = "a"; + auto cmd = "{\"prefix\": \"session ls\", \"format\": \"json\"}"; + bufferlist inbl; + bufferlist outbl; + std::string outs; + std::vector<std::string> cmdv; + C_SaferCond cond; + + cmdv.push_back(cmd); + int r = client->mds_command(mds_spec, cmdv, inbl, &outbl, &outs, &cond); + r = cond.wait(); + + std::cout << "SingleTargetMdsCommand: " << outbl.c_str() << std::endl; + + ASSERT_TRUE(r == 0 || r == -38); +} + +TEST_F(TestClient, MultiTargetMdsCommand) { + auto mds_spec = "*"; + auto cmd = "{\"prefix\": \"session ls\", \"format\": \"json\"}"; + bufferlist inbl; + bufferlist outbl; + std::string outs; + std::vector<std::string> cmdv; + C_SaferCond cond; + + cmdv.push_back(cmd); + std::cout << "MultiTargetMds: " << std::endl; + int r = client->mds_command(mds_spec, cmdv, inbl, &outbl, &outs, &cond); + r = cond.wait(); + + std::cout << "MultiTargetMdsCommand: " << outbl.c_str() << std::endl; + + ASSERT_TRUE(r == 0 || r == -38); +} |